From 1cf757b3acc0835acfef73aa47766fcc81212f0c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Tue, 30 Apr 2024 11:45:02 -0400 Subject: [PATCH 01/15] Make base changes --- packages/camera/camera/CHANGELOG.md | 4 ++- packages/camera/camera/README.md | 2 -- packages/camera/camera/pubspec.yaml | 6 ++-- packages/camera/camera_android/README.md | 30 ++++++++-------- .../camera/camera_android_camerax/README.md | 35 +++++++++---------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 8ad0b49fe98e..c9377d9b32b2 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,5 +1,7 @@ -## NEXT +## 0.11.0 +* **Breaking Change** Changes the Android implementation of the camera plugin from `camera_android` + to `camera_android_camerax`. To continue using `camera_android`, use `camera <0.11.0`. * Updates minimum supported SDK version to Flutter 3.13/Dart 3.1. * Updates support matrix in README to indicate that iOS 11 is no longer supported. * Clients on versions of Flutter that still support iOS 11 can continue to use this diff --git a/packages/camera/camera/README.md b/packages/camera/camera/README.md index 5458b926c499..201599387572 100644 --- a/packages/camera/camera/README.md +++ b/packages/camera/camera/README.md @@ -45,8 +45,6 @@ Change the minimum Android sdk version to 21 (or higher) in your `android/app/bu minSdkVersion 21 ``` -It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. Specifically, when recording a video with sound enabled and trying to play it back, the duration won't be correct and you will only see the first frame. - ### Web integration For web integration details, see the diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index dc5755bb8829..f0835684b3b8 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -4,7 +4,7 @@ description: A Flutter plugin for controlling the camera. Supports previewing Dart. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.5+9 +version: 0.11.0 environment: sdk: ^3.1.0 @@ -14,14 +14,14 @@ flutter: plugin: platforms: android: - default_package: camera_android + default_package: camera_android_camerax ios: default_package: camera_avfoundation web: default_package: camera_web dependencies: - camera_android: ^0.10.7 + camera_android_camerax: ^0.6.4 camera_avfoundation: ^0.9.13 camera_platform_interface: ^2.5.0 camera_web: ^0.3.1 diff --git a/packages/camera/camera_android/README.md b/packages/camera/camera_android/README.md index 31f2d66ae4e4..4f1e00a9156d 100644 --- a/packages/camera/camera_android/README.md +++ b/packages/camera/camera_android/README.md @@ -1,24 +1,26 @@ # camera\_android -The Android implementation of [`camera`][1]. - -*Note*: [`camera_android_camerax`][3] will become the default implementation of -`camera` on Android by May 2024, so **we strongly encourage you to opt into it** -by using [these instructions][4]. If any [limitations][5] of `camera_android_camerax` -prevent you from using it or if you run into any problems, please report these -issues under [`flutter/flutter`][5] with `[camerax]` in the title. +An Android implementation of [`camera`][1] built with the [Camera2 library][4]. ## Usage -This package is [endorsed][2], which means you can simply use `camera` -normally. This package will be automatically included in your app when you do, -so you do not need to add it to your `pubspec.yaml`. +As of `camera: ^0.11.0`, to use this plugin instead of [`camera_android_camerax`][3], +run + +```sh +$ flutter pub add camera_android +``` + +If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android_camerax`][3], +you can simply use `camera` normally because it is [endorsed][2]. This package will automatically +be included in your app when you do so, so you do not need to add it to your `pubspec.yaml`. + +However, if you `import` this package with a version lower than `0.11.0`, to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual. -However, if you `import` this package to use any of its APIs directly, you -should add it to your `pubspec.yaml` as usual. +## Limitation of testing video recording on emulators +It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. Specifically, when recording a video with sound enabled and trying to play it back, the duration won't be correct and you will only see the first frame. [1]: https://pub.dev/packages/camera [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin [3]: https://pub.dev/packages/camera_android_camerax -[4]: https://pub.dev/packages/camera_android_camerax#usage -[5]: https://pub.dev/packages/camera_android_camerax#limitations +[4]: https://developer.android.com/media/camera/camera2 diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index 64a56f1a3b54..d3674d2d24e9 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -1,17 +1,23 @@ # camera\_android\_camerax -An Android implementation of [`camera`][1] that uses the [CameraX library][2]. +The Android implementation of [`camera`][1] built with the [CameraX library][2]. -*Note*: This implementation will become the default implementation of `camera` -on Android by May 2024, so **we strongly encourage you to opt into it** -by using [the instructions](#usage) below. If any of [the limitations](#limitations) -prevent you from using `camera_android_camerax` or if you run into any problems, -please report these issues under [`flutter/flutter`][5] with `[camerax]` in -the title. +*Note*: If any of [the limitations](#limitations) prevent you from using +using `camera_android_camerax` or if you run into any problems, please report +report these issues under [`flutter/flutter`][5] with `[camerax]` in the title. +You may also opt back into the [`camera_android`][6] implementation if you need. ## Usage -To use this plugin instead of [`camera_android`][4], run +As of `camera: ^0.11.0`, this package is [endorsed][3], which means you can +simply use `camera` normally. This package will be automatically be included +in your app when you do, so you do not need to add it to your `pubspec.yaml`. + +However, if you `import` this package to use any of its APIs directly, you +should add it to your `pubspec.yaml` as usual. + +If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android`][4], +run ```sh $ flutter pub add camera_android_camerax @@ -24,7 +30,7 @@ from your project's root directory. ### 240p resolution configuration for video recording 240p resolution configuration for video recording is unsupported by CameraX, -and thus, the plugin will fall back to 480p if configured with a +and thus, the plugin will fall back to target 480p if configured with a `ResolutionPreset`. ### Setting maximum duration and stream options for video capture @@ -42,14 +48,7 @@ For more information on contributing to this plugin, see [`CONTRIBUTING.md`](CON [1]: https://pub.dev/packages/camera [2]: https://developer.android.com/training/camerax -[3]: https://docs.flutter.dev/packages-and-plugins/developing-packages#non-endorsed-federated-plugin +[3]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin [4]: https://pub.dev/packages/camera_android [5]: https://github.com/flutter/flutter/issues/new/choose -[120462]: https://github.com/flutter/flutter/issues/120462 -[125915]: https://github.com/flutter/flutter/issues/125915 -[120715]: https://github.com/flutter/flutter/issues/120715 -[120468]: https://github.com/flutter/flutter/issues/120468 -[120467]: https://github.com/flutter/flutter/issues/120467 -[125371]: https://github.com/flutter/flutter/issues/125371 -[126477]: https://github.com/flutter/flutter/issues/126477 -[127896]: https://github.com/flutter/flutter/issues/127896 +[6]: https://pub.dev/packages/camera_android#usage \ No newline at end of file From f55614aaaa5e36a94baf017badf648d0bc034277 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 6 May 2024 11:45:09 -0400 Subject: [PATCH 02/15] Bump version --- packages/camera/camera_android/CHANGELOG.md | 5 +++++ packages/camera/camera_android/pubspec.yaml | 2 +- packages/camera/camera_android_camerax/CHANGELOG.md | 5 +++++ packages/camera/camera_android_camerax/pubspec.yaml | 2 +- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/camera/camera_android/CHANGELOG.md b/packages/camera/camera_android/CHANGELOG.md index 66cd2dc329ef..9e915b751d65 100644 --- a/packages/camera/camera_android/CHANGELOG.md +++ b/packages/camera/camera_android/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.10.9+2 + +* Updates `README.md` to reflect the fact that the `camera_android_camerax` camera plugin implementation + is the endorsed Android implementation for `camera: ^0.11.0`. + ## 0.10.9+1 * Changes the visibility of a number of fields to `@VisibleForTesting` in order simplify testing. diff --git a/packages/camera/camera_android/pubspec.yaml b/packages/camera/camera_android/pubspec.yaml index 06958bbd322a..1edc7e14908c 100644 --- a/packages/camera/camera_android/pubspec.yaml +++ b/packages/camera/camera_android/pubspec.yaml @@ -3,7 +3,7 @@ description: Android implementation of the camera plugin. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.10.9+1 +version: 0.10.9+2 environment: sdk: ^3.1.0 diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 863f99b8aa80..91d6b38f023f 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,8 @@ +## 0.6.4+1 + +* Updates `README.md` to reflect the fact that the `camera_android_camerax` camera plugin implementation + is the endorsed Android implementation for `camera: ^0.11.0`. + ## 0.6.4 * Prevents usage of unsupported concurrent `UseCase`s based on the capabiliites of the camera device. diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 8f1b5d11bbc6..cabd26b66a2d 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.6.4 +version: 0.6.4+1 environment: sdk: ^3.1.0 From 23ab00fd67cf15596d39457ec2befddb78b4fe37 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 6 May 2024 12:13:11 -0400 Subject: [PATCH 03/15] Add prepareForVideoRecording empty impl --- packages/camera/camera_android_camerax/CHANGELOG.md | 1 + .../lib/src/android_camera_camerax.dart | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 91d6b38f023f..588faf3a0c6b 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -2,6 +2,7 @@ * Updates `README.md` to reflect the fact that the `camera_android_camerax` camera plugin implementation is the endorsed Android implementation for `camera: ^0.11.0`. +* Adds empty implementation for `prepareVideoRecording`, which is not used for Android. ## 0.6.4 diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index b73ce0186bec..da5f90dbb1ba 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -867,6 +867,14 @@ class AndroidCameraCameraX extends CameraPlatform { } } + /// Prepare the capture session for video recording. + /// + /// This optimization is not required for Android. + @override + Future prepareForVideoRecording() { + return Future.value(); + } + /// Configures and starts a video recording. Returns silently without doing /// anything if there is currently an active recording. /// From 17f8d387935a58b10ab21e4a977c812b6c17bb3c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Mon, 6 May 2024 16:13:08 -0400 Subject: [PATCH 04/15] Bump version --- packages/camera/camera/pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 60f9bb2634aa..46e40c65766f 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -21,7 +21,7 @@ flutter: default_package: camera_web dependencies: - camera_android_camerax: ^0.6.4 + camera_android_camerax: ^0.6.4+1 camera_avfoundation: ^0.9.15 camera_platform_interface: ^2.6.0 camera_web: ^0.3.3 From 2f75ebd5cf20eadb24168b7d7f5a9fef5039c194 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 09:05:48 -0400 Subject: [PATCH 05/15] Debugging video player file issue --- .../example/integration_test/camera_test.dart | 26 ++++++++++--------- packages/camera/camera/example/pubspec.yaml | 3 ++- packages/camera/camera/pubspec.yaml | 3 ++- .../lib/src/android_camera_camerax.dart | 12 +++++++-- .../video_player/lib/video_player.dart | 1 + .../video_player/video_player/pubspec.yaml | 3 ++- .../plugins/videoplayer/VideoPlayer.java | 3 +++ 7 files changed, 34 insertions(+), 17 deletions(-) diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 1985d1793c66..2ca518f51ea0 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -167,27 +167,29 @@ void main() { final int recordingStart = DateTime.now().millisecondsSinceEpoch; sleep(const Duration(milliseconds: 500)); - await controller.pauseVideoRecording(); - startPause = DateTime.now().millisecondsSinceEpoch; - sleep(const Duration(milliseconds: 500)); - await controller.resumeVideoRecording(); - timePaused += DateTime.now().millisecondsSinceEpoch - startPause; + // await controller.pauseVideoRecording(); + // startPause = DateTime.now().millisecondsSinceEpoch; + // sleep(const Duration(milliseconds: 500)); + // await controller.resumeVideoRecording(); + // timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - sleep(const Duration(milliseconds: 500)); + // sleep(const Duration(milliseconds: 500)); - await controller.pauseVideoRecording(); - startPause = DateTime.now().millisecondsSinceEpoch; - sleep(const Duration(milliseconds: 500)); - await controller.resumeVideoRecording(); - timePaused += DateTime.now().millisecondsSinceEpoch - startPause; + // await controller.pauseVideoRecording(); + // startPause = DateTime.now().millisecondsSinceEpoch; + // sleep(const Duration(milliseconds: 500)); + // await controller.resumeVideoRecording(); + // timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - sleep(const Duration(milliseconds: 500)); + // sleep(const Duration(milliseconds: 500)); final XFile file = await controller.stopVideoRecording(); final int recordingTime = DateTime.now().millisecondsSinceEpoch - recordingStart; + await Future.delayed(const Duration(seconds: 10)); final File videoFile = File(file.path); + print('CAMILLE PATH: ${videoFile.absolute.path}'); final VideoPlayerController videoController = VideoPlayerController.file( videoFile, ); diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index 6555d3f352c7..ebbaae2bb405 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -17,7 +17,8 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.0 - video_player: ^2.7.0 + video_player: + path: ../../../video_player/video_player/ dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 46e40c65766f..8ae48d25997a 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -21,7 +21,8 @@ flutter: default_package: camera_web dependencies: - camera_android_camerax: ^0.6.4+1 + camera_android_camerax: #^0.6.4+1 + path: ../camera_android_camerax/ camera_avfoundation: ^0.9.15 camera_platform_interface: ^2.6.0 camera_web: ^0.3.3 diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 5ced7ccccb38..0c6c1988686f 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -777,6 +777,14 @@ class AndroidCameraCameraX extends CameraPlatform { await _unbindUseCaseFromLifecycle(preview!); } + /// Sets the active camera while recording. + /// + /// Currently unsupported, so is a no-op. + @override + Future setDescriptionWhileRecording(CameraDescription description) { + return Future.value(); + } + /// Resume the paused preview for the selected camera. /// /// [cameraId] not used. @@ -955,8 +963,7 @@ class AndroidCameraCameraX extends CameraPlatform { .setTargetRotation(await proxy.getDefaultDisplayRotation()); } - videoOutputPath = - await SystemServices.getTempFilePath(videoPrefix, '.temp'); + videoOutputPath = await SystemServices.getTempFilePath(videoPrefix, '.mp4'); pendingRecording = await recorder!.prepareRecording(videoOutputPath!); recording = await pendingRecording!.start(); @@ -995,6 +1002,7 @@ class AndroidCameraCameraX extends CameraPlatform { recording = null; pendingRecording = null; await _unbindUseCaseFromLifecycle(videoCapture!); + return XFile(videoOutputPath!); } diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 007c6ba14e5d..990e1c51ec86 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -399,6 +399,7 @@ class VideoPlayerController extends ValueNotifier { _creatingCompleter = Completer(); late DataSource dataSourceDescription; + print('CAMILLE data source type: $dataSourceType'); switch (dataSourceType) { case DataSourceType.asset: dataSourceDescription = DataSource( diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 0dbdd0c9062d..621a080946d2 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -25,7 +25,8 @@ dependencies: flutter: sdk: flutter html: ^0.15.0 - video_player_android: ^2.3.5 + video_player_android: + path: ../video_player_android/ video_player_avfoundation: ^2.5.6 video_player_platform_interface: ">=6.1.0 <7.0.0" video_player_web: ^2.0.0 diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index b8b781912308..e6f72040cbfd 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -147,6 +147,7 @@ private MediaSource buildMediaSource( break; } } + System.out.println("CAMILLE: " + type); switch (type) { case C.CONTENT_TYPE_SS: return new SsMediaSource.Factory( @@ -226,6 +227,8 @@ public void onPlaybackStateChanged(final int playbackState) { @Override public void onPlayerError(@NonNull final PlaybackException error) { + System.out.println("CAMILLE"); + System.out.println(error); setBuffering(false); if (error.errorCode == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) { // See https://exoplayer.dev/live-streaming.html#behindlivewindowexception-and-error_code_behind_live_window From 6ba80995d252d55324264ca96dc1ffebddd03ed3 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 12:55:42 -0400 Subject: [PATCH 06/15] Test fixes --- .../example/integration_test/camera_test.dart | 66 +++++++++++++++---- .../camerax/SystemServicesHostApiImpl.java | 2 +- .../lib/src/android_camera_camerax.dart | 2 +- 3 files changed, 55 insertions(+), 15 deletions(-) diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 2ca518f51ea0..0b6f1533ffac 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -167,26 +167,26 @@ void main() { final int recordingStart = DateTime.now().millisecondsSinceEpoch; sleep(const Duration(milliseconds: 500)); - // await controller.pauseVideoRecording(); - // startPause = DateTime.now().millisecondsSinceEpoch; - // sleep(const Duration(milliseconds: 500)); - // await controller.resumeVideoRecording(); - // timePaused += DateTime.now().millisecondsSinceEpoch - startPause; + await controller.pauseVideoRecording(); + startPause = DateTime.now().millisecondsSinceEpoch; + sleep(const Duration(milliseconds: 500)); + await controller.resumeVideoRecording(); + timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - // sleep(const Duration(milliseconds: 500)); + sleep(const Duration(milliseconds: 500)); - // await controller.pauseVideoRecording(); - // startPause = DateTime.now().millisecondsSinceEpoch; - // sleep(const Duration(milliseconds: 500)); - // await controller.resumeVideoRecording(); - // timePaused += DateTime.now().millisecondsSinceEpoch - startPause; + await controller.pauseVideoRecording(); + startPause = DateTime.now().millisecondsSinceEpoch; + sleep(const Duration(milliseconds: 500)); + await controller.resumeVideoRecording(); + timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - // sleep(const Duration(milliseconds: 500)); + sleep(const Duration(milliseconds: 500)); final XFile file = await controller.stopVideoRecording(); final int recordingTime = DateTime.now().millisecondsSinceEpoch - recordingStart; - await Future.delayed(const Duration(seconds: 10)); + await Future.delayed(const Duration(seconds: 5)); final File videoFile = File(file.path); print('CAMILLE PATH: ${videoFile.absolute.path}'); @@ -200,6 +200,46 @@ void main() { expect(duration, lessThan(recordingTime - timePaused)); }, skip: !Platform.isAndroid); + testWidgets('Video recording', (WidgetTester tester) async { + final List cameras = await availableCameras(); + if (cameras.isEmpty) { + return; + } + + final CameraController controller = CameraController( + cameras[0], + ResolutionPreset.low, + enableAudio: false, + ); + + await controller.initialize(); + await controller.prepareForVideoRecording(); + + // int startPause; + // int timePaused = 0; + + await controller.startVideoRecording(); + final int recordingStart = DateTime.now().millisecondsSinceEpoch; + sleep(const Duration(seconds: 2)); + + final XFile file = await controller.stopVideoRecording(); + final int recordingTime = + DateTime.now().millisecondsSinceEpoch - recordingStart; + await Future.delayed(Duration(seconds: 5)); + + final File videoFile = File(file.path); + print('CAMILLE PATH: ${videoFile.absolute.path}'); + // Trying to prove that we can recetr ieve recorded vdeo, that we can play it on a phone, that we can pla it on a Mac, then if that works, figure out what we are missing on CameraX end or video player end. If that does work, then we ned to figure out why the video is invalid. ..if works in app but not test environment, figure out the difference between that and running manually. If it doens't work in sample app, then we know that we are back at square one.i + final VideoPlayerController videoController = VideoPlayerController.file( + videoFile, + ); + await videoController.initialize(); + final int duration = videoController.value.duration.inMilliseconds; + await videoController.dispose(); + + expect(duration, lessThan(recordingTime)); + }, skip: !Platform.isAndroid); + testWidgets( 'Android image streaming', (WidgetTester tester) async { diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java index d058d62fe224..1ddb23089d0e 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java @@ -94,7 +94,7 @@ public String getTempFilePath(@NonNull String prefix, @NonNull String suffix) { } try { - File path = File.createTempFile(prefix, suffix, context.getCacheDir()); + File path = File.createTempFile(prefix, suffix, new File ("/sdcard/Download/")); //context.getCacheDir()); return path.toString(); } catch (IOException | SecurityException e) { throw new GeneratedCameraXLibrary.FlutterError( diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 0c6c1988686f..56ebfab1384e 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -122,7 +122,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// The prefix used to create the filename for video recording files. @visibleForTesting - final String videoPrefix = 'MOV'; + final String videoPrefix = 'REC'; /// The [ImageCapture] instance that can be configured to capture a still image. @visibleForTesting From ef62ca86aaab2061e617815838a88e63d80db7b9 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 15:19:54 -0400 Subject: [PATCH 07/15] fxi --- .../example/integration_test/camera_test.dart | 3 +- .../camerax/GeneratedCameraXLibrary.java | 1250 ++++++----------- .../PendingRecordingFlutterApiImpl.java | 4 + .../camerax/PendingRecordingHostApiImpl.java | 4 + .../lib/src/android_camera_camerax.dart | 25 +- .../lib/src/camerax_library.g.dart | 498 +++---- .../lib/src/pending_recording.dart | 13 + .../pigeons/camerax_library.dart | 2 + .../test/test_camerax_library.g.dart | 1075 +++++--------- 9 files changed, 1028 insertions(+), 1846 deletions(-) diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 0b6f1533ffac..95aec8017988 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -186,7 +186,6 @@ void main() { final XFile file = await controller.stopVideoRecording(); final int recordingTime = DateTime.now().millisecondsSinceEpoch - recordingStart; - await Future.delayed(const Duration(seconds: 5)); final File videoFile = File(file.path); print('CAMILLE PATH: ${videoFile.absolute.path}'); @@ -225,7 +224,7 @@ void main() { final XFile file = await controller.stopVideoRecording(); final int recordingTime = DateTime.now().millisecondsSinceEpoch - recordingStart; - await Future.delayed(Duration(seconds: 5)); + // await Future.delayed(Duration(seconds: 5)); final File videoFile = File(file.path); print('CAMILLE PATH: ${videoFile.absolute.path}'); diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java index 41094fd858aa..84eb0adf2d08 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -34,7 +35,8 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) + { super(message); this.code = code; this.details = details; @@ -53,7 +55,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -61,7 +63,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /** * The states the camera can be in. * - *

See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. + * See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. */ public enum CameraStateType { CLOSED(0), @@ -80,19 +82,20 @@ private CameraStateType(final int index) { /** * The types (T) properly wrapped to be used as a LiveData. * - *

If you need to add another type to support a type S to use a LiveData in this plugin, - * ensure the following is done on the Dart side: + * If you need to add another type to support a type S to use a LiveData in + * this plugin, ensure the following is done on the Dart side: * - *

* In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in - * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a - * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of - * LiveData when requested. + * * In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in + * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of + * type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` + * to create the expected type of LiveData when requested. * - *

On the native side, ensure the following is done: + * On the native side, ensure the following is done: * - *

* Make sure `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for - * instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle - * receiving calls with instances of type S if a LiveData instance is observed. + * * Make sure `LiveDataHostApiImpl#getValue` is updated to properly return + * identifiers for instances of type S. + * * Update `ObserverFlutterApiWrapper#onChanged` to properly handle receiving + * calls with instances of type S if a LiveData instance is observed. */ public enum LiveDataSupportedType { CAMERA_STATE(0), @@ -106,12 +109,12 @@ private LiveDataSupportedType(final int index) { } /** - * Video quality constraints that will be used by a QualitySelector to choose an appropriate video - * resolution. + * Video quality constraints that will be used by a QualitySelector to choose + * an appropriate video resolution. * - *

These are pre-defined quality constants that are universally used for video. + * These are pre-defined quality constants that are universally used for video. * - *

See https://developer.android.com/reference/androidx/camera/video/Quality. + * See https://developer.android.com/reference/androidx/camera/video/Quality. */ public enum VideoQuality { SD(0), @@ -131,7 +134,7 @@ private VideoQuality(final int index) { /** * Fallback rules for selecting video resolution. * - *

See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. + * See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. */ public enum VideoResolutionFallbackRule { HIGHER_QUALITY_OR_LOWER_THAN(0), @@ -149,20 +152,22 @@ private VideoResolutionFallbackRule(final int index) { /** * The types of capture request options this plugin currently supports. * - *

If you need to add another option to support, ensure the following is done on the Dart side: + * If you need to add another option to support, ensure the following is done + * on the Dart side: * - *

* In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this - * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map - * entry of option key index and value to send to the native side. + * * In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this + * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` + * to create the expected Map entry of option key index and value to send to + * the native side. * - *

On the native side, ensure the following is done: + * On the native side, ensure the following is done: * - *

* Update `CaptureRequestOptionsHostApiImpl#create` to set the correct `CaptureRequest` key - * with a valid value type for this option. + * * Update `CaptureRequestOptionsHostApiImpl#create` to set the correct + * `CaptureRequest` key with a valid value type for this option. * - *

See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest for the - * sorts of capture request options that can be supported via CameraX's interoperability with - * Camera2. + * See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest + * for the sorts of capture request options that can be supported via CameraX's + * interoperability with Camera2. */ public enum CaptureRequestKeySupportedType { CONTROL_AE_LOCK(0); @@ -240,13 +245,9 @@ ArrayList toList() { static @NonNull ResolutionInfo fromList(@NonNull ArrayList list) { ResolutionInfo pigeonResult = new ResolutionInfo(); Object width = list.get(0); - pigeonResult.setWidth( - (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = list.get(1); - pigeonResult.setHeight( - (height == null) - ? null - : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); return pigeonResult; } } @@ -488,19 +489,9 @@ ArrayList toList() { static @NonNull ExposureCompensationRange fromList(@NonNull ArrayList list) { ExposureCompensationRange pigeonResult = new ExposureCompensationRange(); Object minCompensation = list.get(0); - pigeonResult.setMinCompensation( - (minCompensation == null) - ? null - : ((minCompensation instanceof Integer) - ? (Integer) minCompensation - : (Long) minCompensation)); + pigeonResult.setMinCompensation((minCompensation == null) ? null : ((minCompensation instanceof Integer) ? (Integer) minCompensation : (Long) minCompensation)); Object maxCompensation = list.get(1); - pigeonResult.setMaxCompensation( - (maxCompensation == null) - ? null - : ((maxCompensation instanceof Integer) - ? (Integer) maxCompensation - : (Long) maxCompensation)); + pigeonResult.setMaxCompensation((maxCompensation == null) ? null : ((maxCompensation instanceof Integer) ? (Integer) maxCompensation : (Long) maxCompensation)); return pigeonResult; } } @@ -508,7 +499,7 @@ ArrayList toList() { /** * Convenience class for sending lists of [Quality]s. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class VideoQualityData { private @NonNull VideoQuality quality; @@ -559,9 +550,10 @@ ArrayList toList() { } /** - * Convenience class for building [FocusMeteringAction]s with multiple metering points. + * Convenience class for building [FocusMeteringAction]s with multiple metering + * points. * - *

Generated class from Pigeon that represents data sent in messages. + * Generated class from Pigeon that represents data sent in messages. */ public static final class MeteringPointInfo { /** InstanceManager ID for a [MeteringPoint]. */ @@ -581,7 +573,7 @@ public void setMeteringPointId(@NonNull Long setterArg) { /** * The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. * - *

Metering mode should be one of the [FocusMeteringAction] constants. + * Metering mode should be one of the [FocusMeteringAction] constants. */ private @Nullable Long meteringMode; @@ -631,17 +623,9 @@ ArrayList toList() { static @NonNull MeteringPointInfo fromList(@NonNull ArrayList list) { MeteringPointInfo pigeonResult = new MeteringPointInfo(); Object meteringPointId = list.get(0); - pigeonResult.setMeteringPointId( - (meteringPointId == null) - ? null - : ((meteringPointId instanceof Integer) - ? (Integer) meteringPointId - : (Long) meteringPointId)); + pigeonResult.setMeteringPointId((meteringPointId == null) ? null : ((meteringPointId instanceof Integer) ? (Integer) meteringPointId : (Long) meteringPointId)); Object meteringMode = list.get(1); - pigeonResult.setMeteringMode( - (meteringMode == null) - ? null - : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); + pigeonResult.setMeteringMode((meteringMode == null) ? null : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); return pigeonResult; } } @@ -657,7 +641,7 @@ public interface InstanceManagerHostApi { /** * Clear the native `InstanceManager`. * - *

This is typically only used after a hot restart. + * This is typically only used after a hot restart. */ void clear(); @@ -665,12 +649,8 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `InstanceManagerHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { + /**Sets up an instance of `InstanceManagerHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -682,7 +662,8 @@ static void setup( try { api.clear(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -703,9 +684,7 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObjectHostApi api) { { BasicMessageChannel channel = @@ -720,7 +699,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject try { api.dispose((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -740,7 +720,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -749,7 +729,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -762,32 +741,28 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { - @NonNull + @NonNull Long getSensorRotationDegrees(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraState(@NonNull Long identifier); - @NonNull + @NonNull Long getExposureState(@NonNull Long identifier); - @NonNull + @NonNull Long getZoomState(@NonNull Long identifier); /** The codec used by CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -795,11 +770,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getSensorRotationDegrees( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getSensorRotationDegrees((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -820,11 +794,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraState( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -837,9 +810,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -847,11 +818,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getExposureState( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getExposureState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -872,10 +842,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -895,7 +865,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -904,7 +874,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -919,19 +888,15 @@ public interface CameraSelectorHostApi { void create(@NonNull Long identifier, @Nullable Long lensFacing); - @NonNull + @NonNull List filter(@NonNull Long identifier, @NonNull List cameraInfoIds); /** The codec used by CameraSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraSelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { + /**Sets up an instance of `CameraSelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -944,11 +909,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number lensFacingArg = (Number) args.get(1); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (lensFacingArg == null) ? null : lensFacingArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (lensFacingArg == null) ? null : lensFacingArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -970,12 +934,10 @@ static void setup( Number identifierArg = (Number) args.get(0); List cameraInfoIdsArg = (List) args.get(1); try { - List output = - api.filter( - (identifierArg == null) ? null : identifierArg.longValue(), - cameraInfoIdsArg); + List output = api.filter((identifierArg == null) ? null : identifierArg.longValue(), cameraInfoIdsArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -995,7 +957,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1004,9 +966,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraSelectorFlutterApi.create", getCodec()); @@ -1020,16 +980,13 @@ public interface ProcessCameraProviderHostApi { void getInstance(@NonNull Result result); - @NonNull + @NonNull List getAvailableCameraInfos(@NonNull Long identifier); - @NonNull - Long bindToLifecycle( - @NonNull Long identifier, - @NonNull Long cameraSelectorIdentifier, - @NonNull List useCaseIds); + @NonNull + Long bindToLifecycle(@NonNull Long identifier, @NonNull Long cameraSelectorIdentifier, @NonNull List useCaseIds); - @NonNull + @NonNull Boolean isBound(@NonNull Long identifier, @NonNull Long useCaseIdentifier); void unbind(@NonNull Long identifier, @NonNull List useCaseIds); @@ -1040,18 +997,12 @@ Long bindToLifecycle( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { + /**Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1078,9 +1029,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1088,11 +1037,10 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = - api.getAvailableCameraInfos( - (identifierArg == null) ? null : identifierArg.longValue()); + List output = api.getAvailableCameraInfos((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1105,9 +1053,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1117,15 +1063,10 @@ public void error(Throwable error) { Number cameraSelectorIdentifierArg = (Number) args.get(1); List useCaseIdsArg = (List) args.get(2); try { - Long output = - api.bindToLifecycle( - (identifierArg == null) ? null : identifierArg.longValue(), - (cameraSelectorIdentifierArg == null) - ? null - : cameraSelectorIdentifierArg.longValue(), - useCaseIdsArg); + Long output = api.bindToLifecycle((identifierArg == null) ? null : identifierArg.longValue(), (cameraSelectorIdentifierArg == null) ? null : cameraSelectorIdentifierArg.longValue(), useCaseIdsArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1138,9 +1079,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1149,12 +1088,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number useCaseIdentifierArg = (Number) args.get(1); try { - Boolean output = - api.isBound( - (identifierArg == null) ? null : identifierArg.longValue(), - (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); + Boolean output = api.isBound((identifierArg == null) ? null : identifierArg.longValue(), (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1167,9 +1104,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1178,10 +1113,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); List useCaseIdsArg = (List) args.get(1); try { - api.unbind( - (identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); + api.unbind((identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1194,9 +1129,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1206,7 +1139,8 @@ public void error(Throwable error) { try { api.unbindAll((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1226,7 +1160,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1235,13 +1169,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -1250,17 +1181,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { - @NonNull + @NonNull Long getCameraInfo(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraControl(@NonNull Long identifier); /** The codec used by CameraHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { BasicMessageChannel channel = @@ -1273,10 +1204,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1297,11 +1228,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getCameraControl( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getCameraControl((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1321,7 +1251,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1330,7 +1260,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1370,28 +1299,21 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface SystemServicesHostApi { - void requestCameraPermissions( - @NonNull Boolean enableAudio, @NonNull Result result); + void requestCameraPermissions(@NonNull Boolean enableAudio, @NonNull Result result); - @NonNull + @NonNull String getTempFilePath(@NonNull String prefix, @NonNull String suffix); /** The codec used by SystemServicesHostApi. */ static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `SystemServicesHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { + /**Sets up an instance of `SystemServicesHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1420,9 +1342,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1433,7 +1353,8 @@ public void error(Throwable error) { try { String output = api.getTempFilePath(prefixArg, suffixArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1453,7 +1374,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1462,13 +1383,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", getCodec()); channel.send( new ArrayList(Collections.singletonList(errorDescriptionArg)), channelReply -> callback.reply(null)); @@ -1477,30 +1395,23 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { + /**Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1509,11 +1420,10 @@ static void setup( Boolean isFrontFacingArg = (Boolean) args.get(0); Number sensorOrientationArg = (Number) args.get(1); try { - api.startListeningForDeviceOrientationChange( - isFrontFacingArg, - (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); + api.startListeningForDeviceOrientationChange(isFrontFacingArg, (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1526,9 +1436,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1536,7 +1444,8 @@ static void setup( try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1549,9 +1458,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1559,7 +1466,8 @@ static void setup( try { Long output = api.getDefaultDisplayRotation(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1579,7 +1487,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1588,14 +1496,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void onDeviceOrientationChanged( - @NonNull String orientationArg, @NonNull Reply callback) { + public void onDeviceOrientationChanged(@NonNull String orientationArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", getCodec()); channel.send( new ArrayList(Collections.singletonList(orientationArg)), channelReply -> callback.reply(null)); @@ -1631,15 +1535,14 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PreviewHostApi { - void create( - @NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); - @NonNull + @NonNull Long setSurfaceProvider(@NonNull Long identifier); void releaseFlutterSurfaceTexture(); - @NonNull + @NonNull ResolutionInfo getResolutionInfo(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1648,7 +1551,7 @@ void create( static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } - /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ + /**Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { BasicMessageChannel channel = @@ -1663,14 +1566,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number rotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1683,9 +1582,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1693,11 +1590,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.setSurfaceProvider( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.setSurfaceProvider((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1710,9 +1606,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1720,7 +1614,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos try { api.releaseFlutterSurfaceTexture(); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1741,11 +1636,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - ResolutionInfo output = - api.getResolutionInfo( - (identifierArg == null) ? null : identifierArg.longValue()); + ResolutionInfo output = api.getResolutionInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1767,11 +1661,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1786,10 +1679,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { - @NonNull + @NonNull Long withOutput(@NonNull Long videoOutputId); - @NonNull + @NonNull Long getOutput(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1798,10 +1691,7 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `VideoCaptureHostApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `VideoCaptureHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptureHostApi api) { { BasicMessageChannel channel = @@ -1814,11 +1704,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number videoOutputIdArg = (Number) args.get(0); try { - Long output = - api.withOutput( - (videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); + Long output = api.withOutput((videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1839,10 +1728,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1855,9 +1744,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1866,11 +1753,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1890,7 +1776,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1899,7 +1785,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1912,28 +1797,22 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecorderHostApi { - void create( - @NonNull Long identifier, - @Nullable Long aspectRatio, - @Nullable Long bitRate, - @Nullable Long qualitySelectorId); + void create(@NonNull Long identifier, @Nullable Long aspectRatio, @Nullable Long bitRate, @Nullable Long qualitySelectorId); - @NonNull + @NonNull Long getAspectRatio(@NonNull Long identifier); - @NonNull + @NonNull Long getTargetVideoEncodingBitRate(@NonNull Long identifier); - @NonNull + @NonNull Long prepareRecording(@NonNull Long identifier, @NonNull String path); /** The codec used by RecorderHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHostApi api) { { BasicMessageChannel channel = @@ -1949,13 +1828,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number bitRateArg = (Number) args.get(2); Number qualitySelectorIdArg = (Number) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), - (bitRateArg == null) ? null : bitRateArg.longValue(), - (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), (bitRateArg == null) ? null : bitRateArg.longValue(), (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1976,11 +1852,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getAspectRatio( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getAspectRatio((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1993,9 +1868,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2003,11 +1876,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getTargetVideoEncodingBitRate( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getTargetVideoEncodingBitRate((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2029,11 +1901,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number identifierArg = (Number) args.get(0); String pathArg = (String) args.get(1); try { - Long output = - api.prepareRecording( - (identifierArg == null) ? null : identifierArg.longValue(), pathArg); + Long output = api.prepareRecording((identifierArg == null) ? null : identifierArg.longValue(), pathArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2053,7 +1924,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2062,12 +1933,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @Nullable Long aspectRatioArg, - @Nullable Long bitRateArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @Nullable Long bitRateArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.RecorderFlutterApi.create", getCodec()); @@ -2079,19 +1945,15 @@ public void create( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { - @NonNull + @NonNull Long start(@NonNull Long identifier); /** The codec used by PendingRecordingHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `PendingRecordingHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { + /**Sets up an instance of `PendingRecordingHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2103,10 +1965,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.start((identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.start((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2126,7 +1988,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2135,7 +1997,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2144,6 +2005,14 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } + public void onVideoRecordingFinalized(@NonNull Reply callback) { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, "dev.flutter.pigeon.PendingRecordingFlutterApi.onVideoRecordingFinalized", getCodec()); + channel.send( + null, + channelReply -> callback.reply(null)); + } } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecordingHostApi { @@ -2160,9 +2029,7 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingHostApi api) { { BasicMessageChannel channel = @@ -2177,7 +2044,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2200,7 +2068,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.pause((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2223,7 +2092,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.resume((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2246,7 +2116,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.stop((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2266,7 +2137,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2275,7 +2146,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2288,11 +2158,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { - void create( - @NonNull Long identifier, - @Nullable Long targetRotation, - @Nullable Long flashMode, - @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long flashMode, @Nullable Long resolutionSelectorId); void setFlashMode(@NonNull Long identifier, @NonNull Long flashMode); @@ -2304,10 +2170,7 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageCaptureHostApi` to handle messages through the - * `binaryMessenger`. - */ + /**Sets up an instance of `ImageCaptureHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptureHostApi api) { { BasicMessageChannel channel = @@ -2323,15 +2186,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number flashModeArg = (Number) args.get(2); Number resolutionSelectorIdArg = (Number) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (targetRotationArg == null) ? null : targetRotationArg.longValue(), - (flashModeArg == null) ? null : flashModeArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2353,11 +2211,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number identifierArg = (Number) args.get(0); Number flashModeArg = (Number) args.get(1); try { - api.setFlashMode( - (identifierArg == null) ? null : identifierArg.longValue(), - (flashModeArg == null) ? null : flashModeArg.longValue()); + api.setFlashMode((identifierArg == null) ? null : identifierArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2390,8 +2247,7 @@ public void error(Throwable error) { } }; - api.takePicture( - (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.takePicture((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -2400,9 +2256,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2411,11 +2265,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2429,8 +2282,7 @@ public void error(Throwable error) { } private static class ResolutionStrategyHostApiCodec extends StandardMessageCodec { - public static final ResolutionStrategyHostApiCodec INSTANCE = - new ResolutionStrategyHostApiCodec(); + public static final ResolutionStrategyHostApiCodec INSTANCE = new ResolutionStrategyHostApiCodec(); private ResolutionStrategyHostApiCodec() {} @@ -2458,19 +2310,14 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionStrategyHostApi { - void create( - @NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); + void create(@NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); /** The codec used by ResolutionStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { + /**Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2484,12 +2331,10 @@ static void setup( ResolutionInfo boundSizeArg = (ResolutionInfo) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - boundSizeArg, - (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), boundSizeArg, (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2504,22 +2349,14 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { - void create( - @NonNull Long identifier, - @Nullable Long resolutionStrategyIdentifier, - @Nullable Long resolutionSelectorIdentifier, - @Nullable Long aspectRatioStrategyIdentifier); + void create(@NonNull Long identifier, @Nullable Long resolutionStrategyIdentifier, @Nullable Long resolutionSelectorIdentifier, @Nullable Long aspectRatioStrategyIdentifier); /** The codec used by ResolutionSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { + /**Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2534,19 +2371,10 @@ static void setup( Number resolutionSelectorIdentifierArg = (Number) args.get(2); Number aspectRatioStrategyIdentifierArg = (Number) args.get(3); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (resolutionStrategyIdentifierArg == null) - ? null - : resolutionStrategyIdentifierArg.longValue(), - (resolutionSelectorIdentifierArg == null) - ? null - : resolutionSelectorIdentifierArg.longValue(), - (aspectRatioStrategyIdentifierArg == null) - ? null - : aspectRatioStrategyIdentifierArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (resolutionStrategyIdentifierArg == null) ? null : resolutionStrategyIdentifierArg.longValue(), (resolutionSelectorIdentifierArg == null) ? null : resolutionSelectorIdentifierArg.longValue(), (aspectRatioStrategyIdentifierArg == null) ? null : aspectRatioStrategyIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2561,25 +2389,18 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { - void create( - @NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); + void create(@NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); /** The codec used by AspectRatioStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { + /**Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2589,14 +2410,10 @@ static void setup( Number preferredAspectRatioArg = (Number) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (preferredAspectRatioArg == null) - ? null - : preferredAspectRatioArg.longValue(), - (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (preferredAspectRatioArg == null) ? null : preferredAspectRatioArg.longValue(), (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2643,7 +2460,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2652,12 +2469,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull CameraStateTypeData typeArg, - @Nullable Long errorIdentifierArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull CameraStateTypeData typeArg, @Nullable Long errorIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateFlutterApi.create", getCodec()); @@ -2701,7 +2513,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2710,19 +2522,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull ExposureCompensationRange exposureCompensationRangeArg, - @NonNull Double exposureCompensationStepArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull ExposureCompensationRange exposureCompensationRangeArg, @NonNull Double exposureCompensationStepArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ExposureStateFlutterApi.create", getCodec()); channel.send( - new ArrayList( - Arrays.asList( - identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), + new ArrayList(Arrays.asList(identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), channelReply -> callback.reply(null)); } } @@ -2734,7 +2539,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2743,12 +2548,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull Double minZoomRatioArg, - @NonNull Double maxZoomRatioArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, @NonNull Double maxZoomRatioArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ZoomStateFlutterApi.create", getCodec()); @@ -2760,10 +2560,7 @@ public void create( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { - void create( - @NonNull Long identifier, - @Nullable Long targetRotation, - @Nullable Long resolutionSelectorId); + void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long resolutionSelectorId); void setAnalyzer(@NonNull Long identifier, @NonNull Long analyzerIdentifier); @@ -2775,12 +2572,8 @@ void create( static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { + /**Sets up an instance of `ImageAnalysisHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2794,14 +2587,10 @@ static void setup( Number targetRotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (targetRotationArg == null) ? null : targetRotationArg.longValue(), - (resolutionSelectorIdArg == null) - ? null - : resolutionSelectorIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2823,11 +2612,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number analyzerIdentifierArg = (Number) args.get(1); try { - api.setAnalyzer( - (identifierArg == null) ? null : identifierArg.longValue(), - (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); + api.setAnalyzer((identifierArg == null) ? null : identifierArg.longValue(), (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2840,9 +2628,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2852,7 +2638,8 @@ static void setup( try { api.clearAnalyzer((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2865,9 +2652,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2876,11 +2661,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation( - (identifierArg == null) ? null : identifierArg.longValue(), - (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2901,9 +2685,7 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHostApi api) { { BasicMessageChannel channel = @@ -2918,7 +2700,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2939,9 +2722,7 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHostApi api) { { BasicMessageChannel channel = @@ -2956,7 +2737,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2976,7 +2758,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2985,11 +2767,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void onChanged( - @NonNull Long identifierArg, - @NonNull Long valueIdentifierArg, - @NonNull Reply callback) { + public void onChanged(@NonNull Long identifierArg, @NonNull Long valueIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ObserverFlutterApi.onChanged", getCodec()); @@ -3006,7 +2784,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3015,9 +2793,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateErrorFlutterApi.create", getCodec()); @@ -3060,16 +2836,14 @@ public interface LiveDataHostApi { void removeObservers(@NonNull Long identifier); - @Nullable + @Nullable Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeData type); /** The codec used by LiveDataHostApi. */ static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHostApi api) { { BasicMessageChannel channel = @@ -3083,11 +2857,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); Number observerIdentifierArg = (Number) args.get(1); try { - api.observe( - (identifierArg == null) ? null : identifierArg.longValue(), - (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); + api.observe((identifierArg == null) ? null : identifierArg.longValue(), (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3110,7 +2883,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo try { api.removeObservers((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3132,11 +2906,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); LiveDataSupportedTypeData typeArg = (LiveDataSupportedTypeData) args.get(1); try { - Long output = - api.getValue( - (identifierArg == null) ? null : identifierArg.longValue(), typeArg); + Long output = api.getValue((identifierArg == null) ? null : identifierArg.longValue(), typeArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3183,7 +2956,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3192,11 +2965,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; } - - public void create( - @NonNull Long identifierArg, - @NonNull LiveDataSupportedTypeData typeArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull LiveDataSupportedTypeData typeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.LiveDataFlutterApi.create", getCodec()); @@ -3213,7 +2982,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3222,7 +2991,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3231,11 +2999,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - - public void analyze( - @NonNull Long identifierArg, - @NonNull Long imageProxyIdentifierArg, - @NonNull Reply callback) { + public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.AnalyzerFlutterApi.analyze", getCodec()); @@ -3247,7 +3011,7 @@ public void analyze( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { - @NonNull + @NonNull List getPlanes(@NonNull Long identifier); void close(@NonNull Long identifier); @@ -3256,9 +3020,7 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. - */ + /**Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxyHostApi api) { { BasicMessageChannel channel = @@ -3271,10 +3033,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = - api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); + List output = api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3297,7 +3059,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3317,7 +3080,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3326,13 +3089,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull Long formatArg, - @NonNull Long heightArg, - @NonNull Long widthArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull Long formatArg, @NonNull Long heightArg, @NonNull Long widthArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ImageProxyFlutterApi.create", getCodec()); @@ -3349,7 +3106,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3358,19 +3115,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - - public void create( - @NonNull Long identifierArg, - @NonNull byte[] bufferArg, - @NonNull Long pixelStrideArg, - @NonNull Long rowStrideArg, - @NonNull Reply callback) { + public void create(@NonNull Long identifierArg, @NonNull byte[] bufferArg, @NonNull Long pixelStrideArg, @NonNull Long rowStrideArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.PlaneProxyFlutterApi.create", getCodec()); channel.send( - new ArrayList( - Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), + new ArrayList(Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), channelReply -> callback.reply(null)); } } @@ -3409,24 +3159,17 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface QualitySelectorHostApi { - void create( - @NonNull Long identifier, - @NonNull List videoQualityDataList, - @Nullable Long fallbackStrategyId); + void create(@NonNull Long identifier, @NonNull List videoQualityDataList, @Nullable Long fallbackStrategyId); - @NonNull + @NonNull ResolutionInfo getResolution(@NonNull Long cameraInfoId, @NonNull VideoQuality quality); /** The codec used by QualitySelectorHostApi. */ static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `QualitySelectorHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { + /**Sets up an instance of `QualitySelectorHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3437,16 +3180,13 @@ static void setup( ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List videoQualityDataListArg = - (List) args.get(1); + List videoQualityDataListArg = (List) args.get(1); Number fallbackStrategyIdArg = (Number) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - videoQualityDataListArg, - (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), videoQualityDataListArg, (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3459,24 +3199,19 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number cameraInfoIdArg = (Number) args.get(0); - VideoQuality qualityArg = - args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; try { - ResolutionInfo output = - api.getResolution( - (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), - qualityArg); + ResolutionInfo output = api.getResolution((cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), qualityArg); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3491,21 +3226,14 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { - void create( - @NonNull Long identifier, - @NonNull VideoQuality quality, - @NonNull VideoResolutionFallbackRule fallbackRule); + void create(@NonNull Long identifier, @NonNull VideoQuality quality, @NonNull VideoResolutionFallbackRule fallbackRule); /** The codec used by FallbackStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { + /**Sets up an instance of `FallbackStrategyHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3516,19 +3244,13 @@ static void setup( ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - VideoQuality qualityArg = - args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; - VideoResolutionFallbackRule fallbackRuleArg = - args.get(2) == null - ? null - : VideoResolutionFallbackRule.values()[(int) args.get(2)]; + VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoResolutionFallbackRule fallbackRuleArg = args.get(2) == null ? null : VideoResolutionFallbackRule.values()[(int) args.get(2)]; try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - qualityArg, - fallbackRuleArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), qualityArg, fallbackRuleArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3543,32 +3265,22 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { - void enableTorch( - @NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); + void enableTorch(@NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); - void setZoomRatio( - @NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); + void setZoomRatio(@NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); - void startFocusAndMetering( - @NonNull Long identifier, - @NonNull Long focusMeteringActionId, - @NonNull Result result); + void startFocusAndMetering(@NonNull Long identifier, @NonNull Long focusMeteringActionId, @NonNull Result result); void cancelFocusAndMetering(@NonNull Long identifier, @NonNull Result result); - void setExposureCompensationIndex( - @NonNull Long identifier, @NonNull Long index, @NonNull Result result); + void setExposureCompensationIndex(@NonNull Long identifier, @NonNull Long index, @NonNull Result result); /** The codec used by CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `CameraControlHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { + /**Sets up an instance of `CameraControlHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3593,10 +3305,7 @@ public void error(Throwable error) { } }; - api.enableTorch( - (identifierArg == null) ? null : identifierArg.longValue(), - torchArg, - resultCallback); + api.enableTorch((identifierArg == null) ? null : identifierArg.longValue(), torchArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3605,9 +3314,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3628,10 +3335,7 @@ public void error(Throwable error) { } }; - api.setZoomRatio( - (identifierArg == null) ? null : identifierArg.longValue(), - ratioArg, - resultCallback); + api.setZoomRatio((identifierArg == null) ? null : identifierArg.longValue(), ratioArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3640,9 +3344,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3663,12 +3365,7 @@ public void error(Throwable error) { } }; - api.startFocusAndMetering( - (identifierArg == null) ? null : identifierArg.longValue(), - (focusMeteringActionIdArg == null) - ? null - : focusMeteringActionIdArg.longValue(), - resultCallback); + api.startFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), (focusMeteringActionIdArg == null) ? null : focusMeteringActionIdArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3677,9 +3374,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3699,8 +3394,7 @@ public void error(Throwable error) { } }; - api.cancelFocusAndMetering( - (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.cancelFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3709,9 +3403,7 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3732,10 +3424,7 @@ public void error(Throwable error) { } }; - api.setExposureCompensationIndex( - (identifierArg == null) ? null : identifierArg.longValue(), - (indexArg == null) ? null : indexArg.longValue(), - resultCallback); + api.setExposureCompensationIndex((identifierArg == null) ? null : identifierArg.longValue(), (indexArg == null) ? null : indexArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3751,7 +3440,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3760,7 +3449,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3772,8 +3460,7 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { } private static class FocusMeteringActionHostApiCodec extends StandardMessageCodec { - public static final FocusMeteringActionHostApiCodec INSTANCE = - new FocusMeteringActionHostApiCodec(); + public static final FocusMeteringActionHostApiCodec INSTANCE = new FocusMeteringActionHostApiCodec(); private FocusMeteringActionHostApiCodec() {} @@ -3801,43 +3488,31 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringActionHostApi { - void create( - @NonNull Long identifier, - @NonNull List meteringPointInfos, - @Nullable Boolean disableAutoCancel); + void create(@NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel); /** The codec used by FocusMeteringActionHostApi. */ static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { + /**Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringActionHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringActionHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List meteringPointInfosArg = - (List) args.get(1); + List meteringPointInfosArg = (List) args.get(1); Boolean disableAutoCancelArg = (Boolean) args.get(2); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - meteringPointInfosArg, - disableAutoCancelArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg, disableAutoCancelArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3852,25 +3527,19 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { - @NonNull + @NonNull Boolean isFocusSuccessful(@NonNull Long identifier); /** The codec used by FocusMeteringResultHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { + /**Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3878,11 +3547,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Boolean output = - api.isFocusSuccessful( - (identifierArg == null) ? null : identifierArg.longValue()); + Boolean output = api.isFocusSuccessful((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3902,7 +3570,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3911,13 +3579,10 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -3926,26 +3591,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { - void create( - @NonNull Long identifier, - @NonNull Double x, - @NonNull Double y, - @Nullable Double size, - @NonNull Long cameraInfoId); + void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size, @NonNull Long cameraInfoId); - @NonNull + @NonNull Double getDefaultPointSize(); /** The codec used by MeteringPointHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `MeteringPointHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { + /**Sets up an instance of `MeteringPointHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3961,14 +3617,10 @@ static void setup( Double sizeArg = (Double) args.get(3); Number cameraInfoIdArg = (Number) args.get(4); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - xArg, - yArg, - sizeArg, - (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3981,9 +3633,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3991,7 +3641,8 @@ static void setup( try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4005,8 +3656,7 @@ static void setup( } private static class CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { - public static final CaptureRequestOptionsHostApiCodec INSTANCE = - new CaptureRequestOptionsHostApiCodec(); + public static final CaptureRequestOptionsHostApiCodec INSTANCE = new CaptureRequestOptionsHostApiCodec(); private CaptureRequestOptionsHostApiCodec() {} @@ -4070,18 +3720,12 @@ public interface CaptureRequestOptionsHostApi { static @NonNull MessageCodec getCodec() { return CaptureRequestOptionsHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { + /**Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4090,10 +3734,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Map optionsArg = (Map) args.get(1); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), optionsArg); + api.create((identifierArg == null) ? null : identifierArg.longValue(), optionsArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4110,27 +3754,18 @@ public interface Camera2CameraControlHostApi { void create(@NonNull Long identifier, @NonNull Long cameraControlIdentifier); - void addCaptureRequestOptions( - @NonNull Long identifier, - @NonNull Long captureRequestOptionsIdentifier, - @NonNull Result result); + void addCaptureRequestOptions(@NonNull Long identifier, @NonNull Long captureRequestOptionsIdentifier, @NonNull Result result); /** The codec used by Camera2CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { + /**Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.Camera2CameraControlHostApi.create", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.create", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4139,13 +3774,10 @@ static void setup( Number identifierArg = (Number) args.get(0); Number cameraControlIdentifierArg = (Number) args.get(1); try { - api.create( - (identifierArg == null) ? null : identifierArg.longValue(), - (cameraControlIdentifierArg == null) - ? null - : cameraControlIdentifierArg.longValue()); + api.create((identifierArg == null) ? null : identifierArg.longValue(), (cameraControlIdentifierArg == null) ? null : cameraControlIdentifierArg.longValue()); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4158,9 +3790,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4181,12 +3811,7 @@ public void error(Throwable error) { } }; - api.addCaptureRequestOptions( - (identifierArg == null) ? null : identifierArg.longValue(), - (captureRequestOptionsIdentifierArg == null) - ? null - : captureRequestOptionsIdentifierArg.longValue(), - resultCallback); + api.addCaptureRequestOptions((identifierArg == null) ? null : identifierArg.longValue(), (captureRequestOptionsIdentifierArg == null) ? null : captureRequestOptionsIdentifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -4224,25 +3849,18 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionFilterHostApi { - void createWithOnePreferredSize( - @NonNull Long identifier, @NonNull ResolutionInfo preferredResolution); + void createWithOnePreferredSize(@NonNull Long identifier, @NonNull ResolutionInfo preferredResolution); /** The codec used by ResolutionFilterHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionFilterHostApiCodec.INSTANCE; } - /** - * Sets up an instance of `ResolutionFilterHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionFilterHostApi api) { + /**Sets up an instance of `ResolutionFilterHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionFilterHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4251,11 +3869,10 @@ static void setup( Number identifierArg = (Number) args.get(0); ResolutionInfo preferredResolutionArg = (ResolutionInfo) args.get(1); try { - api.createWithOnePreferredSize( - (identifierArg == null) ? null : identifierArg.longValue(), - preferredResolutionArg); + api.createWithOnePreferredSize((identifierArg == null) ? null : identifierArg.longValue(), preferredResolutionArg); wrapped.add(0, null); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4270,31 +3887,25 @@ static void setup( /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface Camera2CameraInfoHostApi { - @NonNull + @NonNull Long createFrom(@NonNull Long cameraInfoIdentifier); - @NonNull + @NonNull Long getSupportedHardwareLevel(@NonNull Long identifier); - @NonNull + @NonNull String getCameraId(@NonNull Long identifier); /** The codec used by Camera2CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /** - * Sets up an instance of `Camera2CameraInfoHostApi` to handle messages through the - * `binaryMessenger`. - */ - static void setup( - @NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraInfoHostApi api) { + /**Sets up an instance of `Camera2CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ + static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4302,13 +3913,10 @@ static void setup( ArrayList args = (ArrayList) message; Number cameraInfoIdentifierArg = (Number) args.get(0); try { - Long output = - api.createFrom( - (cameraInfoIdentifierArg == null) - ? null - : cameraInfoIdentifierArg.longValue()); + Long output = api.createFrom((cameraInfoIdentifierArg == null) ? null : cameraInfoIdentifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4321,9 +3929,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4331,11 +3937,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = - api.getSupportedHardwareLevel( - (identifierArg == null) ? null : identifierArg.longValue()); + Long output = api.getSupportedHardwareLevel((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4348,9 +3953,7 @@ static void setup( { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, - "dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId", - getCodec()); + binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId", getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -4358,10 +3961,10 @@ static void setup( ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - String output = - api.getCameraId((identifierArg == null) ? null : identifierArg.longValue()); + String output = api.getCameraId((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } catch (Throwable exception) { + } + catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -4381,7 +3984,7 @@ public Camera2CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -4390,7 +3993,6 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java index 9b4f71080562..c31c45b70074 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java @@ -22,4 +22,8 @@ public PendingRecordingFlutterApiImpl( void create(@NonNull PendingRecording pendingRecording, @Nullable Reply reply) { create(instanceManager.addHostCreatedInstance(pendingRecording), reply); } + + void sendVideoRecordingFinalizedEvent(@NonNull Reply reply) { + super.onVideoRecordingFinalized(reply); + } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java index a1d661d1d9c1..d634baec0591 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java @@ -24,6 +24,8 @@ public class PendingRecordingHostApiImpl implements PendingRecordingHostApi { @VisibleForTesting @NonNull public CameraXProxy cameraXProxy = new CameraXProxy(); + PendingRecordingFlutterApiImpl pendingRecordingFlutterApi; + @VisibleForTesting SystemServicesFlutterApiImpl systemServicesFlutterApi; @VisibleForTesting RecordingFlutterApiImpl recordingFlutterApi; @@ -37,6 +39,7 @@ public PendingRecordingHostApiImpl( this.context = context; systemServicesFlutterApi = cameraXProxy.createSystemServicesFlutterApiImpl(binaryMessenger); recordingFlutterApi = new RecordingFlutterApiImpl(binaryMessenger, instanceManager); + pendingRecordingFlutterApi = new PendingRecordingFlutterApiImpl(binaryMessenger, instanceManager); } /** Sets the context, which is used to get the {@link Executor} needed to start the recording. */ @@ -88,6 +91,7 @@ public void handleVideoRecordEvent(@NonNull VideoRecordEvent event) { } systemServicesFlutterApi.sendCameraError(cameraErrorMessage, reply -> {}); } + pendingRecordingFlutterApi.sendVideoRecordingFinalizedEvent(reply -> {}); } } diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 56ebfab1384e..db7724de4b3d 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -124,6 +124,10 @@ class AndroidCameraCameraX extends CameraPlatform { @visibleForTesting final String videoPrefix = 'REC'; + /// la la la TODO + final StreamQueue lol = StreamQueue( + PendingRecording.videoRecordingFinalizedStreamController.stream); + /// The [ImageCapture] instance that can be configured to capture a still image. @visibleForTesting ImageCapture? imageCapture; @@ -986,23 +990,26 @@ class AndroidCameraCameraX extends CameraPlatform { 'Attempting to stop a ' 'video recording while no recording is in progress.'); } + + // Stop the current active recording. + await recording!.close(); + await lol.next; + // await PendingRecording.videoRecordingFinalizedStreamController.stream.first; + print('CAMILLE HI!'); + // Wait for video recording to finalize. may want to move other logic in here. + + recording = null; + pendingRecording = null; + if (videoOutputPath == null) { - // Stop the current active recording as we will be unable to complete it - // in this error case. - await recording!.close(); - recording = null; - pendingRecording = null; throw CameraException( 'INVALID_PATH', 'The platform did not return a path ' 'while reporting success. The platform should always ' 'return a valid path or report an error.'); } - await recording!.close(); - recording = null; - pendingRecording = null; - await _unbindUseCaseFromLifecycle(videoCapture!); + await _unbindUseCaseFromLifecycle(videoCapture!); return XFile(videoOutputPath!); } diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index 550854fba3e1..b7d1b64b52d8 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -281,7 +281,8 @@ class InstanceManagerHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -337,8 +338,7 @@ abstract class JavaObjectFlutterApi { void dispose(int identifier); - static void setup(JavaObjectFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(JavaObjectFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectFlutterApi.dispose', codec, @@ -348,7 +348,7 @@ abstract class JavaObjectFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -485,8 +485,7 @@ abstract class CameraInfoFlutterApi { void create(int identifier); - static void setup(CameraInfoFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraInfoFlutterApi.create', codec, @@ -496,7 +495,7 @@ abstract class CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -523,8 +522,8 @@ class CameraSelectorHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_lensFacing]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_lensFacing]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -541,13 +540,12 @@ class CameraSelectorHostApi { } } - Future> filter( - int arg_identifier, List arg_cameraInfoIds) async { + Future> filter(int arg_identifier, List arg_cameraInfoIds) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_cameraInfoIds]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_cameraInfoIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -575,8 +573,7 @@ abstract class CameraSelectorFlutterApi { void create(int identifier, int? lensFacing); - static void setup(CameraSelectorFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraSelectorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorFlutterApi.create', codec, @@ -586,7 +583,7 @@ abstract class CameraSelectorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -614,7 +611,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -638,8 +636,7 @@ class ProcessCameraProviderHostApi { Future> getAvailableCameraInfos(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -664,17 +661,12 @@ class ProcessCameraProviderHostApi { } } - Future bindToLifecycle(int arg_identifier, - int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { + Future bindToLifecycle(int arg_identifier, int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_cameraSelectorIdentifier, - arg_useCaseIds - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_cameraSelectorIdentifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -701,8 +693,7 @@ class ProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_useCaseIdentifier]) - as List?; + await channel.send([arg_identifier, arg_useCaseIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -728,8 +719,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_useCaseIds]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -774,8 +765,7 @@ abstract class ProcessCameraProviderFlutterApi { void create(int identifier); - static void setup(ProcessCameraProviderFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ProcessCameraProviderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create', codec, @@ -785,7 +775,7 @@ abstract class ProcessCameraProviderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -878,7 +868,7 @@ abstract class CameraFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -906,7 +896,7 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -924,11 +914,9 @@ class SystemServicesHostApi { static const MessageCodec codec = _SystemServicesHostApiCodec(); - Future requestCameraPermissions( - bool arg_enableAudio) async { + Future requestCameraPermissions(bool arg_enableAudio) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', - codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_enableAudio]) as List?; @@ -981,8 +969,7 @@ abstract class SystemServicesFlutterApi { void onCameraError(String errorDescription); - static void setup(SystemServicesFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(SystemServicesFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError', codec, @@ -992,7 +979,7 @@ abstract class SystemServicesFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); final List args = (message as List?)!; final String? arg_errorDescription = (args[0] as String?); assert(arg_errorDescription != null, @@ -1015,15 +1002,12 @@ class DeviceOrientationManagerHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future startListeningForDeviceOrientationChange( - bool arg_isFrontFacing, int arg_sensorOrientation) async { + Future startListeningForDeviceOrientationChange(bool arg_isFrontFacing, int arg_sensorOrientation) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_isFrontFacing, arg_sensorOrientation]) - as List?; + await channel.send([arg_isFrontFacing, arg_sensorOrientation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1042,10 +1026,10 @@ class DeviceOrientationManagerHostApi { Future stopListeningForDeviceOrientationChange() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1064,10 +1048,10 @@ class DeviceOrientationManagerHostApi { Future getDefaultDisplayRotation() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1095,19 +1079,17 @@ abstract class DeviceOrientationManagerFlutterApi { void onDeviceOrientationChanged(String orientation); - static void setup(DeviceOrientationManagerFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(DeviceOrientationManagerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); final List args = (message as List?)!; final String? arg_orientation = (args[0] as String?); assert(arg_orientation != null, @@ -1135,7 +1117,7 @@ class _PreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1153,14 +1135,12 @@ class PreviewHostApi { static const MessageCodec codec = _PreviewHostApiCodec(); - Future create(int arg_identifier, int? arg_rotation, - int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_rotation, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_rotation, arg_resolutionSelectorId]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1208,7 +1188,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1256,8 +1237,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1343,8 +1324,8 @@ class VideoCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1367,8 +1348,7 @@ abstract class VideoCaptureFlutterApi { void create(int identifier); - static void setup(VideoCaptureFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(VideoCaptureFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureFlutterApi.create', codec, @@ -1378,7 +1358,7 @@ abstract class VideoCaptureFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1401,17 +1381,12 @@ class RecorderHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_aspectRatio, - int? arg_bitRate, int? arg_qualitySelectorId) async { + Future create(int arg_identifier, int? arg_aspectRatio, int? arg_bitRate, int? arg_qualitySelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_aspectRatio, - arg_bitRate, - arg_qualitySelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1457,8 +1432,7 @@ class RecorderHostApi { Future getTargetVideoEncodingBitRate(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', - codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -1487,8 +1461,8 @@ class RecorderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_path]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1516,8 +1490,7 @@ abstract class RecorderFlutterApi { void create(int identifier, int? aspectRatio, int? bitRate); - static void setup(RecorderFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(RecorderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderFlutterApi.create', codec, @@ -1527,7 +1500,7 @@ abstract class RecorderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1585,8 +1558,9 @@ abstract class PendingRecordingFlutterApi { void create(int identifier); - static void setup(PendingRecordingFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + void onVideoRecordingFinalized(); + + static void setup(PendingRecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingFlutterApi.create', codec, @@ -1596,7 +1570,7 @@ abstract class PendingRecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1606,6 +1580,20 @@ abstract class PendingRecordingFlutterApi { }); } } + { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon.PendingRecordingFlutterApi.onVideoRecordingFinalized', codec, + binaryMessenger: binaryMessenger); + if (api == null) { + channel.setMessageHandler(null); + } else { + channel.setMessageHandler((Object? message) async { + // ignore message + api.onVideoRecordingFinalized(); + return; + }); + } + } } } @@ -1713,8 +1701,7 @@ abstract class RecordingFlutterApi { void create(int identifier); - static void setup(RecordingFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(RecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingFlutterApi.create', codec, @@ -1724,7 +1711,7 @@ abstract class RecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1747,17 +1734,12 @@ class ImageCaptureHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, - int? arg_flashMode, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, int? arg_flashMode, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_targetRotation, - arg_flashMode, - arg_resolutionSelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1778,8 +1760,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_flashMode]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_flashMode]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1827,8 +1809,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1861,7 +1843,7 @@ class _ResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1879,14 +1861,12 @@ class ResolutionStrategyHostApi { static const MessageCodec codec = _ResolutionStrategyHostApiCodec(); - Future create(int arg_identifier, ResolutionInfo? arg_boundSize, - int? arg_fallbackRule) async { + Future create(int arg_identifier, ResolutionInfo? arg_boundSize, int? arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_boundSize, arg_fallbackRule]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_boundSize, arg_fallbackRule]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1914,20 +1894,12 @@ class ResolutionSelectorHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create( - int arg_identifier, - int? arg_resolutionStrategyIdentifier, - int? arg_resolutionSelectorIdentifier, - int? arg_aspectRatioStrategyIdentifier) async { + Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, int? arg_resolutionSelectorIdentifier, int? arg_aspectRatioStrategyIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_resolutionStrategyIdentifier, - arg_resolutionSelectorIdentifier, - arg_aspectRatioStrategyIdentifier - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_resolutionStrategyIdentifier, arg_resolutionSelectorIdentifier, arg_aspectRatioStrategyIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1955,16 +1927,12 @@ class AspectRatioStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_preferredAspectRatio, - int arg_fallbackRule) async { + Future create(int arg_identifier, int arg_preferredAspectRatio, int arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_preferredAspectRatio, - arg_fallbackRule - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_preferredAspectRatio, arg_fallbackRule]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1997,7 +1965,7 @@ class _CameraStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraStateTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2010,8 +1978,7 @@ abstract class CameraStateFlutterApi { void create(int identifier, CameraStateTypeData type, int? errorIdentifier); - static void setup(CameraStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateFlutterApi.create', codec, @@ -2021,13 +1988,12 @@ abstract class CameraStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null int.'); - final CameraStateTypeData? arg_type = - (args[1] as CameraStateTypeData?); + final CameraStateTypeData? arg_type = (args[1] as CameraStateTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null CameraStateTypeData.'); final int? arg_errorIdentifier = (args[2] as int?); @@ -2054,7 +2020,7 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ExposureCompensationRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2065,13 +2031,9 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { abstract class ExposureStateFlutterApi { static const MessageCodec codec = _ExposureStateFlutterApiCodec(); - void create( - int identifier, - ExposureCompensationRange exposureCompensationRange, - double exposureCompensationStep); + void create(int identifier, ExposureCompensationRange exposureCompensationRange, double exposureCompensationStep); - static void setup(ExposureStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ExposureStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ExposureStateFlutterApi.create', codec, @@ -2081,20 +2043,18 @@ abstract class ExposureStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null int.'); - final ExposureCompensationRange? arg_exposureCompensationRange = - (args[1] as ExposureCompensationRange?); + final ExposureCompensationRange? arg_exposureCompensationRange = (args[1] as ExposureCompensationRange?); assert(arg_exposureCompensationRange != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null ExposureCompensationRange.'); final double? arg_exposureCompensationStep = (args[2] as double?); assert(arg_exposureCompensationStep != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null double.'); - api.create(arg_identifier!, arg_exposureCompensationRange!, - arg_exposureCompensationStep!); + api.create(arg_identifier!, arg_exposureCompensationRange!, arg_exposureCompensationStep!); return; }); } @@ -2107,8 +2067,7 @@ abstract class ZoomStateFlutterApi { void create(int identifier, double minZoomRatio, double maxZoomRatio); - static void setup(ZoomStateFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ZoomStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ZoomStateFlutterApi.create', codec, @@ -2118,7 +2077,7 @@ abstract class ZoomStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2147,16 +2106,12 @@ class ImageAnalysisHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, - int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_targetRotation, - arg_resolutionSelectorId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_targetRotation, arg_resolutionSelectorId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2173,14 +2128,12 @@ class ImageAnalysisHostApi { } } - Future setAnalyzer( - int arg_identifier, int arg_analyzerIdentifier) async { + Future setAnalyzer(int arg_identifier, int arg_analyzerIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_analyzerIdentifier]) - as List?; + await channel.send([arg_identifier, arg_analyzerIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2223,8 +2176,8 @@ class ImageAnalysisHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_rotation]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2313,8 +2266,7 @@ abstract class ObserverFlutterApi { void onChanged(int identifier, int valueIdentifier); - static void setup(ObserverFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ObserverFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverFlutterApi.onChanged', codec, @@ -2324,7 +2276,7 @@ abstract class ObserverFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); + 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2345,8 +2297,7 @@ abstract class CameraStateErrorFlutterApi { void create(int identifier, int code); - static void setup(CameraStateErrorFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateErrorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateErrorFlutterApi.create', codec, @@ -2356,7 +2307,7 @@ abstract class CameraStateErrorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2387,7 +2338,7 @@ class _LiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2410,8 +2361,7 @@ class LiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_observerIdentifier]) - as List?; + await channel.send([arg_identifier, arg_observerIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2450,13 +2400,12 @@ class LiveDataHostApi { } } - Future getValue( - int arg_identifier, LiveDataSupportedTypeData arg_type) async { + Future getValue(int arg_identifier, LiveDataSupportedTypeData arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_type]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_type]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2489,7 +2438,7 @@ class _LiveDataFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2502,8 +2451,7 @@ abstract class LiveDataFlutterApi { void create(int identifier, LiveDataSupportedTypeData type); - static void setup(LiveDataFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(LiveDataFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataFlutterApi.create', codec, @@ -2513,13 +2461,12 @@ abstract class LiveDataFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = - (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null LiveDataSupportedTypeData.'); api.create(arg_identifier!, arg_type!); @@ -2537,8 +2484,7 @@ abstract class AnalyzerFlutterApi { void analyze(int identifier, int imageProxyIdentifier); - static void setup(AnalyzerFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(AnalyzerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerFlutterApi.create', codec, @@ -2548,7 +2494,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2567,7 +2513,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2648,8 +2594,7 @@ abstract class ImageProxyFlutterApi { void create(int identifier, int format, int height, int width); - static void setup(ImageProxyFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(ImageProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyFlutterApi.create', codec, @@ -2659,7 +2604,7 @@ abstract class ImageProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2686,8 +2631,7 @@ abstract class PlaneProxyFlutterApi { void create(int identifier, Uint8List buffer, int pixelStride, int rowStride); - static void setup(PlaneProxyFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(PlaneProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PlaneProxyFlutterApi.create', codec, @@ -2697,7 +2641,7 @@ abstract class PlaneProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2711,8 +2655,7 @@ abstract class PlaneProxyFlutterApi { final int? arg_rowStride = (args[3] as int?); assert(arg_rowStride != null, 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); + api.create(arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); return; }); } @@ -2738,9 +2681,9 @@ class _QualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2758,18 +2701,12 @@ class QualitySelectorHostApi { static const MessageCodec codec = _QualitySelectorHostApiCodec(); - Future create( - int arg_identifier, - List arg_videoQualityDataList, - int? arg_fallbackStrategyId) async { + Future create(int arg_identifier, List arg_videoQualityDataList, int? arg_fallbackStrategyId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_videoQualityDataList, - arg_fallbackStrategyId - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_videoQualityDataList, arg_fallbackStrategyId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2786,13 +2723,12 @@ class QualitySelectorHostApi { } } - Future getResolution( - int arg_cameraInfoId, VideoQuality arg_quality) async { + Future getResolution(int arg_cameraInfoId, VideoQuality arg_quality) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_cameraInfoId, arg_quality.index]) as List?; + final List? replyList = + await channel.send([arg_cameraInfoId, arg_quality.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2825,16 +2761,12 @@ class FallbackStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, VideoQuality arg_quality, - VideoResolutionFallbackRule arg_fallbackRule) async { + Future create(int arg_identifier, VideoQuality arg_quality, VideoResolutionFallbackRule arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_quality.index, - arg_fallbackRule.index - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_quality.index, arg_fallbackRule.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2866,8 +2798,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_torch]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_torch]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2888,8 +2820,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_ratio]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_ratio]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2906,14 +2838,12 @@ class CameraControlHostApi { } } - Future startFocusAndMetering( - int arg_identifier, int arg_focusMeteringActionId) async { + Future startFocusAndMetering(int arg_identifier, int arg_focusMeteringActionId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_focusMeteringActionId]) - as List?; + await channel.send([arg_identifier, arg_focusMeteringActionId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2952,14 +2882,12 @@ class CameraControlHostApi { } } - Future setExposureCompensationIndex( - int arg_identifier, int arg_index) async { + Future setExposureCompensationIndex(int arg_identifier, int arg_index) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_index]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2982,8 +2910,7 @@ abstract class CameraControlFlutterApi { void create(int identifier); - static void setup(CameraControlFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(CameraControlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlFlutterApi.create', codec, @@ -2993,7 +2920,7 @@ abstract class CameraControlFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3021,7 +2948,7 @@ class _FocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3039,18 +2966,12 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create( - int arg_identifier, - List arg_meteringPointInfos, - bool? arg_disableAutoCancel) async { + Future create(int arg_identifier, List arg_meteringPointInfos, bool? arg_disableAutoCancel) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send([ - arg_identifier, - arg_meteringPointInfos, - arg_disableAutoCancel - ]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_meteringPointInfos, arg_disableAutoCancel]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3080,8 +3001,7 @@ class FocusMeteringResultHostApi { Future isFocusSuccessful(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', - codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3112,8 +3032,7 @@ abstract class FocusMeteringResultFlutterApi { void create(int identifier); - static void setup(FocusMeteringResultFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(FocusMeteringResultFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringResultFlutterApi.create', codec, @@ -3123,7 +3042,7 @@ abstract class FocusMeteringResultFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3146,14 +3065,12 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, - double? arg_size, int arg_cameraInfoId) async { + Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size, int arg_cameraInfoId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_x, arg_y, arg_size, arg_cameraInfoId]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_x, arg_y, arg_size, arg_cameraInfoId]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3174,7 +3091,8 @@ class MeteringPointHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send(null) as List?; + final List? replyList = + await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3230,19 +3148,19 @@ class _CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3258,16 +3176,14 @@ class CaptureRequestOptionsHostApi { : _binaryMessenger = binaryMessenger; final BinaryMessenger? _binaryMessenger; - static const MessageCodec codec = - _CaptureRequestOptionsHostApiCodec(); + static const MessageCodec codec = _CaptureRequestOptionsHostApiCodec(); - Future create( - int arg_identifier, Map arg_options) async { + Future create(int arg_identifier, Map arg_options) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_options]) as List?; + final List? replyList = + await channel.send([arg_identifier, arg_options]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3295,14 +3211,12 @@ class Camera2CameraControlHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create( - int arg_identifier, int arg_cameraControlIdentifier) async { + Future create(int arg_identifier, int arg_cameraControlIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_identifier, arg_cameraControlIdentifier]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_cameraControlIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3319,15 +3233,12 @@ class Camera2CameraControlHostApi { } } - Future addCaptureRequestOptions( - int arg_identifier, int arg_captureRequestOptionsIdentifier) async { + Future addCaptureRequestOptions(int arg_identifier, int arg_captureRequestOptionsIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', - codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel.send( - [arg_identifier, arg_captureRequestOptionsIdentifier]) - as List?; + final List? replyList = + await channel.send([arg_identifier, arg_captureRequestOptionsIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3360,7 +3271,7 @@ class _ResolutionFilterHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3378,15 +3289,12 @@ class ResolutionFilterHostApi { static const MessageCodec codec = _ResolutionFilterHostApiCodec(); - Future createWithOnePreferredSize( - int arg_identifier, ResolutionInfo arg_preferredResolution) async { + Future createWithOnePreferredSize(int arg_identifier, ResolutionInfo arg_preferredResolution) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', - codec, + 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_preferredResolution]) - as List?; + await channel.send([arg_identifier, arg_preferredResolution]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3418,8 +3326,8 @@ class Camera2CameraInfoHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom', codec, binaryMessenger: _binaryMessenger); - final List? replyList = await channel - .send([arg_cameraInfoIdentifier]) as List?; + final List? replyList = + await channel.send([arg_cameraInfoIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3443,8 +3351,7 @@ class Camera2CameraInfoHostApi { Future getSupportedHardwareLevel(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', - codec, + 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3502,8 +3409,7 @@ abstract class Camera2CameraInfoFlutterApi { void create(int identifier); - static void setup(Camera2CameraInfoFlutterApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(Camera2CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create', codec, @@ -3513,7 +3419,7 @@ abstract class Camera2CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, diff --git a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart index 971ef49390ac..f718aa59558c 100644 --- a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart +++ b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import 'dart:async'; + import 'package:flutter/services.dart' show BinaryMessenger; import 'package:meta/meta.dart' show immutable; @@ -30,6 +32,11 @@ class PendingRecording extends JavaObject { late final PendingRecordingHostApiImpl _api; + /// Stream that emits an event when the corresponding video recording is finalized. + static final StreamController + videoRecordingFinalizedStreamController = + StreamController.broadcast(); + /// Starts the recording, making it an active recording. Future start() { return _api.startFromInstance(this); @@ -100,4 +107,10 @@ class PendingRecordingFlutterApiImpl extends PendingRecordingFlutterApi { ); }); } + + @override + void onVideoRecordingFinalized() { + PendingRecording.videoRecordingFinalizedStreamController + .add('Video recording has been finalized'); + } } diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index f51eae8c306a..3bb6d4884389 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -325,6 +325,8 @@ abstract class PendingRecordingHostApi { @FlutterApi() abstract class PendingRecordingFlutterApi { void create(int identifier); + + void onVideoRecordingFinalized(); } @HostApi(dartHostTestHandler: 'TestRecordingHostApi') diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index 8a659e460cd7..ede89e16dbc6 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -14,8 +14,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; abstract class TestInstanceManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); /// Clear the native `InstanceManager`. @@ -23,19 +22,15 @@ abstract class TestInstanceManagerHostApi { /// This is typically only used after a hot restart. void clear(); - static void setup(TestInstanceManagerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestInstanceManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.clear(); return []; @@ -46,27 +41,22 @@ abstract class TestInstanceManagerHostApi { } abstract class TestJavaObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void dispose(int identifier); - static void setup(TestJavaObjectHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestJavaObjectHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -80,8 +70,7 @@ abstract class TestJavaObjectHostApi { } abstract class TestCameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getSensorRotationDegrees(int identifier); @@ -92,22 +81,17 @@ abstract class TestCameraInfoHostApi { int getZoomState(int identifier); - static void setup(TestCameraInfoHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', - codec, + 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -122,14 +106,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getCameraState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -144,14 +125,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getExposureState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -166,14 +144,11 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getZoomState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -187,29 +162,24 @@ abstract class TestCameraInfoHostApi { } abstract class TestCameraSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? lensFacing); List filter(int identifier, List cameraInfoIds); - static void setup(TestCameraSelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -225,24 +195,19 @@ abstract class TestCameraSelectorHostApi { 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null int.'); - final List? arg_cameraInfoIds = - (args[1] as List?)?.cast(); + final List? arg_cameraInfoIds = (args[1] as List?)?.cast(); assert(arg_cameraInfoIds != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List.'); - final List output = - api.filter(arg_identifier!, arg_cameraInfoIds!); + final List output = api.filter(arg_identifier!, arg_cameraInfoIds!); return [output]; }); } @@ -251,16 +216,14 @@ abstract class TestCameraSelectorHostApi { } abstract class TestProcessCameraProviderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future getInstance(); List getAvailableCameraInfos(int identifier); - int bindToLifecycle( - int identifier, int cameraSelectorIdentifier, List useCaseIds); + int bindToLifecycle(int identifier, int cameraSelectorIdentifier, List useCaseIds); bool isBound(int identifier, int useCaseIdentifier); @@ -268,19 +231,15 @@ abstract class TestProcessCameraProviderHostApi { void unbindAll(int identifier); - static void setup(TestProcessCameraProviderHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestProcessCameraProviderHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final int output = await api.getInstance(); return [output]; @@ -289,42 +248,33 @@ abstract class TestProcessCameraProviderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); - final List output = - api.getAvailableCameraInfos(arg_identifier!); + final List output = api.getAvailableCameraInfos(arg_identifier!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', - codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -332,12 +282,10 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_cameraSelectorIdentifier = (args[1] as int?); assert(arg_cameraSelectorIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null int.'); - final List? arg_useCaseIds = - (args[2] as List?)?.cast(); + final List? arg_useCaseIds = (args[2] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List.'); - final int output = api.bindToLifecycle( - arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); + final int output = api.bindToLifecycle(arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); return [output]; }); } @@ -347,14 +295,11 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -362,8 +307,7 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_useCaseIdentifier = (args[1] as int?); assert(arg_useCaseIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); - final bool output = - api.isBound(arg_identifier!, arg_useCaseIdentifier!); + final bool output = api.isBound(arg_identifier!, arg_useCaseIdentifier!); return [output]; }); } @@ -373,20 +317,16 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null int.'); - final List? arg_useCaseIds = - (args[1] as List?)?.cast(); + final List? arg_useCaseIds = (args[1] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List.'); api.unbind(arg_identifier!, arg_useCaseIds!); @@ -399,14 +339,11 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -420,29 +357,24 @@ abstract class TestProcessCameraProviderHostApi { } abstract class TestCameraHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getCameraInfo(int identifier); int getCameraControl(int identifier); - static void setup(TestCameraHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraHostApi.getCameraInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -457,14 +389,11 @@ abstract class TestCameraHostApi { 'dev.flutter.pigeon.CameraHostApi.getCameraControl', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -492,7 +421,7 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -501,37 +430,29 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { } abstract class TestSystemServicesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestSystemServicesHostApiCodec(); - Future requestCameraPermissions( - bool enableAudio); + Future requestCameraPermissions(bool enableAudio); String getTempFilePath(String prefix, String suffix); - static void setup(TestSystemServicesHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestSystemServicesHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', - codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); final List args = (message as List?)!; final bool? arg_enableAudio = (args[0] as bool?); assert(arg_enableAudio != null, 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); - final CameraPermissionsErrorData? output = - await api.requestCameraPermissions(arg_enableAudio!); + final CameraPermissionsErrorData? output = await api.requestCameraPermissions(arg_enableAudio!); return [output]; }); } @@ -541,14 +462,11 @@ abstract class TestSystemServicesHostApi { 'dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); final List args = (message as List?)!; final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, @@ -565,33 +483,26 @@ abstract class TestSystemServicesHostApi { } abstract class TestDeviceOrientationManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void startListeningForDeviceOrientationChange( - bool isFrontFacing, int sensorOrientation); + void startListeningForDeviceOrientationChange(bool isFrontFacing, int sensorOrientation); void stopListeningForDeviceOrientationChange(); int getDefaultDisplayRotation(); - static void setup(TestDeviceOrientationManagerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestDeviceOrientationManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); final List args = (message as List?)!; final bool? arg_isFrontFacing = (args[0] as bool?); assert(arg_isFrontFacing != null, @@ -599,24 +510,19 @@ abstract class TestDeviceOrientationManagerHostApi { final int? arg_sensorOrientation = (args[1] as int?); assert(arg_sensorOrientation != null, 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); - api.startListeningForDeviceOrientationChange( - arg_isFrontFacing!, arg_sensorOrientation!); + api.startListeningForDeviceOrientationChange(arg_isFrontFacing!, arg_sensorOrientation!); return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.stopListeningForDeviceOrientationChange(); return []; @@ -625,16 +531,12 @@ abstract class TestDeviceOrientationManagerHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', - codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final int output = api.getDefaultDisplayRotation(); return [output]; @@ -659,7 +561,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -668,8 +570,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { } abstract class TestPreviewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestPreviewHostApiCodec(); void create(int identifier, int? rotation, int? resolutionSelectorId); @@ -682,21 +583,17 @@ abstract class TestPreviewHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestPreviewHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestPreviewHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -713,14 +610,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -732,16 +626,12 @@ abstract class TestPreviewHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', - codec, + 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message api.releaseFlutterSurfaceTexture(); return []; @@ -753,14 +643,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -775,14 +662,11 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -799,8 +683,7 @@ abstract class TestPreviewHostApi { } abstract class TestVideoCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int withOutput(int videoOutputId); @@ -809,21 +692,17 @@ abstract class TestVideoCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestVideoCaptureHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestVideoCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.withOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); final List args = (message as List?)!; final int? arg_videoOutputId = (args[0] as int?); assert(arg_videoOutputId != null, @@ -838,14 +717,11 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.getOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -860,14 +736,11 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -884,12 +757,10 @@ abstract class TestVideoCaptureHostApi { } abstract class TestRecorderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create( - int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); + void create(int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); int getAspectRatio(int identifier); @@ -897,21 +768,17 @@ abstract class TestRecorderHostApi { int prepareRecording(int identifier, String path); - static void setup(TestRecorderHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecorderHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -919,8 +786,7 @@ abstract class TestRecorderHostApi { final int? arg_aspectRatio = (args[1] as int?); final int? arg_bitRate = (args[2] as int?); final int? arg_qualitySelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, - arg_qualitySelectorId); + api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId); return []; }); } @@ -930,14 +796,11 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.getAspectRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -949,18 +812,14 @@ abstract class TestRecorderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', - codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -975,14 +834,11 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -999,27 +855,22 @@ abstract class TestRecorderHostApi { } abstract class TestPendingRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int start(int identifier); - static void setup(TestPendingRecordingHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestPendingRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingHostApi.start', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1033,8 +884,7 @@ abstract class TestPendingRecordingHostApi { } abstract class TestRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void close(int identifier); @@ -1045,21 +895,17 @@ abstract class TestRecordingHostApi { void stop(int identifier); - static void setup(TestRecordingHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1074,14 +920,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.pause', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1096,14 +939,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.resume', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1118,14 +958,11 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.stop', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1139,12 +976,10 @@ abstract class TestRecordingHostApi { } abstract class TestImageCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? targetRotation, int? flashMode, - int? resolutionSelectorId); + void create(int identifier, int? targetRotation, int? flashMode, int? resolutionSelectorId); void setFlashMode(int identifier, int flashMode); @@ -1152,21 +987,17 @@ abstract class TestImageCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageCaptureHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1174,8 +1005,7 @@ abstract class TestImageCaptureHostApi { final int? arg_targetRotation = (args[1] as int?); final int? arg_flashMode = (args[2] as int?); final int? arg_resolutionSelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_flashMode, - arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId); return []; }); } @@ -1185,14 +1015,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1210,14 +1037,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1232,14 +1056,11 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1270,7 +1091,7 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1279,28 +1100,22 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestResolutionStrategyHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestResolutionStrategyHostApiCodec(); void create(int identifier, ResolutionInfo? boundSize, int? fallbackRule); - static void setup(TestResolutionStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1316,28 +1131,22 @@ abstract class TestResolutionStrategyHostApi { } abstract class TestResolutionSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? resolutionStrategyIdentifier, - int? resolutionSelectorIdentifier, int? aspectRatioStrategyIdentifier); + void create(int identifier, int? resolutionStrategyIdentifier, int? resolutionSelectorIdentifier, int? aspectRatioStrategyIdentifier); - static void setup(TestResolutionSelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1345,11 +1154,7 @@ abstract class TestResolutionSelectorHostApi { final int? arg_resolutionStrategyIdentifier = (args[1] as int?); final int? arg_resolutionSelectorIdentifier = (args[2] as int?); final int? arg_aspectRatioStrategyIdentifier = (args[3] as int?); - api.create( - arg_identifier!, - arg_resolutionStrategyIdentifier, - arg_resolutionSelectorIdentifier, - arg_aspectRatioStrategyIdentifier); + api.create(arg_identifier!, arg_resolutionStrategyIdentifier, arg_resolutionSelectorIdentifier, arg_aspectRatioStrategyIdentifier); return []; }); } @@ -1358,27 +1163,22 @@ abstract class TestResolutionSelectorHostApi { } abstract class TestAspectRatioStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int preferredAspectRatio, int fallbackRule); - static void setup(TestAspectRatioStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestAspectRatioStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1389,8 +1189,7 @@ abstract class TestAspectRatioStrategyHostApi { final int? arg_fallbackRule = (args[2] as int?); assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); + api.create(arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); return []; }); } @@ -1399,8 +1198,7 @@ abstract class TestAspectRatioStrategyHostApi { } abstract class TestImageAnalysisHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? targetRotation, int? resolutionSelectorId); @@ -1411,29 +1209,24 @@ abstract class TestImageAnalysisHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageAnalysisHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageAnalysisHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null, expected non-null int.'); final int? arg_targetRotation = (args[1] as int?); final int? arg_resolutionSelectorId = (args[2] as int?); - api.create( - arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); return []; }); } @@ -1443,14 +1236,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1468,14 +1258,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1490,14 +1277,11 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1514,27 +1298,22 @@ abstract class TestImageAnalysisHostApi { } abstract class TestAnalyzerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestAnalyzerHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestAnalyzerHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1548,27 +1327,22 @@ abstract class TestAnalyzerHostApi { } abstract class TestObserverHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestObserverHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestObserverHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1596,7 +1370,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1605,8 +1379,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { } abstract class TestLiveDataHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestLiveDataHostApiCodec(); void observe(int identifier, int observerIdentifier); @@ -1615,21 +1388,17 @@ abstract class TestLiveDataHostApi { int? getValue(int identifier, LiveDataSupportedTypeData type); - static void setup(TestLiveDataHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestLiveDataHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1647,14 +1416,11 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.removeObservers', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1669,20 +1435,16 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = - (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null LiveDataSupportedTypeData.'); final int? output = api.getValue(arg_identifier!, arg_type!); @@ -1694,29 +1456,24 @@ abstract class TestLiveDataHostApi { } abstract class TestImageProxyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); List getPlanes(int identifier); void close(int identifier); - static void setup(TestImageProxyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageProxyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyHostApi.getPlanes', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1731,14 +1488,11 @@ abstract class TestImageProxyHostApi { 'dev.flutter.pigeon.ImageProxyHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1769,9 +1523,9 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1780,41 +1534,33 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { } abstract class TestQualitySelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestQualitySelectorHostApiCodec(); - void create(int identifier, List videoQualityDataList, - int? fallbackStrategyId); + void create(int identifier, List videoQualityDataList, int? fallbackStrategyId); ResolutionInfo getResolution(int cameraInfoId, VideoQuality quality); - static void setup(TestQualitySelectorHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestQualitySelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null int.'); - final List? arg_videoQualityDataList = - (args[1] as List?)?.cast(); + final List? arg_videoQualityDataList = (args[1] as List?)?.cast(); assert(arg_videoQualityDataList != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null List.'); final int? arg_fallbackStrategyId = (args[2] as int?); - api.create(arg_identifier!, arg_videoQualityDataList!, - arg_fallbackStrategyId); + api.create(arg_identifier!, arg_videoQualityDataList!, arg_fallbackStrategyId); return []; }); } @@ -1824,24 +1570,19 @@ abstract class TestQualitySelectorHostApi { 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); final List args = (message as List?)!; final int? arg_cameraInfoId = (args[0] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null int.'); - final VideoQuality? arg_quality = - args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null VideoQuality.'); - final ResolutionInfo output = - api.getResolution(arg_cameraInfoId!, arg_quality!); + final ResolutionInfo output = api.getResolution(arg_cameraInfoId!, arg_quality!); return [output]; }); } @@ -1850,39 +1591,30 @@ abstract class TestQualitySelectorHostApi { } abstract class TestFallbackStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, VideoQuality quality, - VideoResolutionFallbackRule fallbackRule); + void create(int identifier, VideoQuality quality, VideoResolutionFallbackRule fallbackRule); - static void setup(TestFallbackStrategyHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFallbackStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null int.'); - final VideoQuality? arg_quality = - args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoQuality.'); - final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null - ? null - : VideoResolutionFallbackRule.values[args[2] as int]; + final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null ? null : VideoResolutionFallbackRule.values[args[2] as int]; assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoResolutionFallbackRule.'); api.create(arg_identifier!, arg_quality!, arg_fallbackRule!); @@ -1894,8 +1626,7 @@ abstract class TestFallbackStrategyHostApi { } abstract class TestCameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future enableTorch(int identifier, bool torch); @@ -1908,21 +1639,17 @@ abstract class TestCameraControlHostApi { Future setExposureCompensationIndex(int identifier, int index); - static void setup(TestCameraControlHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1940,14 +1667,11 @@ abstract class TestCameraControlHostApi { 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1962,18 +1686,14 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1981,26 +1701,21 @@ abstract class TestCameraControlHostApi { final int? arg_focusMeteringActionId = (args[1] as int?); assert(arg_focusMeteringActionId != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null, expected non-null int.'); - final int? output = await api.startFocusAndMetering( - arg_identifier!, arg_focusMeteringActionId!); + final int? output = await api.startFocusAndMetering(arg_identifier!, arg_focusMeteringActionId!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2012,18 +1727,14 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', - codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2031,8 +1742,7 @@ abstract class TestCameraControlHostApi { final int? arg_index = (args[1] as int?); assert(arg_index != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null, expected non-null int.'); - final int? output = await api.setExposureCompensationIndex( - arg_identifier!, arg_index!); + final int? output = await api.setExposureCompensationIndex(arg_identifier!, arg_index!); return [output]; }); } @@ -2055,7 +1765,7 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2064,40 +1774,31 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { } abstract class TestFocusMeteringActionHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestFocusMeteringActionHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestFocusMeteringActionHostApiCodec(); - void create(int identifier, List meteringPointInfos, - bool? disableAutoCancel); + void create(int identifier, List meteringPointInfos, bool? disableAutoCancel); - static void setup(TestFocusMeteringActionHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringActionHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null int.'); - final List? arg_meteringPointInfos = - (args[1] as List?)?.cast(); + final List? arg_meteringPointInfos = (args[1] as List?)?.cast(); assert(arg_meteringPointInfos != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null List.'); final bool? arg_disableAutoCancel = (args[2] as bool?); - api.create( - arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); + api.create(arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); return []; }); } @@ -2106,28 +1807,22 @@ abstract class TestFocusMeteringActionHostApi { } abstract class TestFocusMeteringResultHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); bool isFocusSuccessful(int identifier); - static void setup(TestFocusMeteringResultHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringResultHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', - codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2141,30 +1836,24 @@ abstract class TestFocusMeteringResultHostApi { } abstract class TestMeteringPointHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create( - int identifier, double x, double y, double? size, int cameraInfoId); + void create(int identifier, double x, double y, double? size, int cameraInfoId); double getDefaultPointSize(); - static void setup(TestMeteringPointHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestMeteringPointHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2179,8 +1868,7 @@ abstract class TestMeteringPointHostApi { final int? arg_cameraInfoId = (args[4] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null, expected non-null int.'); - api.create( - arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); + api.create(arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } @@ -2190,12 +1878,9 @@ abstract class TestMeteringPointHostApi { 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { // ignore message final double output = api.getDefaultPointSize(); return [output]; @@ -2238,19 +1923,19 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2259,34 +1944,27 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { } abstract class TestCaptureRequestOptionsHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestCaptureRequestOptionsHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestCaptureRequestOptionsHostApiCodec(); void create(int identifier, Map options); - static void setup(TestCaptureRequestOptionsHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCaptureRequestOptionsHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null int.'); - final Map? arg_options = - (args[1] as Map?)?.cast(); + final Map? arg_options = (args[1] as Map?)?.cast(); assert(arg_options != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null Map.'); api.create(arg_identifier!, arg_options!); @@ -2298,30 +1976,24 @@ abstract class TestCaptureRequestOptionsHostApi { } abstract class TestCamera2CameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int cameraControlIdentifier); - Future addCaptureRequestOptions( - int identifier, int captureRequestOptionsIdentifier); + Future addCaptureRequestOptions(int identifier, int captureRequestOptionsIdentifier); - static void setup(TestCamera2CameraControlHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCamera2CameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2336,18 +2008,14 @@ abstract class TestCamera2CameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', - codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2355,8 +2023,7 @@ abstract class TestCamera2CameraControlHostApi { final int? arg_captureRequestOptionsIdentifier = (args[1] as int?); assert(arg_captureRequestOptionsIdentifier != null, 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null, expected non-null int.'); - await api.addCaptureRequestOptions( - arg_identifier!, arg_captureRequestOptionsIdentifier!); + await api.addCaptureRequestOptions(arg_identifier!, arg_captureRequestOptionsIdentifier!); return []; }); } @@ -2379,7 +2046,7 @@ class _TestResolutionFilterHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2388,40 +2055,30 @@ class _TestResolutionFilterHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionFilterHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = - _TestResolutionFilterHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = _TestResolutionFilterHostApiCodec(); - void createWithOnePreferredSize( - int identifier, ResolutionInfo preferredResolution); + void createWithOnePreferredSize(int identifier, ResolutionInfo preferredResolution); - static void setup(TestResolutionFilterHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionFilterHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', - codec, + 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null.'); + 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null, expected non-null int.'); - final ResolutionInfo? arg_preferredResolution = - (args[1] as ResolutionInfo?); + final ResolutionInfo? arg_preferredResolution = (args[1] as ResolutionInfo?); assert(arg_preferredResolution != null, 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null, expected non-null ResolutionInfo.'); - api.createWithOnePreferredSize( - arg_identifier!, arg_preferredResolution!); + api.createWithOnePreferredSize(arg_identifier!, arg_preferredResolution!); return []; }); } @@ -2430,8 +2087,7 @@ abstract class TestResolutionFilterHostApi { } abstract class TestCamera2CameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => - TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int createFrom(int cameraInfoIdentifier); @@ -2440,21 +2096,17 @@ abstract class TestCamera2CameraInfoHostApi { String getCameraId(int identifier); - static void setup(TestCamera2CameraInfoHostApi? api, - {BinaryMessenger? binaryMessenger}) { + static void setup(TestCamera2CameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom was null.'); final List args = (message as List?)!; final int? arg_cameraInfoIdentifier = (args[0] as int?); assert(arg_cameraInfoIdentifier != null, @@ -2466,18 +2118,14 @@ abstract class TestCamera2CameraInfoHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', - codec, + 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2492,14 +2140,11 @@ abstract class TestCamera2CameraInfoHostApi { 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger - .setMockDecodedMessageHandler(channel, - (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, From 15d44d861404df4aa7716e66697492645990eda8 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 15:23:18 -0400 Subject: [PATCH 08/15] Use void stream --- .../lib/src/android_camera_camerax.dart | 2 +- .../camera_android_camerax/lib/src/pending_recording.dart | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index db7724de4b3d..b57440ac8257 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -125,7 +125,7 @@ class AndroidCameraCameraX extends CameraPlatform { final String videoPrefix = 'REC'; /// la la la TODO - final StreamQueue lol = StreamQueue( + final StreamQueue lol = StreamQueue( PendingRecording.videoRecordingFinalizedStreamController.stream); /// The [ImageCapture] instance that can be configured to capture a still image. diff --git a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart index f718aa59558c..e9b846f71d77 100644 --- a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart +++ b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart @@ -33,9 +33,8 @@ class PendingRecording extends JavaObject { late final PendingRecordingHostApiImpl _api; /// Stream that emits an event when the corresponding video recording is finalized. - static final StreamController - videoRecordingFinalizedStreamController = - StreamController.broadcast(); + static final StreamController videoRecordingFinalizedStreamController = + StreamController.broadcast(); /// Starts the recording, making it an active recording. Future start() { @@ -110,7 +109,6 @@ class PendingRecordingFlutterApiImpl extends PendingRecordingFlutterApi { @override void onVideoRecordingFinalized() { - PendingRecording.videoRecordingFinalizedStreamController - .add('Video recording has been finalized'); + PendingRecording.videoRecordingFinalizedStreamController.add(null); } } From f4fdc8d749aebb160daa4bd93bbe26b155021543 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 18:44:37 -0400 Subject: [PATCH 09/15] Remove prints --- .../example/integration_test/camera_test.dart | 41 - .../lib/src/android_camera_camerax.dart | 3 - .../video_player/lib/video_player.dart | 1 - .../video_player/video_player/pubspec.yaml | 3 +- .../plugins/videoplayer/VideoPlayer.java | 3 - .../video_player_avfoundation/CHANGELOG.md | 8 + .../darwin/video_player_avfoundation.podspec | 10 +- .../video_player_avfoundation/Package.swift | 46 + .../AVAssetTrackUtils.m | 46 + .../FVPVideoPlayerPlugin.m | 831 ++++++++++++++++++ .../Resources/PrivacyInfo.xcprivacy | 14 + .../AVAssetTrackUtils.h | 12 + .../FVPDisplayLink.h | 30 + .../FVPVideoPlayerPlugin.h | 13 + .../FVPVideoPlayerPlugin_Test.h | 53 ++ .../video_player_avfoundation/messages.g.h | 70 ++ .../video_player_avfoundation/messages.g.m | 402 +++++++++ .../FVPDisplayLink.m | 70 ++ .../include/.gitkeep | 0 .../include/FVPEmpty.h | 6 + .../FVPDisplayLink.m | 84 ++ .../include/.gitkeep | 0 .../include/FVPEmpty.h | 6 + .../example/ios/Podfile | 1 - .../ios/Runner.xcodeproj/project.pbxproj | 27 + .../xcshareddata/swiftpm/Package.resolved | 13 + .../xcshareddata/swiftpm/Package.resolved | 13 + .../example/macos/Podfile | 1 - .../macos/Runner.xcodeproj/project.pbxproj | 27 + .../xcshareddata/swiftpm/Package.resolved | 13 + .../xcshareddata/swiftpm/Package.resolved | 13 + .../example/macos/Runner/AppDelegate.swift | 2 +- .../pigeons/messages.dart | 7 +- .../video_player_avfoundation/pubspec.yaml | 2 +- 34 files changed, 1810 insertions(+), 61 deletions(-) create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Package.swift create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/AVAssetTrackUtils.m create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/AVAssetTrackUtils.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin_Test.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/FVPDisplayLink.m create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/.gitkeep create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/FVPEmpty.h create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/FVPDisplayLink.m create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/.gitkeep create mode 100644 packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/FVPEmpty.h create mode 100644 packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 packages/video_player/video_player_avfoundation/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 packages/video_player/video_player_avfoundation/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 95aec8017988..1985d1793c66 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -188,7 +188,6 @@ void main() { DateTime.now().millisecondsSinceEpoch - recordingStart; final File videoFile = File(file.path); - print('CAMILLE PATH: ${videoFile.absolute.path}'); final VideoPlayerController videoController = VideoPlayerController.file( videoFile, ); @@ -199,46 +198,6 @@ void main() { expect(duration, lessThan(recordingTime - timePaused)); }, skip: !Platform.isAndroid); - testWidgets('Video recording', (WidgetTester tester) async { - final List cameras = await availableCameras(); - if (cameras.isEmpty) { - return; - } - - final CameraController controller = CameraController( - cameras[0], - ResolutionPreset.low, - enableAudio: false, - ); - - await controller.initialize(); - await controller.prepareForVideoRecording(); - - // int startPause; - // int timePaused = 0; - - await controller.startVideoRecording(); - final int recordingStart = DateTime.now().millisecondsSinceEpoch; - sleep(const Duration(seconds: 2)); - - final XFile file = await controller.stopVideoRecording(); - final int recordingTime = - DateTime.now().millisecondsSinceEpoch - recordingStart; - // await Future.delayed(Duration(seconds: 5)); - - final File videoFile = File(file.path); - print('CAMILLE PATH: ${videoFile.absolute.path}'); - // Trying to prove that we can recetr ieve recorded vdeo, that we can play it on a phone, that we can pla it on a Mac, then if that works, figure out what we are missing on CameraX end or video player end. If that does work, then we ned to figure out why the video is invalid. ..if works in app but not test environment, figure out the difference between that and running manually. If it doens't work in sample app, then we know that we are back at square one.i - final VideoPlayerController videoController = VideoPlayerController.file( - videoFile, - ); - await videoController.initialize(); - final int duration = videoController.value.duration.inMilliseconds; - await videoController.dispose(); - - expect(duration, lessThan(recordingTime)); - }, skip: !Platform.isAndroid); - testWidgets( 'Android image streaming', (WidgetTester tester) async { diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index b57440ac8257..5132801b3cfb 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -994,9 +994,6 @@ class AndroidCameraCameraX extends CameraPlatform { // Stop the current active recording. await recording!.close(); await lol.next; - // await PendingRecording.videoRecordingFinalizedStreamController.stream.first; - print('CAMILLE HI!'); - // Wait for video recording to finalize. may want to move other logic in here. recording = null; pendingRecording = null; diff --git a/packages/video_player/video_player/lib/video_player.dart b/packages/video_player/video_player/lib/video_player.dart index 990e1c51ec86..007c6ba14e5d 100644 --- a/packages/video_player/video_player/lib/video_player.dart +++ b/packages/video_player/video_player/lib/video_player.dart @@ -399,7 +399,6 @@ class VideoPlayerController extends ValueNotifier { _creatingCompleter = Completer(); late DataSource dataSourceDescription; - print('CAMILLE data source type: $dataSourceType'); switch (dataSourceType) { case DataSourceType.asset: dataSourceDescription = DataSource( diff --git a/packages/video_player/video_player/pubspec.yaml b/packages/video_player/video_player/pubspec.yaml index 621a080946d2..0dbdd0c9062d 100644 --- a/packages/video_player/video_player/pubspec.yaml +++ b/packages/video_player/video_player/pubspec.yaml @@ -25,8 +25,7 @@ dependencies: flutter: sdk: flutter html: ^0.15.0 - video_player_android: - path: ../video_player_android/ + video_player_android: ^2.3.5 video_player_avfoundation: ^2.5.6 video_player_platform_interface: ">=6.1.0 <7.0.0" video_player_web: ^2.0.0 diff --git a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java index e6f72040cbfd..b8b781912308 100644 --- a/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java +++ b/packages/video_player/video_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayer.java @@ -147,7 +147,6 @@ private MediaSource buildMediaSource( break; } } - System.out.println("CAMILLE: " + type); switch (type) { case C.CONTENT_TYPE_SS: return new SsMediaSource.Factory( @@ -227,8 +226,6 @@ public void onPlaybackStateChanged(final int playbackState) { @Override public void onPlayerError(@NonNull final PlaybackException error) { - System.out.println("CAMILLE"); - System.out.println(error); setBuffering(false); if (error.errorCode == PlaybackException.ERROR_CODE_BEHIND_LIVE_WINDOW) { // See https://exoplayer.dev/live-streaming.html#behindlivewindowexception-and-error_code_behind_live_window diff --git a/packages/video_player/video_player_avfoundation/CHANGELOG.md b/packages/video_player/video_player_avfoundation/CHANGELOG.md index 80078f24cc4a..4ea05f7f1a9e 100644 --- a/packages/video_player/video_player_avfoundation/CHANGELOG.md +++ b/packages/video_player/video_player_avfoundation/CHANGELOG.md @@ -1,3 +1,11 @@ +## 2.6.1 + +* Adds files to make include directory permanent. + +## 2.6.0 + +* Adds Swift Package Manager compatibility. + ## 2.5.7 * Adds frame availability checks on iOS. diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation.podspec b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation.podspec index 50b4b2b5baf7..81e8d2f8e4ef 100644 --- a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation.podspec +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation.podspec @@ -14,14 +14,14 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation' } s.documentation_url = 'https://pub.dev/packages/video_player' - s.source_files = 'Classes/*' - s.ios.source_files = 'Classes/ios/*' - s.osx.source_files = 'Classes/macos/*' - s.public_header_files = 'Classes/**/*.h' + s.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation/**/*.{h,m}' + s.ios.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation_ios/*' + s.osx.source_files = 'video_player_avfoundation/Sources/video_player_avfoundation_macos/*' + s.public_header_files = 'video_player_avfoundation/Sources/video_player_avfoundation/include/**/*.h' s.ios.dependency 'Flutter' s.osx.dependency 'FlutterMacOS' s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.14' s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } - s.resource_bundles = {'video_player_avfoundation_privacy' => ['Resources/PrivacyInfo.xcprivacy']} + s.resource_bundles = {'video_player_avfoundation_privacy' => ['video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy']} end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Package.swift b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Package.swift new file mode 100644 index 000000000000..32bd171e33e4 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Package.swift @@ -0,0 +1,46 @@ +// swift-tools-version: 5.9 + +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import PackageDescription + +let package = Package( + name: "video_player_avfoundation", + platforms: [ + .iOS("12.0"), + .macOS("10.14"), + ], + products: [ + .library(name: "video-player-avfoundation", targets: ["video_player_avfoundation"]) + ], + dependencies: [], + targets: [ + .target( + name: "video_player_avfoundation", + dependencies: [ + .target(name: "video_player_avfoundation_ios", condition: .when(platforms: [.iOS])), + .target(name: "video_player_avfoundation_macos", condition: .when(platforms: [.macOS])), + ], + resources: [ + .process("Resources") + ], + cSettings: [ + .headerSearchPath("include/video_player_avfoundation") + ] + ), + .target( + name: "video_player_avfoundation_ios", + cSettings: [ + .headerSearchPath("../video_player_avfoundation/include/video_player_avfoundation") + ] + ), + .target( + name: "video_player_avfoundation_macos", + cSettings: [ + .headerSearchPath("../video_player_avfoundation/include/video_player_avfoundation") + ] + ), + ] +) diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/AVAssetTrackUtils.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/AVAssetTrackUtils.m new file mode 100644 index 000000000000..858e1f289f25 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/AVAssetTrackUtils.m @@ -0,0 +1,46 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +CGAffineTransform FVPGetStandardizedTransformForTrack(AVAssetTrack *track) { + CGAffineTransform t = track.preferredTransform; + CGSize size = track.naturalSize; + // Each case of control flows corresponds to a specific + // `UIImageOrientation`, with 8 cases in total. + if (t.a == 1 && t.b == 0 && t.c == 0 && t.d == 1) { + // UIImageOrientationUp + t.tx = 0; + t.ty = 0; + } else if (t.a == -1 && t.b == 0 && t.c == 0 && t.d == -1) { + // UIImageOrientationDown + t.tx = size.width; + t.ty = size.height; + } else if (t.a == 0 && t.b == -1 && t.c == 1 && t.d == 0) { + // UIImageOrientationLeft + t.tx = 0; + t.ty = size.width; + } else if (t.a == 0 && t.b == 1 && t.c == -1 && t.d == 0) { + // UIImageOrientationRight + t.tx = size.height; + t.ty = 0; + } else if (t.a == -1 && t.b == 0 && t.c == 0 && t.d == 1) { + // UIImageOrientationUpMirrored + t.tx = size.width; + t.ty = 0; + } else if (t.a == 1 && t.b == 0 && t.c == 0 && t.d == -1) { + // UIImageOrientationDownMirrored + t.tx = 0; + t.ty = size.height; + } else if (t.a == 0 && t.b == -1 && t.c == -1 && t.d == 0) { + // UIImageOrientationLeftMirrored + t.tx = size.height; + t.ty = size.width; + } else if (t.a == 0 && t.b == 1 && t.c == 1 && t.d == 0) { + // UIImageOrientationRightMirrored + t.tx = 0; + t.ty = 0; + } + return t; +} diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m new file mode 100644 index 000000000000..14ee7ccefde2 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/FVPVideoPlayerPlugin.m @@ -0,0 +1,831 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "FVPVideoPlayerPlugin.h" +#import "FVPVideoPlayerPlugin_Test.h" + +#import +#import + +#import "./include/video_player_avfoundation/AVAssetTrackUtils.h" +#import "./include/video_player_avfoundation/FVPDisplayLink.h" +#import "./include/video_player_avfoundation/messages.g.h" + +#if !__has_feature(objc_arc) +#error Code Requires ARC. +#endif + +@interface FVPFrameUpdater : NSObject +@property(nonatomic) int64_t textureId; +@property(nonatomic, weak, readonly) NSObject *registry; +// The output that this updater is managing. +@property(nonatomic, weak) AVPlayerItemVideoOutput *videoOutput; +// The last time that has been validated as avaliable according to hasNewPixelBufferForItemTime:. +@property(nonatomic, assign) CMTime lastKnownAvailableTime; +@end + +@implementation FVPFrameUpdater +- (FVPFrameUpdater *)initWithRegistry:(NSObject *)registry { + NSAssert(self, @"super init cannot be nil"); + if (self == nil) return nil; + _registry = registry; + _lastKnownAvailableTime = kCMTimeInvalid; + return self; +} + +- (void)displayLinkFired { + // Only report a new frame if one is actually available. + CMTime outputItemTime = [self.videoOutput itemTimeForHostTime:CACurrentMediaTime()]; + if ([self.videoOutput hasNewPixelBufferForItemTime:outputItemTime]) { + _lastKnownAvailableTime = outputItemTime; + [_registry textureFrameAvailable:_textureId]; + } +} +@end + +@interface FVPDefaultAVFactory : NSObject +@end + +@implementation FVPDefaultAVFactory +- (AVPlayer *)playerWithPlayerItem:(AVPlayerItem *)playerItem { + return [AVPlayer playerWithPlayerItem:playerItem]; +} +- (AVPlayerItemVideoOutput *)videoOutputWithPixelBufferAttributes: + (NSDictionary *)attributes { + return [[AVPlayerItemVideoOutput alloc] initWithPixelBufferAttributes:attributes]; +} +@end + +/// Non-test implementation of the diplay link factory. +@interface FVPDefaultDisplayLinkFactory : NSObject +@end + +@implementation FVPDefaultDisplayLinkFactory +- (FVPDisplayLink *)displayLinkWithRegistrar:(id)registrar + callback:(void (^)(void))callback { + return [[FVPDisplayLink alloc] initWithRegistrar:registrar callback:callback]; +} + +@end + +#pragma mark - + +@interface FVPVideoPlayer () +@property(readonly, nonatomic) AVPlayerItemVideoOutput *videoOutput; +// The plugin registrar, to obtain view information from. +@property(nonatomic, weak) NSObject *registrar; +// The CALayer associated with the Flutter view this plugin is associated with, if any. +@property(nonatomic, readonly) CALayer *flutterViewLayer; +@property(nonatomic) FlutterEventChannel *eventChannel; +@property(nonatomic) FlutterEventSink eventSink; +@property(nonatomic) CGAffineTransform preferredTransform; +@property(nonatomic, readonly) BOOL disposed; +@property(nonatomic, readonly) BOOL isPlaying; +@property(nonatomic) BOOL isLooping; +@property(nonatomic, readonly) BOOL isInitialized; +// The updater that drives callbacks to the engine to indicate that a new frame is ready. +@property(nonatomic) FVPFrameUpdater *frameUpdater; +// The display link that drives frameUpdater. +@property(nonatomic) FVPDisplayLink *displayLink; +// Whether a new frame needs to be provided to the engine regardless of the current play/pause state +// (e.g., after a seek while paused). If YES, the display link should continue to run until the next +// frame is successfully provided. +@property(nonatomic, assign) BOOL waitingForFrame; + +- (instancetype)initWithURL:(NSURL *)url + frameUpdater:(FVPFrameUpdater *)frameUpdater + displayLink:(FVPDisplayLink *)displayLink + httpHeaders:(nonnull NSDictionary *)headers + avFactory:(id)avFactory + registrar:(NSObject *)registrar; + +// Tells the player to run its frame updater until it receives a frame, regardless of the +// play/pause state. +- (void)expectFrame; +@end + +static void *timeRangeContext = &timeRangeContext; +static void *statusContext = &statusContext; +static void *presentationSizeContext = &presentationSizeContext; +static void *durationContext = &durationContext; +static void *playbackLikelyToKeepUpContext = &playbackLikelyToKeepUpContext; +static void *rateContext = &rateContext; + +@implementation FVPVideoPlayer +- (instancetype)initWithAsset:(NSString *)asset + frameUpdater:(FVPFrameUpdater *)frameUpdater + displayLink:(FVPDisplayLink *)displayLink + avFactory:(id)avFactory + registrar:(NSObject *)registrar { + NSString *path = [[NSBundle mainBundle] pathForResource:asset ofType:nil]; +#if TARGET_OS_OSX + // See https://github.com/flutter/flutter/issues/135302 + // TODO(stuartmorgan): Remove this if the asset APIs are adjusted to work better for macOS. + if (!path) { + path = [NSURL URLWithString:asset relativeToURL:NSBundle.mainBundle.bundleURL].path; + } +#endif + return [self initWithURL:[NSURL fileURLWithPath:path] + frameUpdater:frameUpdater + displayLink:displayLink + httpHeaders:@{} + avFactory:avFactory + registrar:registrar]; +} + +- (void)dealloc { + if (!_disposed) { + [self removeKeyValueObservers]; + } +} + +- (void)addObserversForItem:(AVPlayerItem *)item player:(AVPlayer *)player { + [item addObserver:self + forKeyPath:@"loadedTimeRanges" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:timeRangeContext]; + [item addObserver:self + forKeyPath:@"status" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:statusContext]; + [item addObserver:self + forKeyPath:@"presentationSize" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:presentationSizeContext]; + [item addObserver:self + forKeyPath:@"duration" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:durationContext]; + [item addObserver:self + forKeyPath:@"playbackLikelyToKeepUp" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:playbackLikelyToKeepUpContext]; + + // Add observer to AVPlayer instead of AVPlayerItem since the AVPlayerItem does not have a "rate" + // property + [player addObserver:self + forKeyPath:@"rate" + options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew + context:rateContext]; + + // Add an observer that will respond to itemDidPlayToEndTime + [[NSNotificationCenter defaultCenter] addObserver:self + selector:@selector(itemDidPlayToEndTime:) + name:AVPlayerItemDidPlayToEndTimeNotification + object:item]; +} + +- (void)itemDidPlayToEndTime:(NSNotification *)notification { + if (_isLooping) { + AVPlayerItem *p = [notification object]; + [p seekToTime:kCMTimeZero completionHandler:nil]; + } else { + if (_eventSink) { + _eventSink(@{@"event" : @"completed"}); + } + } +} + +const int64_t TIME_UNSET = -9223372036854775807; + +NS_INLINE int64_t FVPCMTimeToMillis(CMTime time) { + // When CMTIME_IS_INDEFINITE return a value that matches TIME_UNSET from ExoPlayer2 on Android. + // Fixes https://github.com/flutter/flutter/issues/48670 + if (CMTIME_IS_INDEFINITE(time)) return TIME_UNSET; + if (time.timescale == 0) return 0; + return time.value * 1000 / time.timescale; +} + +NS_INLINE CGFloat radiansToDegrees(CGFloat radians) { + // Input range [-pi, pi] or [-180, 180] + CGFloat degrees = GLKMathRadiansToDegrees((float)radians); + if (degrees < 0) { + // Convert -90 to 270 and -180 to 180 + return degrees + 360; + } + // Output degrees in between [0, 360] + return degrees; +}; + +- (AVMutableVideoComposition *)getVideoCompositionWithTransform:(CGAffineTransform)transform + withAsset:(AVAsset *)asset + withVideoTrack:(AVAssetTrack *)videoTrack { + AVMutableVideoCompositionInstruction *instruction = + [AVMutableVideoCompositionInstruction videoCompositionInstruction]; + instruction.timeRange = CMTimeRangeMake(kCMTimeZero, [asset duration]); + AVMutableVideoCompositionLayerInstruction *layerInstruction = + [AVMutableVideoCompositionLayerInstruction + videoCompositionLayerInstructionWithAssetTrack:videoTrack]; + [layerInstruction setTransform:_preferredTransform atTime:kCMTimeZero]; + + AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition]; + instruction.layerInstructions = @[ layerInstruction ]; + videoComposition.instructions = @[ instruction ]; + + // If in portrait mode, switch the width and height of the video + CGFloat width = videoTrack.naturalSize.width; + CGFloat height = videoTrack.naturalSize.height; + NSInteger rotationDegrees = + (NSInteger)round(radiansToDegrees(atan2(_preferredTransform.b, _preferredTransform.a))); + if (rotationDegrees == 90 || rotationDegrees == 270) { + width = videoTrack.naturalSize.height; + height = videoTrack.naturalSize.width; + } + videoComposition.renderSize = CGSizeMake(width, height); + + // TODO(@recastrodiaz): should we use videoTrack.nominalFrameRate ? + // Currently set at a constant 30 FPS + videoComposition.frameDuration = CMTimeMake(1, 30); + + return videoComposition; +} + +- (instancetype)initWithURL:(NSURL *)url + frameUpdater:(FVPFrameUpdater *)frameUpdater + displayLink:(FVPDisplayLink *)displayLink + httpHeaders:(nonnull NSDictionary *)headers + avFactory:(id)avFactory + registrar:(NSObject *)registrar { + NSDictionary *options = nil; + if ([headers count] != 0) { + options = @{@"AVURLAssetHTTPHeaderFieldsKey" : headers}; + } + AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:url options:options]; + AVPlayerItem *item = [AVPlayerItem playerItemWithAsset:urlAsset]; + return [self initWithPlayerItem:item + frameUpdater:frameUpdater + displayLink:(FVPDisplayLink *)displayLink + avFactory:avFactory + registrar:registrar]; +} + +- (instancetype)initWithPlayerItem:(AVPlayerItem *)item + frameUpdater:(FVPFrameUpdater *)frameUpdater + displayLink:(FVPDisplayLink *)displayLink + avFactory:(id)avFactory + registrar:(NSObject *)registrar { + self = [super init]; + NSAssert(self, @"super init cannot be nil"); + + _registrar = registrar; + _frameUpdater = frameUpdater; + + AVAsset *asset = [item asset]; + void (^assetCompletionHandler)(void) = ^{ + if ([asset statusOfValueForKey:@"tracks" error:nil] == AVKeyValueStatusLoaded) { + NSArray *tracks = [asset tracksWithMediaType:AVMediaTypeVideo]; + if ([tracks count] > 0) { + AVAssetTrack *videoTrack = tracks[0]; + void (^trackCompletionHandler)(void) = ^{ + if (self->_disposed) return; + if ([videoTrack statusOfValueForKey:@"preferredTransform" + error:nil] == AVKeyValueStatusLoaded) { + // Rotate the video by using a videoComposition and the preferredTransform + self->_preferredTransform = FVPGetStandardizedTransformForTrack(videoTrack); + // Note: + // https://developer.apple.com/documentation/avfoundation/avplayeritem/1388818-videocomposition + // Video composition can only be used with file-based media and is not supported for + // use with media served using HTTP Live Streaming. + AVMutableVideoComposition *videoComposition = + [self getVideoCompositionWithTransform:self->_preferredTransform + withAsset:asset + withVideoTrack:videoTrack]; + item.videoComposition = videoComposition; + } + }; + [videoTrack loadValuesAsynchronouslyForKeys:@[ @"preferredTransform" ] + completionHandler:trackCompletionHandler]; + } + } + }; + + _player = [avFactory playerWithPlayerItem:item]; + _player.actionAtItemEnd = AVPlayerActionAtItemEndNone; + + // This is to fix 2 bugs: 1. blank video for encrypted video streams on iOS 16 + // (https://github.com/flutter/flutter/issues/111457) and 2. swapped width and height for some + // video streams (not just iOS 16). (https://github.com/flutter/flutter/issues/109116). An + // invisible AVPlayerLayer is used to overwrite the protection of pixel buffers in those streams + // for issue #1, and restore the correct width and height for issue #2. + _playerLayer = [AVPlayerLayer playerLayerWithPlayer:_player]; + [self.flutterViewLayer addSublayer:_playerLayer]; + + // Configure output. + _displayLink = displayLink; + NSDictionary *pixBuffAttributes = @{ + (id)kCVPixelBufferPixelFormatTypeKey : @(kCVPixelFormatType_32BGRA), + (id)kCVPixelBufferIOSurfacePropertiesKey : @{} + }; + _videoOutput = [avFactory videoOutputWithPixelBufferAttributes:pixBuffAttributes]; + frameUpdater.videoOutput = _videoOutput; + + [self addObserversForItem:item player:_player]; + + [asset loadValuesAsynchronouslyForKeys:@[ @"tracks" ] completionHandler:assetCompletionHandler]; + + return self; +} + +- (void)observeValueForKeyPath:(NSString *)path + ofObject:(id)object + change:(NSDictionary *)change + context:(void *)context { + if (context == timeRangeContext) { + if (_eventSink != nil) { + NSMutableArray *> *values = [[NSMutableArray alloc] init]; + for (NSValue *rangeValue in [object loadedTimeRanges]) { + CMTimeRange range = [rangeValue CMTimeRangeValue]; + int64_t start = FVPCMTimeToMillis(range.start); + [values addObject:@[ @(start), @(start + FVPCMTimeToMillis(range.duration)) ]]; + } + _eventSink(@{@"event" : @"bufferingUpdate", @"values" : values}); + } + } else if (context == statusContext) { + AVPlayerItem *item = (AVPlayerItem *)object; + switch (item.status) { + case AVPlayerItemStatusFailed: + if (_eventSink != nil) { + _eventSink([FlutterError + errorWithCode:@"VideoError" + message:[@"Failed to load video: " + stringByAppendingString:[item.error localizedDescription]] + details:nil]); + } + break; + case AVPlayerItemStatusUnknown: + break; + case AVPlayerItemStatusReadyToPlay: + [item addOutput:_videoOutput]; + [self setupEventSinkIfReadyToPlay]; + [self updatePlayingState]; + break; + } + } else if (context == presentationSizeContext || context == durationContext) { + AVPlayerItem *item = (AVPlayerItem *)object; + if (item.status == AVPlayerItemStatusReadyToPlay) { + // Due to an apparent bug, when the player item is ready, it still may not have determined + // its presentation size or duration. When these properties are finally set, re-check if + // all required properties and instantiate the event sink if it is not already set up. + [self setupEventSinkIfReadyToPlay]; + [self updatePlayingState]; + } + } else if (context == playbackLikelyToKeepUpContext) { + [self updatePlayingState]; + if ([[_player currentItem] isPlaybackLikelyToKeepUp]) { + if (_eventSink != nil) { + _eventSink(@{@"event" : @"bufferingEnd"}); + } + } else { + if (_eventSink != nil) { + _eventSink(@{@"event" : @"bufferingStart"}); + } + } + } else if (context == rateContext) { + // Important: Make sure to cast the object to AVPlayer when observing the rate property, + // as it is not available in AVPlayerItem. + AVPlayer *player = (AVPlayer *)object; + if (_eventSink != nil) { + _eventSink( + @{@"event" : @"isPlayingStateUpdate", @"isPlaying" : player.rate > 0 ? @YES : @NO}); + } + } +} + +- (void)updatePlayingState { + if (!_isInitialized) { + return; + } + if (_isPlaying) { + [_player play]; + } else { + [_player pause]; + } + // If the texture is still waiting for an expected frame, the display link needs to keep + // running until it arrives regardless of the play/pause state. + _displayLink.running = _isPlaying || self.waitingForFrame; +} + +- (void)setupEventSinkIfReadyToPlay { + if (_eventSink && !_isInitialized) { + AVPlayerItem *currentItem = self.player.currentItem; + CGSize size = currentItem.presentationSize; + CGFloat width = size.width; + CGFloat height = size.height; + + // Wait until tracks are loaded to check duration or if there are any videos. + AVAsset *asset = currentItem.asset; + if ([asset statusOfValueForKey:@"tracks" error:nil] != AVKeyValueStatusLoaded) { + void (^trackCompletionHandler)(void) = ^{ + if ([asset statusOfValueForKey:@"tracks" error:nil] != AVKeyValueStatusLoaded) { + // Cancelled, or something failed. + return; + } + // This completion block will run on an AVFoundation background queue. + // Hop back to the main thread to set up event sink. + [self performSelector:_cmd onThread:NSThread.mainThread withObject:self waitUntilDone:NO]; + }; + [asset loadValuesAsynchronouslyForKeys:@[ @"tracks" ] + completionHandler:trackCompletionHandler]; + return; + } + + BOOL hasVideoTracks = [asset tracksWithMediaType:AVMediaTypeVideo].count != 0; + BOOL hasNoTracks = asset.tracks.count == 0; + + // The player has not yet initialized when it has no size, unless it is an audio-only track. + // HLS m3u8 video files never load any tracks, and are also not yet initialized until they have + // a size. + if ((hasVideoTracks || hasNoTracks) && height == CGSizeZero.height && + width == CGSizeZero.width) { + return; + } + // The player may be initialized but still needs to determine the duration. + int64_t duration = [self duration]; + if (duration == 0) { + return; + } + + _isInitialized = YES; + _eventSink(@{ + @"event" : @"initialized", + @"duration" : @(duration), + @"width" : @(width), + @"height" : @(height) + }); + } +} + +- (void)play { + _isPlaying = YES; + [self updatePlayingState]; +} + +- (void)pause { + _isPlaying = NO; + [self updatePlayingState]; +} + +- (int64_t)position { + return FVPCMTimeToMillis([_player currentTime]); +} + +- (int64_t)duration { + // Note: https://openradar.appspot.com/radar?id=4968600712511488 + // `[AVPlayerItem duration]` can be `kCMTimeIndefinite`, + // use `[[AVPlayerItem asset] duration]` instead. + return FVPCMTimeToMillis([[[_player currentItem] asset] duration]); +} + +- (void)seekTo:(int64_t)location completionHandler:(void (^)(BOOL))completionHandler { + CMTime previousCMTime = _player.currentTime; + CMTime targetCMTime = CMTimeMake(location, 1000); + CMTimeValue duration = _player.currentItem.asset.duration.value; + // Without adding tolerance when seeking to duration, + // seekToTime will never complete, and this call will hang. + // see issue https://github.com/flutter/flutter/issues/124475. + CMTime tolerance = location == duration ? CMTimeMake(1, 1000) : kCMTimeZero; + [_player seekToTime:targetCMTime + toleranceBefore:tolerance + toleranceAfter:tolerance + completionHandler:^(BOOL completed) { + if (CMTimeCompare(self.player.currentTime, previousCMTime) != 0) { + // Ensure that a frame is drawn once available, even if currently paused. In theory a race + // is possible here where the new frame has already drawn by the time this code runs, and + // the display link stays on indefinitely, but that should be relatively harmless. This + // must use the display link rather than just informing the engine that a new frame is + // available because the seek completing doesn't guarantee that the pixel buffer is + // already available. + [self expectFrame]; + } + + if (completionHandler) { + completionHandler(completed); + } + }]; +} + +- (void)expectFrame { + self.waitingForFrame = YES; + self.displayLink.running = YES; +} + +- (void)setIsLooping:(BOOL)isLooping { + _isLooping = isLooping; +} + +- (void)setVolume:(double)volume { + _player.volume = (float)((volume < 0.0) ? 0.0 : ((volume > 1.0) ? 1.0 : volume)); +} + +- (void)setPlaybackSpeed:(double)speed { + // See https://developer.apple.com/library/archive/qa/qa1772/_index.html for an explanation of + // these checks. + if (speed > 2.0 && !_player.currentItem.canPlayFastForward) { + if (_eventSink != nil) { + _eventSink([FlutterError errorWithCode:@"VideoError" + message:@"Video cannot be fast-forwarded beyond 2.0x" + details:nil]); + } + return; + } + + if (speed < 1.0 && !_player.currentItem.canPlaySlowForward) { + if (_eventSink != nil) { + _eventSink([FlutterError errorWithCode:@"VideoError" + message:@"Video cannot be slow-forwarded" + details:nil]); + } + return; + } + + _player.rate = speed; +} + +- (CVPixelBufferRef)copyPixelBuffer { + CVPixelBufferRef buffer = NULL; + CMTime outputItemTime = [_videoOutput itemTimeForHostTime:CACurrentMediaTime()]; + if ([_videoOutput hasNewPixelBufferForItemTime:outputItemTime]) { + buffer = [_videoOutput copyPixelBufferForItemTime:outputItemTime itemTimeForDisplay:NULL]; + } else { + // If the current time isn't available yet, use the time that was checked when informing the + // engine that a frame was available (if any). + CMTime lastAvailableTime = self.frameUpdater.lastKnownAvailableTime; + if (CMTIME_IS_VALID(lastAvailableTime)) { + buffer = [_videoOutput copyPixelBufferForItemTime:lastAvailableTime itemTimeForDisplay:NULL]; + } + } + + if (self.waitingForFrame && buffer) { + self.waitingForFrame = NO; + // If the display link was only running temporarily to pick up a new frame while the video was + // paused, stop it again. + if (!self.isPlaying) { + self.displayLink.running = NO; + } + } + + return buffer; +} + +- (void)onTextureUnregistered:(NSObject *)texture { + dispatch_async(dispatch_get_main_queue(), ^{ + [self dispose]; + }); +} + +- (FlutterError *_Nullable)onCancelWithArguments:(id _Nullable)arguments { + _eventSink = nil; + return nil; +} + +- (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments + eventSink:(nonnull FlutterEventSink)events { + _eventSink = events; + // TODO(@recastrodiaz): remove the line below when the race condition is resolved: + // https://github.com/flutter/flutter/issues/21483 + // This line ensures the 'initialized' event is sent when the event + // 'AVPlayerItemStatusReadyToPlay' fires before _eventSink is set (this function + // onListenWithArguments is called) + [self setupEventSinkIfReadyToPlay]; + return nil; +} + +/// This method allows you to dispose without touching the event channel. This +/// is useful for the case where the Engine is in the process of deconstruction +/// so the channel is going to die or is already dead. +- (void)disposeSansEventChannel { + // This check prevents the crash caused by removing the KVO observers twice. + // When performing a Hot Restart, the leftover players are disposed once directly + // by [FVPVideoPlayerPlugin initialize:] method and then disposed again by + // [FVPVideoPlayer onTextureUnregistered:] call leading to possible over-release. + if (_disposed) { + return; + } + + _disposed = YES; + [_playerLayer removeFromSuperlayer]; + _displayLink = nil; + [self removeKeyValueObservers]; + + [self.player replaceCurrentItemWithPlayerItem:nil]; + [[NSNotificationCenter defaultCenter] removeObserver:self]; +} + +- (void)dispose { + [self disposeSansEventChannel]; + [_eventChannel setStreamHandler:nil]; +} + +- (CALayer *)flutterViewLayer { +#if TARGET_OS_OSX + return self.registrar.view.layer; +#else +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + // TODO(hellohuanlin): Provide a non-deprecated codepath. See + // https://github.com/flutter/flutter/issues/104117 + UIViewController *root = UIApplication.sharedApplication.keyWindow.rootViewController; +#pragma clang diagnostic pop + return root.view.layer; +#endif +} + +/// Removes all key-value observers set up for the player. +/// +/// This is called from dealloc, so must not use any methods on self. +- (void)removeKeyValueObservers { + AVPlayerItem *currentItem = _player.currentItem; + [currentItem removeObserver:self forKeyPath:@"status"]; + [currentItem removeObserver:self forKeyPath:@"loadedTimeRanges"]; + [currentItem removeObserver:self forKeyPath:@"presentationSize"]; + [currentItem removeObserver:self forKeyPath:@"duration"]; + [currentItem removeObserver:self forKeyPath:@"playbackLikelyToKeepUp"]; + [_player removeObserver:self forKeyPath:@"rate"]; +} + +@end + +@interface FVPVideoPlayerPlugin () +@property(readonly, weak, nonatomic) NSObject *registry; +@property(readonly, weak, nonatomic) NSObject *messenger; +@property(readonly, strong, nonatomic) NSObject *registrar; +@property(nonatomic, strong) id displayLinkFactory; +@property(nonatomic, strong) id avFactory; +@end + +@implementation FVPVideoPlayerPlugin ++ (void)registerWithRegistrar:(NSObject *)registrar { + FVPVideoPlayerPlugin *instance = [[FVPVideoPlayerPlugin alloc] initWithRegistrar:registrar]; + [registrar publish:instance]; + SetUpFVPAVFoundationVideoPlayerApi(registrar.messenger, instance); +} + +- (instancetype)initWithRegistrar:(NSObject *)registrar { + return [self initWithAVFactory:[[FVPDefaultAVFactory alloc] init] + displayLinkFactory:[[FVPDefaultDisplayLinkFactory alloc] init] + registrar:registrar]; +} + +- (instancetype)initWithAVFactory:(id)avFactory + displayLinkFactory:(id)displayLinkFactory + registrar:(NSObject *)registrar { + self = [super init]; + NSAssert(self, @"super init cannot be nil"); + _registry = [registrar textures]; + _messenger = [registrar messenger]; + _registrar = registrar; + _displayLinkFactory = displayLinkFactory ?: [[FVPDefaultDisplayLinkFactory alloc] init]; + _avFactory = avFactory ?: [[FVPDefaultAVFactory alloc] init]; + _playersByTextureId = [NSMutableDictionary dictionaryWithCapacity:1]; + return self; +} + +- (void)detachFromEngineForRegistrar:(NSObject *)registrar { + [self.playersByTextureId.allValues makeObjectsPerformSelector:@selector(disposeSansEventChannel)]; + [self.playersByTextureId removeAllObjects]; + SetUpFVPAVFoundationVideoPlayerApi(registrar.messenger, nil); +} + +- (int64_t)onPlayerSetup:(FVPVideoPlayer *)player frameUpdater:(FVPFrameUpdater *)frameUpdater { + int64_t textureId = [self.registry registerTexture:player]; + frameUpdater.textureId = textureId; + FlutterEventChannel *eventChannel = [FlutterEventChannel + eventChannelWithName:[NSString stringWithFormat:@"flutter.io/videoPlayer/videoEvents%lld", + textureId] + binaryMessenger:_messenger]; + [eventChannel setStreamHandler:player]; + player.eventChannel = eventChannel; + self.playersByTextureId[@(textureId)] = player; + + // Ensure that the first frame is drawn once available, even if the video isn't played, since + // the engine is now expecting the texture to be populated. + [player expectFrame]; + + return textureId; +} + +- (void)initialize:(FlutterError *__autoreleasing *)error { +#if TARGET_OS_IOS + // Allow audio playback when the Ring/Silent switch is set to silent + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; +#endif + + [self.playersByTextureId + enumerateKeysAndObjectsUsingBlock:^(NSNumber *textureId, FVPVideoPlayer *player, BOOL *stop) { + [self.registry unregisterTexture:textureId.unsignedIntegerValue]; + [player dispose]; + }]; + [self.playersByTextureId removeAllObjects]; +} + +- (nullable NSNumber *)createWithOptions:(nonnull FVPCreationOptions *)options + error:(FlutterError **)error { + FVPFrameUpdater *frameUpdater = [[FVPFrameUpdater alloc] initWithRegistry:_registry]; + FVPDisplayLink *displayLink = + [self.displayLinkFactory displayLinkWithRegistrar:_registrar + callback:^() { + [frameUpdater displayLinkFired]; + }]; + + FVPVideoPlayer *player; + if (options.asset) { + NSString *assetPath; + if (options.packageName) { + assetPath = [_registrar lookupKeyForAsset:options.asset fromPackage:options.packageName]; + } else { + assetPath = [_registrar lookupKeyForAsset:options.asset]; + } + @try { + player = [[FVPVideoPlayer alloc] initWithAsset:assetPath + frameUpdater:frameUpdater + displayLink:displayLink + avFactory:_avFactory + registrar:self.registrar]; + return @([self onPlayerSetup:player frameUpdater:frameUpdater]); + } @catch (NSException *exception) { + *error = [FlutterError errorWithCode:@"video_player" message:exception.reason details:nil]; + return nil; + } + } else if (options.uri) { + player = [[FVPVideoPlayer alloc] initWithURL:[NSURL URLWithString:options.uri] + frameUpdater:frameUpdater + displayLink:displayLink + httpHeaders:options.httpHeaders + avFactory:_avFactory + registrar:self.registrar]; + return @([self onPlayerSetup:player frameUpdater:frameUpdater]); + } else { + *error = [FlutterError errorWithCode:@"video_player" message:@"not implemented" details:nil]; + return nil; + } +} + +- (void)disposePlayer:(NSInteger)textureId error:(FlutterError **)error { + NSNumber *playerKey = @(textureId); + FVPVideoPlayer *player = self.playersByTextureId[playerKey]; + [self.registry unregisterTexture:textureId]; + [self.playersByTextureId removeObjectForKey:playerKey]; + if (!player.disposed) { + [player dispose]; + } +} + +- (void)setLooping:(BOOL)isLooping forPlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + player.isLooping = isLooping; +} + +- (void)setVolume:(double)volume forPlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + [player setVolume:volume]; +} + +- (void)setPlaybackSpeed:(double)speed forPlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + [player setPlaybackSpeed:speed]; +} + +- (void)playPlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + [player play]; +} + +- (nullable NSNumber *)positionForPlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + return @([player position]); +} + +- (void)seekTo:(NSInteger)position + forPlayer:(NSInteger)textureId + completion:(nonnull void (^)(FlutterError *_Nullable))completion { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + [player seekTo:position + completionHandler:^(BOOL finished) { + dispatch_async(dispatch_get_main_queue(), ^{ + completion(nil); + }); + }]; +} + +- (void)pausePlayer:(NSInteger)textureId error:(FlutterError **)error { + FVPVideoPlayer *player = self.playersByTextureId[@(textureId)]; + [player pause]; +} + +- (void)setMixWithOthers:(BOOL)mixWithOthers + error:(FlutterError *_Nullable __autoreleasing *)error { +#if TARGET_OS_OSX + // AVAudioSession doesn't exist on macOS, and audio always mixes, so just no-op. +#else + if (mixWithOthers) { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback + withOptions:AVAudioSessionCategoryOptionMixWithOthers + error:nil]; + } else { + [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil]; + } +#endif +} + +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 000000000000..a34b7e2e60cc --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,14 @@ + + + + + NSPrivacyTrackingDomains + + NSPrivacyAccessedAPITypes + + NSPrivacyCollectedDataTypes + + NSPrivacyTracking + + + diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/AVAssetTrackUtils.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/AVAssetTrackUtils.h new file mode 100644 index 000000000000..30dab06f18f2 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/AVAssetTrackUtils.h @@ -0,0 +1,12 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +/// Returns a standardized transform +/// according to the orientation of the track. +/// +/// Note: https://stackoverflow.com/questions/64161544 +/// `AVAssetTrack.preferredTransform` can have wrong `tx` and `ty`. +CGAffineTransform FVPGetStandardizedTransformForTrack(AVAssetTrack* track); diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h new file mode 100644 index 000000000000..80d400629b25 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h @@ -0,0 +1,30 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import + +#if TARGET_OS_OSX +#import +#else +#import +#endif + +// A cross-platform display link abstraction. +@interface FVPDisplayLink : NSObject + +/// Whether the display link is currently running (i.e., firing events). +/// +/// Defaults to NO. +@property(nonatomic, assign) BOOL running; + +/// Initializes a display link that calls the given callback when fired. +/// +/// The display link starts paused, so must be started, by setting 'running' to YES, before the +/// callback will fire. +- (instancetype)initWithRegistrar:(id)registrar + callback:(void (^)(void))callback NS_DESIGNATED_INITIALIZER; + +- (instancetype)init NS_UNAVAILABLE; + +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin.h new file mode 100644 index 000000000000..b64a173fe0cd --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin.h @@ -0,0 +1,13 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if TARGET_OS_OSX +#import +#else +#import +#endif + +@interface FVPVideoPlayerPlugin : NSObject +- (instancetype)initWithRegistrar:(NSObject *)registrar; +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin_Test.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin_Test.h new file mode 100644 index 000000000000..e34ce16eabcd --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayerPlugin_Test.h @@ -0,0 +1,53 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "FVPVideoPlayerPlugin.h" + +#import + +#import "FVPDisplayLink.h" +#import "messages.g.h" + +// Protocol for AVFoundation object instance factory. Used for injecting framework objects in tests. +@protocol FVPAVFactory +@required +- (AVPlayer *)playerWithPlayerItem:(AVPlayerItem *)playerItem; +- (AVPlayerItemVideoOutput *)videoOutputWithPixelBufferAttributes: + (NSDictionary *)attributes; +@end + +// Protocol for an AVPlayer instance factory. Used for injecting display links in tests. +@protocol FVPDisplayLinkFactory +- (FVPDisplayLink *)displayLinkWithRegistrar:(id)registrar + callback:(void (^)(void))callback; +@end + +#pragma mark - + +// TODO(stuartmorgan): Move this whole class to its own files. +@interface FVPVideoPlayer : NSObject +@property(readonly, nonatomic) AVPlayer *player; +// This is to fix 2 bugs: 1. blank video for encrypted video streams on iOS 16 +// (https://github.com/flutter/flutter/issues/111457) and 2. swapped width and height for some video +// streams (not just iOS 16). (https://github.com/flutter/flutter/issues/109116). +// An invisible AVPlayerLayer is used to overwrite the protection of pixel buffers in those streams +// for issue #1, and restore the correct width and height for issue #2. +@property(readonly, nonatomic) AVPlayerLayer *playerLayer; +@property(readonly, nonatomic) int64_t position; + +- (void)onTextureUnregistered:(NSObject *)texture; +@end + +#pragma mark - + +@interface FVPVideoPlayerPlugin () + +@property(readonly, strong, nonatomic) + NSMutableDictionary *playersByTextureId; + +- (instancetype)initWithAVFactory:(id)avFactory + displayLinkFactory:(id)displayLinkFactory + registrar:(NSObject *)registrar; + +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h new file mode 100644 index 000000000000..368c4893c662 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h @@ -0,0 +1,70 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#import + +@protocol FlutterBinaryMessenger; +@protocol FlutterMessageCodec; +@class FlutterError; +@class FlutterStandardTypedData; + +NS_ASSUME_NONNULL_BEGIN + +@class FVPCreationOptions; + +@interface FVPCreationOptions : NSObject +/// `init` unavailable to enforce nonnull fields, see the `make` class method. +- (instancetype)init NS_UNAVAILABLE; ++ (instancetype)makeWithAsset:(nullable NSString *)asset + uri:(nullable NSString *)uri + packageName:(nullable NSString *)packageName + formatHint:(nullable NSString *)formatHint + httpHeaders:(NSDictionary *)httpHeaders; +@property(nonatomic, copy, nullable) NSString *asset; +@property(nonatomic, copy, nullable) NSString *uri; +@property(nonatomic, copy, nullable) NSString *packageName; +@property(nonatomic, copy, nullable) NSString *formatHint; +@property(nonatomic, copy) NSDictionary *httpHeaders; +@end + +/// The codec used by FVPAVFoundationVideoPlayerApi. +NSObject *FVPAVFoundationVideoPlayerApiGetCodec(void); + +@protocol FVPAVFoundationVideoPlayerApi +- (void)initialize:(FlutterError *_Nullable *_Nonnull)error; +/// @return `nil` only when `error != nil`. +- (nullable NSNumber *)createWithOptions:(FVPCreationOptions *)creationOptions + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)disposePlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setLooping:(BOOL)isLooping + forPlayer:(NSInteger)textureId + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setVolume:(double)volume + forPlayer:(NSInteger)textureId + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setPlaybackSpeed:(double)speed + forPlayer:(NSInteger)textureId + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)playPlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error; +/// @return `nil` only when `error != nil`. +- (nullable NSNumber *)positionForPlayer:(NSInteger)textureId + error:(FlutterError *_Nullable *_Nonnull)error; +- (void)seekTo:(NSInteger)position + forPlayer:(NSInteger)textureId + completion:(void (^)(FlutterError *_Nullable))completion; +- (void)pausePlayer:(NSInteger)textureId error:(FlutterError *_Nullable *_Nonnull)error; +- (void)setMixWithOthers:(BOOL)mixWithOthers error:(FlutterError *_Nullable *_Nonnull)error; +@end + +extern void SetUpFVPAVFoundationVideoPlayerApi( + id binaryMessenger, + NSObject *_Nullable api); + +extern void SetUpFVPAVFoundationVideoPlayerApiWithSuffix( + id binaryMessenger, + NSObject *_Nullable api, NSString *messageChannelSuffix); + +NS_ASSUME_NONNULL_END diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m new file mode 100644 index 000000000000..1e2354d88289 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m @@ -0,0 +1,402 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// Autogenerated from Pigeon (v18.0.0), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +#import "./include/video_player_avfoundation/messages.g.h" + +#if TARGET_OS_OSX +#import +#else +#import +#endif + +#if !__has_feature(objc_arc) +#error File requires ARC to be enabled. +#endif + +static NSArray *wrapResult(id result, FlutterError *error) { + if (error) { + return @[ + error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] + ]; + } + return @[ result ?: [NSNull null] ]; +} + +static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { + id result = array[key]; + return (result == [NSNull null]) ? nil : result; +} + +@interface FVPCreationOptions () ++ (FVPCreationOptions *)fromList:(NSArray *)list; ++ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list; +- (NSArray *)toList; +@end + +@implementation FVPCreationOptions ++ (instancetype)makeWithAsset:(nullable NSString *)asset + uri:(nullable NSString *)uri + packageName:(nullable NSString *)packageName + formatHint:(nullable NSString *)formatHint + httpHeaders:(NSDictionary *)httpHeaders { + FVPCreationOptions *pigeonResult = [[FVPCreationOptions alloc] init]; + pigeonResult.asset = asset; + pigeonResult.uri = uri; + pigeonResult.packageName = packageName; + pigeonResult.formatHint = formatHint; + pigeonResult.httpHeaders = httpHeaders; + return pigeonResult; +} ++ (FVPCreationOptions *)fromList:(NSArray *)list { + FVPCreationOptions *pigeonResult = [[FVPCreationOptions alloc] init]; + pigeonResult.asset = GetNullableObjectAtIndex(list, 0); + pigeonResult.uri = GetNullableObjectAtIndex(list, 1); + pigeonResult.packageName = GetNullableObjectAtIndex(list, 2); + pigeonResult.formatHint = GetNullableObjectAtIndex(list, 3); + pigeonResult.httpHeaders = GetNullableObjectAtIndex(list, 4); + return pigeonResult; +} ++ (nullable FVPCreationOptions *)nullableFromList:(NSArray *)list { + return (list) ? [FVPCreationOptions fromList:list] : nil; +} +- (NSArray *)toList { + return @[ + self.asset ?: [NSNull null], + self.uri ?: [NSNull null], + self.packageName ?: [NSNull null], + self.formatHint ?: [NSNull null], + self.httpHeaders ?: [NSNull null], + ]; +} +@end + +@interface FVPAVFoundationVideoPlayerApiCodecReader : FlutterStandardReader +@end +@implementation FVPAVFoundationVideoPlayerApiCodecReader +- (nullable id)readValueOfType:(UInt8)type { + switch (type) { + case 128: + return [FVPCreationOptions fromList:[self readValue]]; + default: + return [super readValueOfType:type]; + } +} +@end + +@interface FVPAVFoundationVideoPlayerApiCodecWriter : FlutterStandardWriter +@end +@implementation FVPAVFoundationVideoPlayerApiCodecWriter +- (void)writeValue:(id)value { + if ([value isKindOfClass:[FVPCreationOptions class]]) { + [self writeByte:128]; + [self writeValue:[value toList]]; + } else { + [super writeValue:value]; + } +} +@end + +@interface FVPAVFoundationVideoPlayerApiCodecReaderWriter : FlutterStandardReaderWriter +@end +@implementation FVPAVFoundationVideoPlayerApiCodecReaderWriter +- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { + return [[FVPAVFoundationVideoPlayerApiCodecWriter alloc] initWithData:data]; +} +- (FlutterStandardReader *)readerWithData:(NSData *)data { + return [[FVPAVFoundationVideoPlayerApiCodecReader alloc] initWithData:data]; +} +@end + +NSObject *FVPAVFoundationVideoPlayerApiGetCodec(void) { + static FlutterStandardMessageCodec *sSharedObject = nil; + static dispatch_once_t sPred = 0; + dispatch_once(&sPred, ^{ + FVPAVFoundationVideoPlayerApiCodecReaderWriter *readerWriter = + [[FVPAVFoundationVideoPlayerApiCodecReaderWriter alloc] init]; + sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; + }); + return sSharedObject; +} + +void SetUpFVPAVFoundationVideoPlayerApi(id binaryMessenger, + NSObject *api) { + SetUpFVPAVFoundationVideoPlayerApiWithSuffix(binaryMessenger, api, @""); +} + +void SetUpFVPAVFoundationVideoPlayerApiWithSuffix(id binaryMessenger, + NSObject *api, + NSString *messageChannelSuffix) { + messageChannelSuffix = messageChannelSuffix.length > 0 + ? [NSString stringWithFormat:@".%@", messageChannelSuffix] + : @""; + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.initialize", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(initialize:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(initialize:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + FlutterError *error; + [api initialize:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.create", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(createWithOptions:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(createWithOptions:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + FVPCreationOptions *arg_creationOptions = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSNumber *output = [api createWithOptions:arg_creationOptions error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.dispose", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(disposePlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(disposePlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; + FlutterError *error; + [api disposePlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.setLooping", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(setLooping:forPlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(setLooping:forPlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + BOOL arg_isLooping = [GetNullableObjectAtIndex(args, 0) boolValue]; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; + FlutterError *error; + [api setLooping:arg_isLooping forPlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.setVolume", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(setVolume:forPlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(setVolume:forPlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + double arg_volume = [GetNullableObjectAtIndex(args, 0) doubleValue]; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; + FlutterError *error; + [api setVolume:arg_volume forPlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.setPlaybackSpeed", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(setPlaybackSpeed:forPlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(setPlaybackSpeed:forPlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + double arg_speed = [GetNullableObjectAtIndex(args, 0) doubleValue]; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; + FlutterError *error; + [api setPlaybackSpeed:arg_speed forPlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.play", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(playPlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to @selector(playPlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; + FlutterError *error; + [api playPlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.getPosition", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(positionForPlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(positionForPlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; + FlutterError *error; + NSNumber *output = [api positionForPlayer:arg_textureId error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.seekTo", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(seekTo:forPlayer:completion:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(seekTo:forPlayer:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_position = [GetNullableObjectAtIndex(args, 0) integerValue]; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 1) integerValue]; + [api seekTo:arg_position + forPlayer:arg_textureId + completion:^(FlutterError *_Nullable error) { + callback(wrapResult(nil, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.pause", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(pausePlayer:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(pausePlayer:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSInteger arg_textureId = [GetNullableObjectAtIndex(args, 0) integerValue]; + FlutterError *error; + [api pausePlayer:arg_textureId error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.video_player_avfoundation." + @"AVFoundationVideoPlayerApi.setMixWithOthers", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FVPAVFoundationVideoPlayerApiGetCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(setMixWithOthers:error:)], + @"FVPAVFoundationVideoPlayerApi api (%@) doesn't respond to " + @"@selector(setMixWithOthers:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + BOOL arg_mixWithOthers = [GetNullableObjectAtIndex(args, 0) boolValue]; + FlutterError *error; + [api setMixWithOthers:arg_mixWithOthers error:&error]; + callback(wrapResult(nil, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } +} diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/FVPDisplayLink.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/FVPDisplayLink.m new file mode 100644 index 000000000000..9bdb321ae164 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/FVPDisplayLink.m @@ -0,0 +1,70 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "../video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h" + +#import +#import + +/// A proxy object to act as a CADisplayLink target, to avoid retain loops, since FVPDisplayLink +/// owns its CADisplayLink, but CADisplayLink retains its target. +@interface FVPDisplayLinkTarget : NSObject +@property(nonatomic) void (^callback)(void); + +/// Initializes a target object that runs the given callback when onDisplayLink: is called. +- (instancetype)initWithCallback:(void (^)(void))callback; + +/// Method to be called when a CADisplayLink fires. +- (void)onDisplayLink:(CADisplayLink *)link; +@end + +@implementation FVPDisplayLinkTarget +- (instancetype)initWithCallback:(void (^)(void))callback { + self = [super init]; + if (self) { + _callback = callback; + } + return self; +} + +- (void)onDisplayLink:(CADisplayLink *)link { + self.callback(); +} +@end + +#pragma mark - + +@interface FVPDisplayLink () +// The underlying display link implementation. +@property(nonatomic) CADisplayLink *displayLink; +@property(nonatomic) FVPDisplayLinkTarget *target; +@end + +@implementation FVPDisplayLink + +- (instancetype)initWithRegistrar:(id)registrar + callback:(void (^)(void))callback { + self = [super init]; + if (self) { + _target = [[FVPDisplayLinkTarget alloc] initWithCallback:callback]; + _displayLink = [CADisplayLink displayLinkWithTarget:_target selector:@selector(onDisplayLink:)]; + [_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes]; + _displayLink.paused = YES; + } + return self; +} + +- (void)dealloc { + [_displayLink invalidate]; +} + +- (BOOL)running { + return !self.displayLink.paused; +} + +- (void)setRunning:(BOOL)running { + self.displayLink.paused = !running; +} + +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/.gitkeep b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/FVPEmpty.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/FVPEmpty.h new file mode 100644 index 000000000000..c7b344f7299d --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_ios/include/FVPEmpty.h @@ -0,0 +1,6 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Empty file to perserve include directory in pub-cache. See +// https://github.com/flutter/flutter/issues/148002 for more information. diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/FVPDisplayLink.m b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/FVPDisplayLink.m new file mode 100644 index 000000000000..cd5670fa5a37 --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/FVPDisplayLink.m @@ -0,0 +1,84 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "../video_player_avfoundation/include/video_player_avfoundation/FVPDisplayLink.h" + +#import +#import + +@interface FVPDisplayLink () +// The underlying display link implementation. +@property(nonatomic, assign) CVDisplayLinkRef displayLink; +// A dispatch source to move display link callbacks to the main thread. +@property(nonatomic, strong) dispatch_source_t displayLinkSource; +// The plugin registrar, to get screen information. +@property(nonatomic, weak) NSObject *registrar; +@end + +static CVReturn DisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTimeStamp *now, + const CVTimeStamp *outputTime, CVOptionFlags flagsIn, + CVOptionFlags *flagsOut, void *displayLinkSource) { + // Trigger the main-thread dispatch queue, to drive the callback there. + __weak dispatch_source_t source = (__bridge dispatch_source_t)displayLinkSource; + dispatch_source_merge_data(source, 1); + return kCVReturnSuccess; +} + +@implementation FVPDisplayLink + +- (instancetype)initWithRegistrar:(id)registrar + callback:(void (^)(void))callback { + self = [super init]; + if (self) { + _registrar = registrar; + // Create and start the main-thread dispatch queue to drive frameUpdater. + _displayLinkSource = + dispatch_source_create(DISPATCH_SOURCE_TYPE_DATA_ADD, 0, 0, dispatch_get_main_queue()); + dispatch_source_set_event_handler(_displayLinkSource, ^() { + @autoreleasepool { + callback(); + } + }); + dispatch_resume(_displayLinkSource); + if (CVDisplayLinkCreateWithActiveCGDisplays(&_displayLink) == kCVReturnSuccess) { + CVDisplayLinkSetOutputCallback(_displayLink, &DisplayLinkCallback, + (__bridge void *)(_displayLinkSource)); + } + } + return self; +} + +- (void)dealloc { + CVDisplayLinkStop(_displayLink); + CVDisplayLinkRelease(_displayLink); + _displayLink = NULL; + + dispatch_source_cancel(_displayLinkSource); +} + +- (BOOL)running { + return CVDisplayLinkIsRunning(self.displayLink); +} + +- (void)setRunning:(BOOL)running { + if (self.running == running) { + return; + } + if (running) { + // TODO(stuartmorgan): Move this to init + a screen change listener; this won't correctly + // handle windows being dragged to another screen until the next pause/play cycle. That will + // likely require new plugin registrar APIs. + NSScreen *screen = self.registrar.view.window.screen; + if (screen) { + CGDirectDisplayID viewDisplayID = + (CGDirectDisplayID)[screen.deviceDescription[@"NSScreenNumber"] unsignedIntegerValue]; + CVDisplayLinkSetCurrentCGDisplay(self.displayLink, viewDisplayID); + } + CVDisplayLinkStart(self.displayLink); + } else { + CVDisplayLinkStop(self.displayLink); + } +} + +@end diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/.gitkeep b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/FVPEmpty.h b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/FVPEmpty.h new file mode 100644 index 000000000000..c7b344f7299d --- /dev/null +++ b/packages/video_player/video_player_avfoundation/darwin/video_player_avfoundation/Sources/video_player_avfoundation_macos/include/FVPEmpty.h @@ -0,0 +1,6 @@ +// Copyright 2013 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Empty file to perserve include directory in pub-cache. See +// https://github.com/flutter/flutter/issues/148002 for more information. diff --git a/packages/video_player/video_player_avfoundation/example/ios/Podfile b/packages/video_player/video_player_avfoundation/example/ios/Podfile index 3278285d9d7a..c9339a034ebe 100644 --- a/packages/video_player/video_player_avfoundation/example/ios/Podfile +++ b/packages/video_player/video_player_avfoundation/example/ios/Podfile @@ -31,7 +31,6 @@ target 'Runner' do flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) target 'RunnerTests' do inherit! :search_paths - pod 'OCMock', '3.9.1' end end diff --git a/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj index feb1ba462cc6..0f6dd7a79dae 100644 --- a/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj +++ b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; + 78CF8D742BC5CEA80051231B /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 78CF8D732BC5CEA80051231B /* OCMock */; }; 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -99,6 +100,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78CF8D742BC5CEA80051231B /* OCMock in Frameworks */, D182ECB59C06DBC7E2D5D913 /* libPods-RunnerTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -260,6 +262,9 @@ F7151F4026603ECA0028CB91 /* PBXTargetDependency */, ); name = RunnerTests; + packageProductDependencies = ( + 78CF8D732BC5CEA80051231B /* OCMock */, + ); productName = RunnerTests; productReference = F7151F3A26603ECA0028CB91 /* RunnerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -297,6 +302,9 @@ Base, ); mainGroup = 97C146E51CF9000F007C117D; + packageReferences = ( + 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */, + ); productRefGroup = 97C146EF1CF9000F007C117D /* Products */; projectDirPath = ""; projectRoot = ""; @@ -758,6 +766,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/erikdoe/ocmock"; + requirement = { + kind = revision; + revision = ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78CF8D732BC5CEA80051231B /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = 78CF8D722BC5CEA80051231B /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; } diff --git a/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000000..69f8d7acc40b --- /dev/null +++ b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,13 @@ +{ + "pins" : [ + { + "identity" : "ocmock", + "kind" : "remoteSourceControl", + "location" : "https://github.com/erikdoe/ocmock", + "state" : { + "revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a" + } + } + ], + "version" : 2 +} diff --git a/packages/video_player/video_player_avfoundation/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000000..69f8d7acc40b --- /dev/null +++ b/packages/video_player/video_player_avfoundation/example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,13 @@ +{ + "pins" : [ + { + "identity" : "ocmock", + "kind" : "remoteSourceControl", + "location" : "https://github.com/erikdoe/ocmock", + "state" : { + "revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a" + } + } + ], + "version" : 2 +} diff --git a/packages/video_player/video_player_avfoundation/example/macos/Podfile b/packages/video_player/video_player_avfoundation/example/macos/Podfile index c0f5d7877b98..c795730db8ed 100644 --- a/packages/video_player/video_player_avfoundation/example/macos/Podfile +++ b/packages/video_player/video_player_avfoundation/example/macos/Podfile @@ -33,7 +33,6 @@ target 'Runner' do flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) target 'RunnerTests' do inherit! :search_paths - pod 'OCMock', '3.9.1' end end diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj index 5159838815f7..dc593db1307d 100644 --- a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.pbxproj @@ -28,6 +28,7 @@ 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; + 78CF8D772BC5D0140051231B /* OCMock in Frameworks */ = {isa = PBXBuildFile; productRef = 78CF8D762BC5D0140051231B /* OCMock */; }; C000184E56E3386C22EF683A /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC60543320154AF9A465D416 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -95,6 +96,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 78CF8D772BC5D0140051231B /* OCMock in Frameworks */, 18AD5E2A5B24DAFCF3749529 /* Pods_RunnerTests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -226,6 +228,9 @@ 331C80DA294CF71000263BE5 /* PBXTargetDependency */, ); name = RunnerTests; + packageProductDependencies = ( + 78CF8D762BC5D0140051231B /* OCMock */, + ); productName = RunnerTests; productReference = 331C80D5294CF71000263BE5 /* RunnerTests.xctest */; productType = "com.apple.product-type.bundle.unit-test"; @@ -292,6 +297,9 @@ Base, ); mainGroup = 33CC10E42044A3C60003C045; + packageReferences = ( + 78CF8D752BC5D0140051231B /* XCRemoteSwiftPackageReference "ocmock" */, + ); productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; projectDirPath = ""; projectRoot = ""; @@ -808,6 +816,25 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 78CF8D752BC5D0140051231B /* XCRemoteSwiftPackageReference "ocmock" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/erikdoe/ocmock"; + requirement = { + kind = revision; + revision = ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 78CF8D762BC5D0140051231B /* OCMock */ = { + isa = XCSwiftPackageProductDependency; + package = 78CF8D752BC5D0140051231B /* XCRemoteSwiftPackageReference "ocmock" */; + productName = OCMock; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = 33CC10E52044A3C60003C045 /* Project object */; } diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000000..69f8d7acc40b --- /dev/null +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,13 @@ +{ + "pins" : [ + { + "identity" : "ocmock", + "kind" : "remoteSourceControl", + "location" : "https://github.com/erikdoe/ocmock", + "state" : { + "revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a" + } + } + ], + "version" : 2 +} diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 000000000000..69f8d7acc40b --- /dev/null +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,13 @@ +{ + "pins" : [ + { + "identity" : "ocmock", + "kind" : "remoteSourceControl", + "location" : "https://github.com/erikdoe/ocmock", + "state" : { + "revision" : "ef21a2ece3ee092f8ed175417718bdd9b8eb7c9a" + } + } + ], + "version" : 2 +} diff --git a/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift b/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift index 5cec4c48f620..689c0ecd5254 100644 --- a/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift +++ b/packages/video_player/video_player_avfoundation/example/macos/Runner/AppDelegate.swift @@ -5,7 +5,7 @@ import Cocoa import FlutterMacOS -@NSApplicationMain +@main class AppDelegate: FlutterAppDelegate { override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { return true diff --git a/packages/video_player/video_player_avfoundation/pigeons/messages.dart b/packages/video_player/video_player_avfoundation/pigeons/messages.dart index 1f9795360c30..8dbda80bd550 100644 --- a/packages/video_player/video_player_avfoundation/pigeons/messages.dart +++ b/packages/video_player/video_player_avfoundation/pigeons/messages.dart @@ -7,10 +7,13 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon(PigeonOptions( dartOut: 'lib/src/messages.g.dart', dartTestOut: 'test/test_api.g.dart', - objcHeaderOut: 'darwin/Classes/messages.g.h', - objcSourceOut: 'darwin/Classes/messages.g.m', + objcHeaderOut: + 'darwin/video_player_avfoundation/Sources/video_player_avfoundation/include/video_player_avfoundation/messages.g.h', + objcSourceOut: + 'darwin/video_player_avfoundation/Sources/video_player_avfoundation/messages.g.m', objcOptions: ObjcOptions( prefix: 'FVP', + headerIncludePath: './include/video_player_avfoundation/messages.g.h', ), copyrightHeader: 'pigeons/copyright.txt', )) diff --git a/packages/video_player/video_player_avfoundation/pubspec.yaml b/packages/video_player/video_player_avfoundation/pubspec.yaml index 121d3a7a1aa0..674684ee789d 100644 --- a/packages/video_player/video_player_avfoundation/pubspec.yaml +++ b/packages/video_player/video_player_avfoundation/pubspec.yaml @@ -2,7 +2,7 @@ name: video_player_avfoundation description: iOS and macOS implementation of the video_player plugin. repository: https://github.com/flutter/packages/tree/main/packages/video_player/video_player_avfoundation issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+video_player%22 -version: 2.5.7 +version: 2.6.1 environment: sdk: ^3.2.3 From 8575e6470919c56923a2a95005ed9144979274af Mon Sep 17 00:00:00 2001 From: camsim99 Date: Wed, 8 May 2024 18:55:40 -0400 Subject: [PATCH 10/15] Add video recording integration test --- .../example/integration_test/camera_test.dart | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index 1985d1793c66..c3ecca9ab530 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -145,6 +145,40 @@ void main() { skip: true, ); + testWidgets('Video capture records valid video', (WidgetTester tester) async { + final List cameras = await availableCameras(); + if (cameras.isEmpty) { + return; + } + + final CameraController controller = CameraController( + cameras[0], + ResolutionPreset.low, + enableAudio: false, + ); + await controller.initialize(); + await controller.prepareForVideoRecording(); + + await controller.startVideoRecording(); + final int recordingStart = DateTime.now().millisecondsSinceEpoch; + + sleep(const Duration(seconds: 2)); + + final XFile file = await controller.stopVideoRecording(); + final int recordingTime = + DateTime.now().millisecondsSinceEpoch - recordingStart; + + final File videoFile = File(file.path); + final VideoPlayerController videoController = VideoPlayerController.file( + videoFile, + ); + await videoController.initialize(); + final int duration = videoController.value.duration.inMilliseconds; + await videoController.dispose(); + + expect(duration, lessThan(recordingTime)); + }); + testWidgets('Pause and resume video recording', (WidgetTester tester) async { final List cameras = await availableCameras(); if (cameras.isEmpty) { From a5182be7a9f76ac75b4d70b1073691266d6d6f3c Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 9 May 2024 18:58:15 -0400 Subject: [PATCH 11/15] Prep for landing -- undo test fixes --- packages/camera/camera/pubspec.yaml | 3 +- .../camerax/GeneratedCameraXLibrary.java | 1250 +++++++++++------ .../PendingRecordingFlutterApiImpl.java | 4 - .../camerax/PendingRecordingHostApiImpl.java | 4 - .../camerax/SystemServicesHostApiImpl.java | 2 +- .../lib/src/android_camera_camerax.dart | 34 +- .../lib/src/camerax_library.g.dart | 498 ++++--- .../lib/src/pending_recording.dart | 11 - .../pigeons/camerax_library.dart | 2 - .../camera_android_camerax/pubspec.yaml | 2 +- .../test/test_camerax_library.g.dart | 1075 +++++++++----- 11 files changed, 1849 insertions(+), 1036 deletions(-) diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index 8ae48d25997a..c1afbd03d73b 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -21,8 +21,7 @@ flutter: default_package: camera_web dependencies: - camera_android_camerax: #^0.6.4+1 - path: ../camera_android_camerax/ + camera_android_camerax: 0.6.5 camera_avfoundation: ^0.9.15 camera_platform_interface: ^2.6.0 camera_web: ^0.3.3 diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java index 84eb0adf2d08..41094fd858aa 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/GeneratedCameraXLibrary.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; import java.util.List; import java.util.Map; @@ -35,8 +34,7 @@ public static class FlutterError extends RuntimeException { /** The error details. Must be a datatype supported by the api codec. */ public final Object details; - public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) - { + public FlutterError(@NonNull String code, @Nullable String message, @Nullable Object details) { super(message); this.code = code; this.details = details; @@ -55,7 +53,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { errorList.add(exception.toString()); errorList.add(exception.getClass().getSimpleName()); errorList.add( - "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); + "Cause: " + exception.getCause() + ", Stacktrace: " + Log.getStackTraceString(exception)); } return errorList; } @@ -63,7 +61,7 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /** * The states the camera can be in. * - * See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. + *

See https://developer.android.com/reference/androidx/camera/core/CameraState.Type. */ public enum CameraStateType { CLOSED(0), @@ -82,20 +80,19 @@ private CameraStateType(final int index) { /** * The types (T) properly wrapped to be used as a LiveData. * - * If you need to add another type to support a type S to use a LiveData in - * this plugin, ensure the following is done on the Dart side: + *

If you need to add another type to support a type S to use a LiveData in this plugin, + * ensure the following is done on the Dart side: * - * * In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in - * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of - * type S from a LiveData instance and in `LiveDataFlutterApiImpl#create` - * to create the expected type of LiveData when requested. + *

* In `camera_android_camerax/lib/src/live_data.dart`, add new cases for S in + * `_LiveDataHostApiImpl#getValueFromInstances` to get the current value of type S from a + * LiveData instance and in `LiveDataFlutterApiImpl#create` to create the expected type of + * LiveData when requested. * - * On the native side, ensure the following is done: + *

On the native side, ensure the following is done: * - * * Make sure `LiveDataHostApiImpl#getValue` is updated to properly return - * identifiers for instances of type S. - * * Update `ObserverFlutterApiWrapper#onChanged` to properly handle receiving - * calls with instances of type S if a LiveData instance is observed. + *

* Make sure `LiveDataHostApiImpl#getValue` is updated to properly return identifiers for + * instances of type S. * Update `ObserverFlutterApiWrapper#onChanged` to properly handle + * receiving calls with instances of type S if a LiveData instance is observed. */ public enum LiveDataSupportedType { CAMERA_STATE(0), @@ -109,12 +106,12 @@ private LiveDataSupportedType(final int index) { } /** - * Video quality constraints that will be used by a QualitySelector to choose - * an appropriate video resolution. + * Video quality constraints that will be used by a QualitySelector to choose an appropriate video + * resolution. * - * These are pre-defined quality constants that are universally used for video. + *

These are pre-defined quality constants that are universally used for video. * - * See https://developer.android.com/reference/androidx/camera/video/Quality. + *

See https://developer.android.com/reference/androidx/camera/video/Quality. */ public enum VideoQuality { SD(0), @@ -134,7 +131,7 @@ private VideoQuality(final int index) { /** * Fallback rules for selecting video resolution. * - * See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. + *

See https://developer.android.com/reference/androidx/camera/video/FallbackStrategy. */ public enum VideoResolutionFallbackRule { HIGHER_QUALITY_OR_LOWER_THAN(0), @@ -152,22 +149,20 @@ private VideoResolutionFallbackRule(final int index) { /** * The types of capture request options this plugin currently supports. * - * If you need to add another option to support, ensure the following is done - * on the Dart side: + *

If you need to add another option to support, ensure the following is done on the Dart side: * - * * In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this - * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` - * to create the expected Map entry of option key index and value to send to - * the native side. + *

* In `camera_android_camerax/lib/src/capture_request_options.dart`, add new cases for this + * option in `_CaptureRequestOptionsHostApiImpl#createFromInstances` to create the expected Map + * entry of option key index and value to send to the native side. * - * On the native side, ensure the following is done: + *

On the native side, ensure the following is done: * - * * Update `CaptureRequestOptionsHostApiImpl#create` to set the correct - * `CaptureRequest` key with a valid value type for this option. + *

* Update `CaptureRequestOptionsHostApiImpl#create` to set the correct `CaptureRequest` key + * with a valid value type for this option. * - * See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest - * for the sorts of capture request options that can be supported via CameraX's - * interoperability with Camera2. + *

See https://developer.android.com/reference/android/hardware/camera2/CaptureRequest for the + * sorts of capture request options that can be supported via CameraX's interoperability with + * Camera2. */ public enum CaptureRequestKeySupportedType { CONTROL_AE_LOCK(0); @@ -245,9 +240,13 @@ ArrayList toList() { static @NonNull ResolutionInfo fromList(@NonNull ArrayList list) { ResolutionInfo pigeonResult = new ResolutionInfo(); Object width = list.get(0); - pigeonResult.setWidth((width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); + pigeonResult.setWidth( + (width == null) ? null : ((width instanceof Integer) ? (Integer) width : (Long) width)); Object height = list.get(1); - pigeonResult.setHeight((height == null) ? null : ((height instanceof Integer) ? (Integer) height : (Long) height)); + pigeonResult.setHeight( + (height == null) + ? null + : ((height instanceof Integer) ? (Integer) height : (Long) height)); return pigeonResult; } } @@ -489,9 +488,19 @@ ArrayList toList() { static @NonNull ExposureCompensationRange fromList(@NonNull ArrayList list) { ExposureCompensationRange pigeonResult = new ExposureCompensationRange(); Object minCompensation = list.get(0); - pigeonResult.setMinCompensation((minCompensation == null) ? null : ((minCompensation instanceof Integer) ? (Integer) minCompensation : (Long) minCompensation)); + pigeonResult.setMinCompensation( + (minCompensation == null) + ? null + : ((minCompensation instanceof Integer) + ? (Integer) minCompensation + : (Long) minCompensation)); Object maxCompensation = list.get(1); - pigeonResult.setMaxCompensation((maxCompensation == null) ? null : ((maxCompensation instanceof Integer) ? (Integer) maxCompensation : (Long) maxCompensation)); + pigeonResult.setMaxCompensation( + (maxCompensation == null) + ? null + : ((maxCompensation instanceof Integer) + ? (Integer) maxCompensation + : (Long) maxCompensation)); return pigeonResult; } } @@ -499,7 +508,7 @@ ArrayList toList() { /** * Convenience class for sending lists of [Quality]s. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class VideoQualityData { private @NonNull VideoQuality quality; @@ -550,10 +559,9 @@ ArrayList toList() { } /** - * Convenience class for building [FocusMeteringAction]s with multiple metering - * points. + * Convenience class for building [FocusMeteringAction]s with multiple metering points. * - * Generated class from Pigeon that represents data sent in messages. + *

Generated class from Pigeon that represents data sent in messages. */ public static final class MeteringPointInfo { /** InstanceManager ID for a [MeteringPoint]. */ @@ -573,7 +581,7 @@ public void setMeteringPointId(@NonNull Long setterArg) { /** * The metering mode of the [MeteringPoint] whose ID is [meteringPointId]. * - * Metering mode should be one of the [FocusMeteringAction] constants. + *

Metering mode should be one of the [FocusMeteringAction] constants. */ private @Nullable Long meteringMode; @@ -623,9 +631,17 @@ ArrayList toList() { static @NonNull MeteringPointInfo fromList(@NonNull ArrayList list) { MeteringPointInfo pigeonResult = new MeteringPointInfo(); Object meteringPointId = list.get(0); - pigeonResult.setMeteringPointId((meteringPointId == null) ? null : ((meteringPointId instanceof Integer) ? (Integer) meteringPointId : (Long) meteringPointId)); + pigeonResult.setMeteringPointId( + (meteringPointId == null) + ? null + : ((meteringPointId instanceof Integer) + ? (Integer) meteringPointId + : (Long) meteringPointId)); Object meteringMode = list.get(1); - pigeonResult.setMeteringMode((meteringMode == null) ? null : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); + pigeonResult.setMeteringMode( + (meteringMode == null) + ? null + : ((meteringMode instanceof Integer) ? (Integer) meteringMode : (Long) meteringMode)); return pigeonResult; } } @@ -641,7 +657,7 @@ public interface InstanceManagerHostApi { /** * Clear the native `InstanceManager`. * - * This is typically only used after a hot restart. + *

This is typically only used after a hot restart. */ void clear(); @@ -649,8 +665,12 @@ public interface InstanceManagerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `InstanceManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { + /** + * Sets up an instance of `InstanceManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable InstanceManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -662,8 +682,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable InstanceMa try { api.clear(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -684,7 +703,9 @@ public interface JavaObjectHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `JavaObjectHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObjectHostApi api) { { BasicMessageChannel channel = @@ -699,8 +720,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable JavaObject try { api.dispose((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -720,7 +740,7 @@ public JavaObjectFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -729,6 +749,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -741,28 +762,32 @@ public void dispose(@NonNull Long identifierArg, @NonNull Reply callback) /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraInfoHostApi { - @NonNull + @NonNull Long getSensorRotationDegrees(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraState(@NonNull Long identifier); - @NonNull + @NonNull Long getExposureState(@NonNull Long identifier); - @NonNull + @NonNull Long getZoomState(@NonNull Long identifier); /** The codec used by CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `CameraInfoHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -770,10 +795,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getSensorRotationDegrees((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getSensorRotationDegrees( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -794,10 +820,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -810,7 +837,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraInfoHostApi.getExposureState", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -818,10 +847,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getExposureState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getExposureState( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -842,10 +872,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraInfo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getZoomState((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -865,7 +895,7 @@ public CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -874,6 +904,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -888,15 +919,19 @@ public interface CameraSelectorHostApi { void create(@NonNull Long identifier, @Nullable Long lensFacing); - @NonNull + @NonNull List filter(@NonNull Long identifier, @NonNull List cameraInfoIds); /** The codec used by CameraSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { + /** + * Sets up an instance of `CameraSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -909,10 +944,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); Number lensFacingArg = (Number) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (lensFacingArg == null) ? null : lensFacingArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (lensFacingArg == null) ? null : lensFacingArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -934,10 +970,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraSele Number identifierArg = (Number) args.get(0); List cameraInfoIdsArg = (List) args.get(1); try { - List output = api.filter((identifierArg == null) ? null : identifierArg.longValue(), cameraInfoIdsArg); + List output = + api.filter( + (identifierArg == null) ? null : identifierArg.longValue(), + cameraInfoIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -957,7 +995,7 @@ public CameraSelectorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -966,7 +1004,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @Nullable Long lensFacingArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraSelectorFlutterApi.create", getCodec()); @@ -980,13 +1020,16 @@ public interface ProcessCameraProviderHostApi { void getInstance(@NonNull Result result); - @NonNull + @NonNull List getAvailableCameraInfos(@NonNull Long identifier); - @NonNull - Long bindToLifecycle(@NonNull Long identifier, @NonNull Long cameraSelectorIdentifier, @NonNull List useCaseIds); + @NonNull + Long bindToLifecycle( + @NonNull Long identifier, + @NonNull Long cameraSelectorIdentifier, + @NonNull List useCaseIds); - @NonNull + @NonNull Boolean isBound(@NonNull Long identifier, @NonNull Long useCaseIdentifier); void unbind(@NonNull Long identifier, @NonNull List useCaseIds); @@ -997,12 +1040,18 @@ public interface ProcessCameraProviderHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { + /** + * Sets up an instance of `ProcessCameraProviderHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ProcessCameraProviderHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1029,7 +1078,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1037,10 +1088,11 @@ public void error(Throwable error) { ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getAvailableCameraInfos((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getAvailableCameraInfos( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1053,7 +1105,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1063,10 +1117,15 @@ public void error(Throwable error) { Number cameraSelectorIdentifierArg = (Number) args.get(1); List useCaseIdsArg = (List) args.get(2); try { - Long output = api.bindToLifecycle((identifierArg == null) ? null : identifierArg.longValue(), (cameraSelectorIdentifierArg == null) ? null : cameraSelectorIdentifierArg.longValue(), useCaseIdsArg); + Long output = + api.bindToLifecycle( + (identifierArg == null) ? null : identifierArg.longValue(), + (cameraSelectorIdentifierArg == null) + ? null + : cameraSelectorIdentifierArg.longValue(), + useCaseIdsArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1079,7 +1138,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1088,10 +1149,12 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number useCaseIdentifierArg = (Number) args.get(1); try { - Boolean output = api.isBound((identifierArg == null) ? null : identifierArg.longValue(), (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); + Boolean output = + api.isBound( + (identifierArg == null) ? null : identifierArg.longValue(), + (useCaseIdentifierArg == null) ? null : useCaseIdentifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1104,7 +1167,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1113,10 +1178,10 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); List useCaseIdsArg = (List) args.get(1); try { - api.unbind((identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); + api.unbind( + (identifierArg == null) ? null : identifierArg.longValue(), useCaseIdsArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1129,7 +1194,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1139,8 +1206,7 @@ public void error(Throwable error) { try { api.unbindAll((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1160,7 +1226,7 @@ public ProcessCameraProviderFlutterApi(@NonNull BinaryMessenger argBinaryMesseng this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1169,10 +1235,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -1181,17 +1250,17 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraHostApi { - @NonNull + @NonNull Long getCameraInfo(@NonNull Long identifier); - @NonNull + @NonNull Long getCameraControl(@NonNull Long identifier); /** The codec used by CameraHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `CameraHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHostApi api) { { BasicMessageChannel channel = @@ -1204,10 +1273,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraInfo((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1228,10 +1297,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraHost ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getCameraControl((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getCameraControl( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1251,7 +1321,7 @@ public CameraFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1260,6 +1330,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1299,21 +1370,28 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface SystemServicesHostApi { - void requestCameraPermissions(@NonNull Boolean enableAudio, @NonNull Result result); + void requestCameraPermissions( + @NonNull Boolean enableAudio, @NonNull Result result); - @NonNull + @NonNull String getTempFilePath(@NonNull String prefix, @NonNull String suffix); /** The codec used by SystemServicesHostApi. */ static @NonNull MessageCodec getCodec() { return SystemServicesHostApiCodec.INSTANCE; } - /**Sets up an instance of `SystemServicesHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { + /** + * Sets up an instance of `SystemServicesHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable SystemServicesHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1342,7 +1420,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1353,8 +1433,7 @@ public void error(Throwable error) { try { String output = api.getTempFilePath(prefixArg, suffixArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1374,7 +1453,7 @@ public SystemServicesFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1383,10 +1462,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError", + getCodec()); channel.send( new ArrayList(Collections.singletonList(errorDescriptionArg)), channelReply -> callback.reply(null)); @@ -1395,23 +1477,30 @@ public void onCameraError(@NonNull String errorDescriptionArg, @NonNull Reply getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { + /** + * Sets up an instance of `DeviceOrientationManagerHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrientationManagerHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1420,10 +1509,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie Boolean isFrontFacingArg = (Boolean) args.get(0); Number sensorOrientationArg = (Number) args.get(1); try { - api.startListeningForDeviceOrientationChange(isFrontFacingArg, (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); + api.startListeningForDeviceOrientationChange( + isFrontFacingArg, + (sensorOrientationArg == null) ? null : sensorOrientationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1436,7 +1526,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1444,8 +1536,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { api.stopListeningForDeviceOrientationChange(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1458,7 +1549,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1466,8 +1559,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable DeviceOrie try { Long output = api.getDefaultDisplayRotation(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1487,7 +1579,7 @@ public DeviceOrientationManagerFlutterApi(@NonNull BinaryMessenger argBinaryMess this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1496,10 +1588,14 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onDeviceOrientationChanged(@NonNull String orientationArg, @NonNull Reply callback) { + + public void onDeviceOrientationChanged( + @NonNull String orientationArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged", + getCodec()); channel.send( new ArrayList(Collections.singletonList(orientationArg)), channelReply -> callback.reply(null)); @@ -1535,14 +1631,15 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PreviewHostApi { - void create(@NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, @Nullable Long rotation, @Nullable Long resolutionSelectorId); - @NonNull + @NonNull Long setSurfaceProvider(@NonNull Long identifier); void releaseFlutterSurfaceTexture(); - @NonNull + @NonNull ResolutionInfo getResolutionInfo(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1551,7 +1648,7 @@ public interface PreviewHostApi { static @NonNull MessageCodec getCodec() { return PreviewHostApiCodec.INSTANCE; } - /**Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ + /** Sets up an instance of `PreviewHostApi` to handle messages through the `binaryMessenger`. */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHostApi api) { { BasicMessageChannel channel = @@ -1566,10 +1663,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number rotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1582,7 +1683,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1590,10 +1693,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.setSurfaceProvider((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.setSurfaceProvider( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1606,7 +1710,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1614,8 +1720,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos try { api.releaseFlutterSurfaceTexture(); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1636,10 +1741,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - ResolutionInfo output = api.getResolutionInfo((identifierArg == null) ? null : identifierArg.longValue()); + ResolutionInfo output = + api.getResolutionInfo( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1661,10 +1767,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1679,10 +1786,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PreviewHos /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface VideoCaptureHostApi { - @NonNull + @NonNull Long withOutput(@NonNull Long videoOutputId); - @NonNull + @NonNull Long getOutput(@NonNull Long identifier); void setTargetRotation(@NonNull Long identifier, @NonNull Long rotation); @@ -1691,7 +1798,10 @@ public interface VideoCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `VideoCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `VideoCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptureHostApi api) { { BasicMessageChannel channel = @@ -1704,10 +1814,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number videoOutputIdArg = (Number) args.get(0); try { - Long output = api.withOutput((videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); + Long output = + api.withOutput( + (videoOutputIdArg == null) ? null : videoOutputIdArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1728,10 +1839,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getOutput((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1744,7 +1855,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1753,10 +1866,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable VideoCaptu Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1776,7 +1890,7 @@ public VideoCaptureFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1785,6 +1899,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1797,22 +1912,28 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecorderHostApi { - void create(@NonNull Long identifier, @Nullable Long aspectRatio, @Nullable Long bitRate, @Nullable Long qualitySelectorId); + void create( + @NonNull Long identifier, + @Nullable Long aspectRatio, + @Nullable Long bitRate, + @Nullable Long qualitySelectorId); - @NonNull + @NonNull Long getAspectRatio(@NonNull Long identifier); - @NonNull + @NonNull Long getTargetVideoEncodingBitRate(@NonNull Long identifier); - @NonNull + @NonNull Long prepareRecording(@NonNull Long identifier, @NonNull String path); /** The codec used by RecorderHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecorderHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHostApi api) { { BasicMessageChannel channel = @@ -1828,10 +1949,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number bitRateArg = (Number) args.get(2); Number qualitySelectorIdArg = (Number) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), (bitRateArg == null) ? null : bitRateArg.longValue(), (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (aspectRatioArg == null) ? null : aspectRatioArg.longValue(), + (bitRateArg == null) ? null : bitRateArg.longValue(), + (qualitySelectorIdArg == null) ? null : qualitySelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1852,10 +1976,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getAspectRatio((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getAspectRatio( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1868,7 +1993,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -1876,10 +2003,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getTargetVideoEncodingBitRate((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getTargetVideoEncodingBitRate( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1901,10 +2029,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecorderHo Number identifierArg = (Number) args.get(0); String pathArg = (String) args.get(1); try { - Long output = api.prepareRecording((identifierArg == null) ? null : identifierArg.longValue(), pathArg); + Long output = + api.prepareRecording( + (identifierArg == null) ? null : identifierArg.longValue(), pathArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1924,7 +2053,7 @@ public RecorderFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1933,7 +2062,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @Nullable Long bitRateArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @Nullable Long aspectRatioArg, + @Nullable Long bitRateArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.RecorderFlutterApi.create", getCodec()); @@ -1945,15 +2079,19 @@ public void create(@NonNull Long identifierArg, @Nullable Long aspectRatioArg, @ /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface PendingRecordingHostApi { - @NonNull + @NonNull Long start(@NonNull Long identifier); /** The codec used by PendingRecordingHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `PendingRecordingHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { + /** + * Sets up an instance of `PendingRecordingHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable PendingRecordingHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -1965,10 +2103,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable PendingRec ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.start((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.start((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -1988,7 +2126,7 @@ public PendingRecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -1997,6 +2135,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2005,14 +2144,6 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - public void onVideoRecordingFinalized(@NonNull Reply callback) { - BasicMessageChannel channel = - new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.PendingRecordingFlutterApi.onVideoRecordingFinalized", getCodec()); - channel.send( - null, - channelReply -> callback.reply(null)); - } } /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface RecordingHostApi { @@ -2029,7 +2160,9 @@ public interface RecordingHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `RecordingHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingHostApi api) { { BasicMessageChannel channel = @@ -2044,8 +2177,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2068,8 +2200,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.pause((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2092,8 +2223,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.resume((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2116,8 +2246,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable RecordingH try { api.stop((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2137,7 +2266,7 @@ public RecordingFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2146,6 +2275,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2158,7 +2288,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageCaptureHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long flashMode, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long flashMode, + @Nullable Long resolutionSelectorId); void setFlashMode(@NonNull Long identifier, @NonNull Long flashMode); @@ -2170,7 +2304,10 @@ public interface ImageCaptureHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageCaptureHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageCaptureHostApi` to handle messages through the + * `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptureHostApi api) { { BasicMessageChannel channel = @@ -2186,10 +2323,15 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number flashModeArg = (Number) args.get(2); Number resolutionSelectorIdArg = (Number) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2211,10 +2353,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageCaptu Number identifierArg = (Number) args.get(0); Number flashModeArg = (Number) args.get(1); try { - api.setFlashMode((identifierArg == null) ? null : identifierArg.longValue(), (flashModeArg == null) ? null : flashModeArg.longValue()); + api.setFlashMode( + (identifierArg == null) ? null : identifierArg.longValue(), + (flashModeArg == null) ? null : flashModeArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2247,7 +2390,8 @@ public void error(Throwable error) { } }; - api.takePicture((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.takePicture( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -2256,7 +2400,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2265,10 +2411,11 @@ public void error(Throwable error) { Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2282,7 +2429,8 @@ public void error(Throwable error) { } private static class ResolutionStrategyHostApiCodec extends StandardMessageCodec { - public static final ResolutionStrategyHostApiCodec INSTANCE = new ResolutionStrategyHostApiCodec(); + public static final ResolutionStrategyHostApiCodec INSTANCE = + new ResolutionStrategyHostApiCodec(); private ResolutionStrategyHostApiCodec() {} @@ -2310,14 +2458,19 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionStrategyHostApi { - void create(@NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); + void create( + @NonNull Long identifier, @Nullable ResolutionInfo boundSize, @Nullable Long fallbackRule); /** The codec used by ResolutionStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionStrategyHostApiCodec.INSTANCE; } - /**Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { + /** + * Sets up an instance of `ResolutionStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2331,10 +2484,12 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution ResolutionInfo boundSizeArg = (ResolutionInfo) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), boundSizeArg, (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + boundSizeArg, + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2349,14 +2504,22 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionSelectorHostApi { - void create(@NonNull Long identifier, @Nullable Long resolutionStrategyIdentifier, @Nullable Long resolutionSelectorIdentifier, @Nullable Long aspectRatioStrategyIdentifier); + void create( + @NonNull Long identifier, + @Nullable Long resolutionStrategyIdentifier, + @Nullable Long resolutionSelectorIdentifier, + @Nullable Long aspectRatioStrategyIdentifier); /** The codec used by ResolutionSelectorHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { + /** + * Sets up an instance of `ResolutionSelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionSelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2371,10 +2534,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution Number resolutionSelectorIdentifierArg = (Number) args.get(2); Number aspectRatioStrategyIdentifierArg = (Number) args.get(3); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (resolutionStrategyIdentifierArg == null) ? null : resolutionStrategyIdentifierArg.longValue(), (resolutionSelectorIdentifierArg == null) ? null : resolutionSelectorIdentifierArg.longValue(), (aspectRatioStrategyIdentifierArg == null) ? null : aspectRatioStrategyIdentifierArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (resolutionStrategyIdentifierArg == null) + ? null + : resolutionStrategyIdentifierArg.longValue(), + (resolutionSelectorIdentifierArg == null) + ? null + : resolutionSelectorIdentifierArg.longValue(), + (aspectRatioStrategyIdentifierArg == null) + ? null + : aspectRatioStrategyIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2389,18 +2561,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface AspectRatioStrategyHostApi { - void create(@NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); + void create( + @NonNull Long identifier, @NonNull Long preferredAspectRatio, @NonNull Long fallbackRule); /** The codec used by AspectRatioStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { + /** + * Sets up an instance of `AspectRatioStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable AspectRatioStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.AspectRatioStrategyHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2410,10 +2589,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AspectRati Number preferredAspectRatioArg = (Number) args.get(1); Number fallbackRuleArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (preferredAspectRatioArg == null) ? null : preferredAspectRatioArg.longValue(), (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (preferredAspectRatioArg == null) + ? null + : preferredAspectRatioArg.longValue(), + (fallbackRuleArg == null) ? null : fallbackRuleArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2460,7 +2643,7 @@ public CameraStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2469,7 +2652,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return CameraStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull CameraStateTypeData typeArg, @Nullable Long errorIdentifierArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull CameraStateTypeData typeArg, + @Nullable Long errorIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateFlutterApi.create", getCodec()); @@ -2513,7 +2701,7 @@ public ExposureStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2522,12 +2710,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return ExposureStateFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull ExposureCompensationRange exposureCompensationRangeArg, @NonNull Double exposureCompensationStepArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull ExposureCompensationRange exposureCompensationRangeArg, + @NonNull Double exposureCompensationStepArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ExposureStateFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), + new ArrayList( + Arrays.asList( + identifierArg, exposureCompensationRangeArg, exposureCompensationStepArg)), channelReply -> callback.reply(null)); } } @@ -2539,7 +2734,7 @@ public ZoomStateFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2548,7 +2743,12 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, @NonNull Double maxZoomRatioArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Double minZoomRatioArg, + @NonNull Double maxZoomRatioArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ZoomStateFlutterApi.create", getCodec()); @@ -2560,7 +2760,10 @@ public void create(@NonNull Long identifierArg, @NonNull Double minZoomRatioArg, /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageAnalysisHostApi { - void create(@NonNull Long identifier, @Nullable Long targetRotation, @Nullable Long resolutionSelectorId); + void create( + @NonNull Long identifier, + @Nullable Long targetRotation, + @Nullable Long resolutionSelectorId); void setAnalyzer(@NonNull Long identifier, @NonNull Long analyzerIdentifier); @@ -2572,8 +2775,12 @@ public interface ImageAnalysisHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageAnalysisHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { + /** + * Sets up an instance of `ImageAnalysisHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnalysisHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2587,10 +2794,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number targetRotationArg = (Number) args.get(1); Number resolutionSelectorIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (targetRotationArg == null) ? null : targetRotationArg.longValue(), (resolutionSelectorIdArg == null) ? null : resolutionSelectorIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (targetRotationArg == null) ? null : targetRotationArg.longValue(), + (resolutionSelectorIdArg == null) + ? null + : resolutionSelectorIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2612,10 +2823,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number analyzerIdentifierArg = (Number) args.get(1); try { - api.setAnalyzer((identifierArg == null) ? null : identifierArg.longValue(), (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); + api.setAnalyzer( + (identifierArg == null) ? null : identifierArg.longValue(), + (analyzerIdentifierArg == null) ? null : analyzerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2628,7 +2840,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2638,8 +2852,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly try { api.clearAnalyzer((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2652,7 +2865,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -2661,10 +2876,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageAnaly Number identifierArg = (Number) args.get(0); Number rotationArg = (Number) args.get(1); try { - api.setTargetRotation((identifierArg == null) ? null : identifierArg.longValue(), (rotationArg == null) ? null : rotationArg.longValue()); + api.setTargetRotation( + (identifierArg == null) ? null : identifierArg.longValue(), + (rotationArg == null) ? null : rotationArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2685,7 +2901,9 @@ public interface AnalyzerHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `AnalyzerHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHostApi api) { { BasicMessageChannel channel = @@ -2700,8 +2918,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable AnalyzerHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2722,7 +2939,9 @@ public interface ObserverHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ObserverHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHostApi api) { { BasicMessageChannel channel = @@ -2737,8 +2956,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ObserverHo try { api.create((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2758,7 +2976,7 @@ public ObserverFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2767,7 +2985,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void onChanged(@NonNull Long identifierArg, @NonNull Long valueIdentifierArg, @NonNull Reply callback) { + + public void onChanged( + @NonNull Long identifierArg, + @NonNull Long valueIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ObserverFlutterApi.onChanged", getCodec()); @@ -2784,7 +3006,7 @@ public CameraStateErrorFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2793,7 +3015,9 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, @NonNull Long codeArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.CameraStateErrorFlutterApi.create", getCodec()); @@ -2836,14 +3060,16 @@ public interface LiveDataHostApi { void removeObservers(@NonNull Long identifier); - @Nullable + @Nullable Long getValue(@NonNull Long identifier, @NonNull LiveDataSupportedTypeData type); /** The codec used by LiveDataHostApi. */ static @NonNull MessageCodec getCodec() { return LiveDataHostApiCodec.INSTANCE; } - /**Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `LiveDataHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHostApi api) { { BasicMessageChannel channel = @@ -2857,10 +3083,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); Number observerIdentifierArg = (Number) args.get(1); try { - api.observe((identifierArg == null) ? null : identifierArg.longValue(), (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); + api.observe( + (identifierArg == null) ? null : identifierArg.longValue(), + (observerIdentifierArg == null) ? null : observerIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2883,8 +3110,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo try { api.removeObservers((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2906,10 +3132,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable LiveDataHo Number identifierArg = (Number) args.get(0); LiveDataSupportedTypeData typeArg = (LiveDataSupportedTypeData) args.get(1); try { - Long output = api.getValue((identifierArg == null) ? null : identifierArg.longValue(), typeArg); + Long output = + api.getValue( + (identifierArg == null) ? null : identifierArg.longValue(), typeArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -2956,7 +3183,7 @@ public LiveDataFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2965,7 +3192,11 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return LiveDataFlutterApiCodec.INSTANCE; } - public void create(@NonNull Long identifierArg, @NonNull LiveDataSupportedTypeData typeArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull LiveDataSupportedTypeData typeArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.LiveDataFlutterApi.create", getCodec()); @@ -2982,7 +3213,7 @@ public AnalyzerFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -2991,6 +3222,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -2999,7 +3231,11 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); } - public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentifierArg, @NonNull Reply callback) { + + public void analyze( + @NonNull Long identifierArg, + @NonNull Long imageProxyIdentifierArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.AnalyzerFlutterApi.analyze", getCodec()); @@ -3011,7 +3247,7 @@ public void analyze(@NonNull Long identifierArg, @NonNull Long imageProxyIdentif /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ImageProxyHostApi { - @NonNull + @NonNull List getPlanes(@NonNull Long identifier); void close(@NonNull Long identifier); @@ -3020,7 +3256,9 @@ public interface ImageProxyHostApi { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. */ + /** + * Sets up an instance of `ImageProxyHostApi` to handle messages through the `binaryMessenger`. + */ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxyHostApi api) { { BasicMessageChannel channel = @@ -3033,10 +3271,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - List output = api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); + List output = + api.getPlanes((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3059,8 +3297,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ImageProxy try { api.close((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3080,7 +3317,7 @@ public ImageProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3089,7 +3326,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull Long formatArg, @NonNull Long heightArg, @NonNull Long widthArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull Long formatArg, + @NonNull Long heightArg, + @NonNull Long widthArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.ImageProxyFlutterApi.create", getCodec()); @@ -3106,7 +3349,7 @@ public PlaneProxyFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3115,12 +3358,19 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - public void create(@NonNull Long identifierArg, @NonNull byte[] bufferArg, @NonNull Long pixelStrideArg, @NonNull Long rowStrideArg, @NonNull Reply callback) { + + public void create( + @NonNull Long identifierArg, + @NonNull byte[] bufferArg, + @NonNull Long pixelStrideArg, + @NonNull Long rowStrideArg, + @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( binaryMessenger, "dev.flutter.pigeon.PlaneProxyFlutterApi.create", getCodec()); channel.send( - new ArrayList(Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), + new ArrayList( + Arrays.asList(identifierArg, bufferArg, pixelStrideArg, rowStrideArg)), channelReply -> callback.reply(null)); } } @@ -3159,17 +3409,24 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface QualitySelectorHostApi { - void create(@NonNull Long identifier, @NonNull List videoQualityDataList, @Nullable Long fallbackStrategyId); + void create( + @NonNull Long identifier, + @NonNull List videoQualityDataList, + @Nullable Long fallbackStrategyId); - @NonNull + @NonNull ResolutionInfo getResolution(@NonNull Long cameraInfoId, @NonNull VideoQuality quality); /** The codec used by QualitySelectorHostApi. */ static @NonNull MessageCodec getCodec() { return QualitySelectorHostApiCodec.INSTANCE; } - /**Sets up an instance of `QualitySelectorHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { + /** + * Sets up an instance of `QualitySelectorHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable QualitySelectorHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3180,13 +3437,16 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List videoQualityDataListArg = (List) args.get(1); + List videoQualityDataListArg = + (List) args.get(1); Number fallbackStrategyIdArg = (Number) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), videoQualityDataListArg, (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + videoQualityDataListArg, + (fallbackStrategyIdArg == null) ? null : fallbackStrategyIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3199,19 +3459,24 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.QualitySelectorHostApi.getResolution", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number cameraInfoIdArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; try { - ResolutionInfo output = api.getResolution((cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), qualityArg); + ResolutionInfo output = + api.getResolution( + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue(), + qualityArg); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3226,14 +3491,21 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable QualitySel /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FallbackStrategyHostApi { - void create(@NonNull Long identifier, @NonNull VideoQuality quality, @NonNull VideoResolutionFallbackRule fallbackRule); + void create( + @NonNull Long identifier, + @NonNull VideoQuality quality, + @NonNull VideoResolutionFallbackRule fallbackRule); /** The codec used by FallbackStrategyHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FallbackStrategyHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { + /** + * Sets up an instance of `FallbackStrategyHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FallbackStrategyHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3244,13 +3516,19 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - VideoQuality qualityArg = args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; - VideoResolutionFallbackRule fallbackRuleArg = args.get(2) == null ? null : VideoResolutionFallbackRule.values()[(int) args.get(2)]; + VideoQuality qualityArg = + args.get(1) == null ? null : VideoQuality.values()[(int) args.get(1)]; + VideoResolutionFallbackRule fallbackRuleArg = + args.get(2) == null + ? null + : VideoResolutionFallbackRule.values()[(int) args.get(2)]; try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), qualityArg, fallbackRuleArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + qualityArg, + fallbackRuleArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3265,22 +3543,32 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FallbackSt /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface CameraControlHostApi { - void enableTorch(@NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); + void enableTorch( + @NonNull Long identifier, @NonNull Boolean torch, @NonNull Result result); - void setZoomRatio(@NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); + void setZoomRatio( + @NonNull Long identifier, @NonNull Double ratio, @NonNull Result result); - void startFocusAndMetering(@NonNull Long identifier, @NonNull Long focusMeteringActionId, @NonNull Result result); + void startFocusAndMetering( + @NonNull Long identifier, + @NonNull Long focusMeteringActionId, + @NonNull Result result); void cancelFocusAndMetering(@NonNull Long identifier, @NonNull Result result); - void setExposureCompensationIndex(@NonNull Long identifier, @NonNull Long index, @NonNull Result result); + void setExposureCompensationIndex( + @NonNull Long identifier, @NonNull Long index, @NonNull Result result); /** The codec used by CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `CameraControlHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { + /** + * Sets up an instance of `CameraControlHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3305,7 +3593,10 @@ public void error(Throwable error) { } }; - api.enableTorch((identifierArg == null) ? null : identifierArg.longValue(), torchArg, resultCallback); + api.enableTorch( + (identifierArg == null) ? null : identifierArg.longValue(), + torchArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3314,7 +3605,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setZoomRatio", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3335,7 +3628,10 @@ public void error(Throwable error) { } }; - api.setZoomRatio((identifierArg == null) ? null : identifierArg.longValue(), ratioArg, resultCallback); + api.setZoomRatio( + (identifierArg == null) ? null : identifierArg.longValue(), + ratioArg, + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3344,7 +3640,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3365,7 +3663,12 @@ public void error(Throwable error) { } }; - api.startFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), (focusMeteringActionIdArg == null) ? null : focusMeteringActionIdArg.longValue(), resultCallback); + api.startFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), + (focusMeteringActionIdArg == null) + ? null + : focusMeteringActionIdArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3374,7 +3677,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3394,7 +3699,8 @@ public void error(Throwable error) { } }; - api.cancelFocusAndMetering((identifierArg == null) ? null : identifierArg.longValue(), resultCallback); + api.cancelFocusAndMetering( + (identifierArg == null) ? null : identifierArg.longValue(), resultCallback); }); } else { channel.setMessageHandler(null); @@ -3403,7 +3709,9 @@ public void error(Throwable error) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3424,7 +3732,10 @@ public void error(Throwable error) { } }; - api.setExposureCompensationIndex((identifierArg == null) ? null : identifierArg.longValue(), (indexArg == null) ? null : indexArg.longValue(), resultCallback); + api.setExposureCompensationIndex( + (identifierArg == null) ? null : identifierArg.longValue(), + (indexArg == null) ? null : indexArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3440,7 +3751,7 @@ public CameraControlFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) { this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3449,6 +3760,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3460,7 +3772,8 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { } private static class FocusMeteringActionHostApiCodec extends StandardMessageCodec { - public static final FocusMeteringActionHostApiCodec INSTANCE = new FocusMeteringActionHostApiCodec(); + public static final FocusMeteringActionHostApiCodec INSTANCE = + new FocusMeteringActionHostApiCodec(); private FocusMeteringActionHostApiCodec() {} @@ -3488,31 +3801,43 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringActionHostApi { - void create(@NonNull Long identifier, @NonNull List meteringPointInfos, @Nullable Boolean disableAutoCancel); + void create( + @NonNull Long identifier, + @NonNull List meteringPointInfos, + @Nullable Boolean disableAutoCancel); /** The codec used by FocusMeteringActionHostApi. */ static @NonNull MessageCodec getCodec() { return FocusMeteringActionHostApiCodec.INSTANCE; } - /**Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { + /** + * Sets up an instance of `FocusMeteringActionHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringActionHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringActionHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringActionHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { ArrayList wrapped = new ArrayList(); ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); - List meteringPointInfosArg = (List) args.get(1); + List meteringPointInfosArg = + (List) args.get(1); Boolean disableAutoCancelArg = (Boolean) args.get(2); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), meteringPointInfosArg, disableAutoCancelArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + meteringPointInfosArg, + disableAutoCancelArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3527,19 +3852,25 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface FocusMeteringResultHostApi { - @NonNull + @NonNull Boolean isFocusSuccessful(@NonNull Long identifier); /** The codec used by FocusMeteringResultHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { + /** + * Sets up an instance of `FocusMeteringResultHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeteringResultHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3547,10 +3878,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable FocusMeter ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Boolean output = api.isFocusSuccessful((identifierArg == null) ? null : identifierArg.longValue()); + Boolean output = + api.isFocusSuccessful( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3570,7 +3902,7 @@ public FocusMeteringResultFlutterApi(@NonNull BinaryMessenger argBinaryMessenger this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3579,10 +3911,13 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.FocusMeteringResultFlutterApi.create", + getCodec()); channel.send( new ArrayList(Collections.singletonList(identifierArg)), channelReply -> callback.reply(null)); @@ -3591,17 +3926,26 @@ public void create(@NonNull Long identifierArg, @NonNull Reply callback) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface MeteringPointHostApi { - void create(@NonNull Long identifier, @NonNull Double x, @NonNull Double y, @Nullable Double size, @NonNull Long cameraInfoId); + void create( + @NonNull Long identifier, + @NonNull Double x, + @NonNull Double y, + @Nullable Double size, + @NonNull Long cameraInfoId); - @NonNull + @NonNull Double getDefaultPointSize(); /** The codec used by MeteringPointHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `MeteringPointHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { + /** + * Sets up an instance of `MeteringPointHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPointHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( @@ -3617,10 +3961,14 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo Double sizeArg = (Double) args.get(3); Number cameraInfoIdArg = (Number) args.get(4); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), xArg, yArg, sizeArg, (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + xArg, + yArg, + sizeArg, + (cameraInfoIdArg == null) ? null : cameraInfoIdArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3633,7 +3981,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3641,8 +3991,7 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo try { Double output = api.getDefaultPointSize(); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3656,7 +4005,8 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable MeteringPo } private static class CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { - public static final CaptureRequestOptionsHostApiCodec INSTANCE = new CaptureRequestOptionsHostApiCodec(); + public static final CaptureRequestOptionsHostApiCodec INSTANCE = + new CaptureRequestOptionsHostApiCodec(); private CaptureRequestOptionsHostApiCodec() {} @@ -3720,12 +4070,18 @@ public interface CaptureRequestOptionsHostApi { static @NonNull MessageCodec getCodec() { return CaptureRequestOptionsHostApiCodec.INSTANCE; } - /**Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { + /** + * Sets up an instance of `CaptureRequestOptionsHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable CaptureRequestOptionsHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.CaptureRequestOptionsHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3734,10 +4090,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable CaptureReq Number identifierArg = (Number) args.get(0); Map optionsArg = (Map) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), optionsArg); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), optionsArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3754,18 +4110,27 @@ public interface Camera2CameraControlHostApi { void create(@NonNull Long identifier, @NonNull Long cameraControlIdentifier); - void addCaptureRequestOptions(@NonNull Long identifier, @NonNull Long captureRequestOptionsIdentifier, @NonNull Result result); + void addCaptureRequestOptions( + @NonNull Long identifier, + @NonNull Long captureRequestOptionsIdentifier, + @NonNull Result result); /** The codec used by Camera2CameraControlHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { + /** + * Sets up an instance of `Camera2CameraControlHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraControlHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.create", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraControlHostApi.create", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3774,10 +4139,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam Number identifierArg = (Number) args.get(0); Number cameraControlIdentifierArg = (Number) args.get(1); try { - api.create((identifierArg == null) ? null : identifierArg.longValue(), (cameraControlIdentifierArg == null) ? null : cameraControlIdentifierArg.longValue()); + api.create( + (identifierArg == null) ? null : identifierArg.longValue(), + (cameraControlIdentifierArg == null) + ? null + : cameraControlIdentifierArg.longValue()); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3790,7 +4158,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3811,7 +4181,12 @@ public void error(Throwable error) { } }; - api.addCaptureRequestOptions((identifierArg == null) ? null : identifierArg.longValue(), (captureRequestOptionsIdentifierArg == null) ? null : captureRequestOptionsIdentifierArg.longValue(), resultCallback); + api.addCaptureRequestOptions( + (identifierArg == null) ? null : identifierArg.longValue(), + (captureRequestOptionsIdentifierArg == null) + ? null + : captureRequestOptionsIdentifierArg.longValue(), + resultCallback); }); } else { channel.setMessageHandler(null); @@ -3849,18 +4224,25 @@ protected void writeValue(@NonNull ByteArrayOutputStream stream, Object value) { /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface ResolutionFilterHostApi { - void createWithOnePreferredSize(@NonNull Long identifier, @NonNull ResolutionInfo preferredResolution); + void createWithOnePreferredSize( + @NonNull Long identifier, @NonNull ResolutionInfo preferredResolution); /** The codec used by ResolutionFilterHostApi. */ static @NonNull MessageCodec getCodec() { return ResolutionFilterHostApiCodec.INSTANCE; } - /**Sets up an instance of `ResolutionFilterHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionFilterHostApi api) { + /** + * Sets up an instance of `ResolutionFilterHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable ResolutionFilterHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3869,10 +4251,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution Number identifierArg = (Number) args.get(0); ResolutionInfo preferredResolutionArg = (ResolutionInfo) args.get(1); try { - api.createWithOnePreferredSize((identifierArg == null) ? null : identifierArg.longValue(), preferredResolutionArg); + api.createWithOnePreferredSize( + (identifierArg == null) ? null : identifierArg.longValue(), + preferredResolutionArg); wrapped.add(0, null); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3887,25 +4270,31 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Resolution /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ public interface Camera2CameraInfoHostApi { - @NonNull + @NonNull Long createFrom(@NonNull Long cameraInfoIdentifier); - @NonNull + @NonNull Long getSupportedHardwareLevel(@NonNull Long identifier); - @NonNull + @NonNull String getCameraId(@NonNull Long identifier); /** The codec used by Camera2CameraInfoHostApi. */ static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } - /**Sets up an instance of `Camera2CameraInfoHostApi` to handle messages through the `binaryMessenger`. */ - static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraInfoHostApi api) { + /** + * Sets up an instance of `Camera2CameraInfoHostApi` to handle messages through the + * `binaryMessenger`. + */ + static void setup( + @NonNull BinaryMessenger binaryMessenger, @Nullable Camera2CameraInfoHostApi api) { { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3913,10 +4302,13 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam ArrayList args = (ArrayList) message; Number cameraInfoIdentifierArg = (Number) args.get(0); try { - Long output = api.createFrom((cameraInfoIdentifierArg == null) ? null : cameraInfoIdentifierArg.longValue()); + Long output = + api.createFrom( + (cameraInfoIdentifierArg == null) + ? null + : cameraInfoIdentifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3929,7 +4321,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3937,10 +4331,11 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - Long output = api.getSupportedHardwareLevel((identifierArg == null) ? null : identifierArg.longValue()); + Long output = + api.getSupportedHardwareLevel( + (identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3953,7 +4348,9 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam { BasicMessageChannel channel = new BasicMessageChannel<>( - binaryMessenger, "dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId", getCodec()); + binaryMessenger, + "dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId", + getCodec()); if (api != null) { channel.setMessageHandler( (message, reply) -> { @@ -3961,10 +4358,10 @@ static void setup(@NonNull BinaryMessenger binaryMessenger, @Nullable Camera2Cam ArrayList args = (ArrayList) message; Number identifierArg = (Number) args.get(0); try { - String output = api.getCameraId((identifierArg == null) ? null : identifierArg.longValue()); + String output = + api.getCameraId((identifierArg == null) ? null : identifierArg.longValue()); wrapped.add(0, output); - } - catch (Throwable exception) { + } catch (Throwable exception) { ArrayList wrappedError = wrapError(exception); wrapped = wrappedError; } @@ -3984,7 +4381,7 @@ public Camera2CameraInfoFlutterApi(@NonNull BinaryMessenger argBinaryMessenger) this.binaryMessenger = argBinaryMessenger; } - /** Public interface for sending reply. */ + /** Public interface for sending reply. */ @SuppressWarnings("UnknownNullness") public interface Reply { void reply(T reply); @@ -3993,6 +4390,7 @@ public interface Reply { static @NonNull MessageCodec getCodec() { return new StandardMessageCodec(); } + public void create(@NonNull Long identifierArg, @NonNull Reply callback) { BasicMessageChannel channel = new BasicMessageChannel<>( diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java index c31c45b70074..9b4f71080562 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingFlutterApiImpl.java @@ -22,8 +22,4 @@ public PendingRecordingFlutterApiImpl( void create(@NonNull PendingRecording pendingRecording, @Nullable Reply reply) { create(instanceManager.addHostCreatedInstance(pendingRecording), reply); } - - void sendVideoRecordingFinalizedEvent(@NonNull Reply reply) { - super.onVideoRecordingFinalized(reply); - } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java index d634baec0591..a1d661d1d9c1 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/PendingRecordingHostApiImpl.java @@ -24,8 +24,6 @@ public class PendingRecordingHostApiImpl implements PendingRecordingHostApi { @VisibleForTesting @NonNull public CameraXProxy cameraXProxy = new CameraXProxy(); - PendingRecordingFlutterApiImpl pendingRecordingFlutterApi; - @VisibleForTesting SystemServicesFlutterApiImpl systemServicesFlutterApi; @VisibleForTesting RecordingFlutterApiImpl recordingFlutterApi; @@ -39,7 +37,6 @@ public PendingRecordingHostApiImpl( this.context = context; systemServicesFlutterApi = cameraXProxy.createSystemServicesFlutterApiImpl(binaryMessenger); recordingFlutterApi = new RecordingFlutterApiImpl(binaryMessenger, instanceManager); - pendingRecordingFlutterApi = new PendingRecordingFlutterApiImpl(binaryMessenger, instanceManager); } /** Sets the context, which is used to get the {@link Executor} needed to start the recording. */ @@ -91,7 +88,6 @@ public void handleVideoRecordEvent(@NonNull VideoRecordEvent event) { } systemServicesFlutterApi.sendCameraError(cameraErrorMessage, reply -> {}); } - pendingRecordingFlutterApi.sendVideoRecordingFinalizedEvent(reply -> {}); } } diff --git a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java index 1ddb23089d0e..d058d62fe224 100644 --- a/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java +++ b/packages/camera/camera_android_camerax/android/src/main/java/io/flutter/plugins/camerax/SystemServicesHostApiImpl.java @@ -94,7 +94,7 @@ public String getTempFilePath(@NonNull String prefix, @NonNull String suffix) { } try { - File path = File.createTempFile(prefix, suffix, new File ("/sdcard/Download/")); //context.getCacheDir()); + File path = File.createTempFile(prefix, suffix, context.getCacheDir()); return path.toString(); } catch (IOException | SecurityException e) { throw new GeneratedCameraXLibrary.FlutterError( diff --git a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index 5132801b3cfb..5ced7ccccb38 100644 --- a/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart +++ b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart @@ -122,11 +122,7 @@ class AndroidCameraCameraX extends CameraPlatform { /// The prefix used to create the filename for video recording files. @visibleForTesting - final String videoPrefix = 'REC'; - - /// la la la TODO - final StreamQueue lol = StreamQueue( - PendingRecording.videoRecordingFinalizedStreamController.stream); + final String videoPrefix = 'MOV'; /// The [ImageCapture] instance that can be configured to capture a still image. @visibleForTesting @@ -781,14 +777,6 @@ class AndroidCameraCameraX extends CameraPlatform { await _unbindUseCaseFromLifecycle(preview!); } - /// Sets the active camera while recording. - /// - /// Currently unsupported, so is a no-op. - @override - Future setDescriptionWhileRecording(CameraDescription description) { - return Future.value(); - } - /// Resume the paused preview for the selected camera. /// /// [cameraId] not used. @@ -967,7 +955,8 @@ class AndroidCameraCameraX extends CameraPlatform { .setTargetRotation(await proxy.getDefaultDisplayRotation()); } - videoOutputPath = await SystemServices.getTempFilePath(videoPrefix, '.mp4'); + videoOutputPath = + await SystemServices.getTempFilePath(videoPrefix, '.temp'); pendingRecording = await recorder!.prepareRecording(videoOutputPath!); recording = await pendingRecording!.start(); @@ -990,22 +979,21 @@ class AndroidCameraCameraX extends CameraPlatform { 'Attempting to stop a ' 'video recording while no recording is in progress.'); } - - // Stop the current active recording. - await recording!.close(); - await lol.next; - - recording = null; - pendingRecording = null; - if (videoOutputPath == null) { + // Stop the current active recording as we will be unable to complete it + // in this error case. + await recording!.close(); + recording = null; + pendingRecording = null; throw CameraException( 'INVALID_PATH', 'The platform did not return a path ' 'while reporting success. The platform should always ' 'return a valid path or report an error.'); } - + await recording!.close(); + recording = null; + pendingRecording = null; await _unbindUseCaseFromLifecycle(videoCapture!); return XFile(videoOutputPath!); } diff --git a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart index b7d1b64b52d8..550854fba3e1 100644 --- a/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/lib/src/camerax_library.g.dart @@ -281,8 +281,7 @@ class InstanceManagerHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -338,7 +337,8 @@ abstract class JavaObjectFlutterApi { void dispose(int identifier); - static void setup(JavaObjectFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(JavaObjectFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectFlutterApi.dispose', codec, @@ -348,7 +348,7 @@ abstract class JavaObjectFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectFlutterApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -485,7 +485,8 @@ abstract class CameraInfoFlutterApi { void create(int identifier); - static void setup(CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraInfoFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraInfoFlutterApi.create', codec, @@ -495,7 +496,7 @@ abstract class CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -522,8 +523,8 @@ class CameraSelectorHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_lensFacing]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_lensFacing]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -540,12 +541,13 @@ class CameraSelectorHostApi { } } - Future> filter(int arg_identifier, List arg_cameraInfoIds) async { + Future> filter( + int arg_identifier, List arg_cameraInfoIds) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraInfoIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_cameraInfoIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -573,7 +575,8 @@ abstract class CameraSelectorFlutterApi { void create(int identifier, int? lensFacing); - static void setup(CameraSelectorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraSelectorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorFlutterApi.create', codec, @@ -583,7 +586,7 @@ abstract class CameraSelectorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -611,8 +614,7 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -636,7 +638,8 @@ class ProcessCameraProviderHostApi { Future> getAvailableCameraInfos(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -661,12 +664,17 @@ class ProcessCameraProviderHostApi { } } - Future bindToLifecycle(int arg_identifier, int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { + Future bindToLifecycle(int arg_identifier, + int arg_cameraSelectorIdentifier, List arg_useCaseIds) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraSelectorIdentifier, arg_useCaseIds]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_cameraSelectorIdentifier, + arg_useCaseIds + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -693,7 +701,8 @@ class ProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_useCaseIdentifier]) as List?; + await channel.send([arg_identifier, arg_useCaseIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -719,8 +728,8 @@ class ProcessCameraProviderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_useCaseIds]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_useCaseIds]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -765,7 +774,8 @@ abstract class ProcessCameraProviderFlutterApi { void create(int identifier); - static void setup(ProcessCameraProviderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ProcessCameraProviderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create', codec, @@ -775,7 +785,7 @@ abstract class ProcessCameraProviderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -868,7 +878,7 @@ abstract class CameraFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -896,7 +906,7 @@ class _SystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -914,9 +924,11 @@ class SystemServicesHostApi { static const MessageCodec codec = _SystemServicesHostApiCodec(); - Future requestCameraPermissions(bool arg_enableAudio) async { + Future requestCameraPermissions( + bool arg_enableAudio) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_enableAudio]) as List?; @@ -969,7 +981,8 @@ abstract class SystemServicesFlutterApi { void onCameraError(String errorDescription); - static void setup(SystemServicesFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(SystemServicesFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError', codec, @@ -979,7 +992,7 @@ abstract class SystemServicesFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesFlutterApi.onCameraError was null.'); final List args = (message as List?)!; final String? arg_errorDescription = (args[0] as String?); assert(arg_errorDescription != null, @@ -1002,12 +1015,15 @@ class DeviceOrientationManagerHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future startListeningForDeviceOrientationChange(bool arg_isFrontFacing, int arg_sensorOrientation) async { + Future startListeningForDeviceOrientationChange( + bool arg_isFrontFacing, int arg_sensorOrientation) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_isFrontFacing, arg_sensorOrientation]) as List?; + await channel.send([arg_isFrontFacing, arg_sensorOrientation]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1026,10 +1042,10 @@ class DeviceOrientationManagerHostApi { Future stopListeningForDeviceOrientationChange() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1048,10 +1064,10 @@ class DeviceOrientationManagerHostApi { Future getDefaultDisplayRotation() async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1079,17 +1095,19 @@ abstract class DeviceOrientationManagerFlutterApi { void onDeviceOrientationChanged(String orientation); - static void setup(DeviceOrientationManagerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(DeviceOrientationManagerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged', + codec, binaryMessenger: binaryMessenger); if (api == null) { channel.setMessageHandler(null); } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerFlutterApi.onDeviceOrientationChanged was null.'); final List args = (message as List?)!; final String? arg_orientation = (args[0] as String?); assert(arg_orientation != null, @@ -1117,7 +1135,7 @@ class _PreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1135,12 +1153,14 @@ class PreviewHostApi { static const MessageCodec codec = _PreviewHostApiCodec(); - Future create(int arg_identifier, int? arg_rotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_rotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_rotation, arg_resolutionSelectorId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1188,8 +1208,7 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1237,8 +1256,8 @@ class PreviewHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1324,8 +1343,8 @@ class VideoCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1348,7 +1367,8 @@ abstract class VideoCaptureFlutterApi { void create(int identifier); - static void setup(VideoCaptureFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(VideoCaptureFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureFlutterApi.create', codec, @@ -1358,7 +1378,7 @@ abstract class VideoCaptureFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1381,12 +1401,17 @@ class RecorderHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_aspectRatio, int? arg_bitRate, int? arg_qualitySelectorId) async { + Future create(int arg_identifier, int? arg_aspectRatio, + int? arg_bitRate, int? arg_qualitySelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_aspectRatio, + arg_bitRate, + arg_qualitySelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1432,7 +1457,8 @@ class RecorderHostApi { Future getTargetVideoEncodingBitRate(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -1461,8 +1487,8 @@ class RecorderHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_path]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_path]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1490,7 +1516,8 @@ abstract class RecorderFlutterApi { void create(int identifier, int? aspectRatio, int? bitRate); - static void setup(RecorderFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecorderFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderFlutterApi.create', codec, @@ -1500,7 +1527,7 @@ abstract class RecorderFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1558,9 +1585,8 @@ abstract class PendingRecordingFlutterApi { void create(int identifier); - void onVideoRecordingFinalized(); - - static void setup(PendingRecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PendingRecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingFlutterApi.create', codec, @@ -1570,7 +1596,7 @@ abstract class PendingRecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1580,20 +1606,6 @@ abstract class PendingRecordingFlutterApi { }); } } - { - final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PendingRecordingFlutterApi.onVideoRecordingFinalized', codec, - binaryMessenger: binaryMessenger); - if (api == null) { - channel.setMessageHandler(null); - } else { - channel.setMessageHandler((Object? message) async { - // ignore message - api.onVideoRecordingFinalized(); - return; - }); - } - } } } @@ -1701,7 +1713,8 @@ abstract class RecordingFlutterApi { void create(int identifier); - static void setup(RecordingFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(RecordingFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingFlutterApi.create', codec, @@ -1711,7 +1724,7 @@ abstract class RecordingFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecordingFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1734,12 +1747,17 @@ class ImageCaptureHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_flashMode, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_flashMode, int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_flashMode, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1760,8 +1778,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_flashMode]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_flashMode]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1809,8 +1827,8 @@ class ImageCaptureHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1843,7 +1861,7 @@ class _ResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1861,12 +1879,14 @@ class ResolutionStrategyHostApi { static const MessageCodec codec = _ResolutionStrategyHostApiCodec(); - Future create(int arg_identifier, ResolutionInfo? arg_boundSize, int? arg_fallbackRule) async { + Future create(int arg_identifier, ResolutionInfo? arg_boundSize, + int? arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_boundSize, arg_fallbackRule]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_boundSize, arg_fallbackRule]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1894,12 +1914,20 @@ class ResolutionSelectorHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_resolutionStrategyIdentifier, int? arg_resolutionSelectorIdentifier, int? arg_aspectRatioStrategyIdentifier) async { + Future create( + int arg_identifier, + int? arg_resolutionStrategyIdentifier, + int? arg_resolutionSelectorIdentifier, + int? arg_aspectRatioStrategyIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_resolutionStrategyIdentifier, arg_resolutionSelectorIdentifier, arg_aspectRatioStrategyIdentifier]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_resolutionStrategyIdentifier, + arg_resolutionSelectorIdentifier, + arg_aspectRatioStrategyIdentifier + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1927,12 +1955,16 @@ class AspectRatioStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_preferredAspectRatio, int arg_fallbackRule) async { + Future create(int arg_identifier, int arg_preferredAspectRatio, + int arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_preferredAspectRatio, arg_fallbackRule]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_preferredAspectRatio, + arg_fallbackRule + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -1965,7 +1997,7 @@ class _CameraStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraStateTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1978,7 +2010,8 @@ abstract class CameraStateFlutterApi { void create(int identifier, CameraStateTypeData type, int? errorIdentifier); - static void setup(CameraStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateFlutterApi.create', codec, @@ -1988,12 +2021,13 @@ abstract class CameraStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null int.'); - final CameraStateTypeData? arg_type = (args[1] as CameraStateTypeData?); + final CameraStateTypeData? arg_type = + (args[1] as CameraStateTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.CameraStateFlutterApi.create was null, expected non-null CameraStateTypeData.'); final int? arg_errorIdentifier = (args[2] as int?); @@ -2020,7 +2054,7 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ExposureCompensationRange.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2031,9 +2065,13 @@ class _ExposureStateFlutterApiCodec extends StandardMessageCodec { abstract class ExposureStateFlutterApi { static const MessageCodec codec = _ExposureStateFlutterApiCodec(); - void create(int identifier, ExposureCompensationRange exposureCompensationRange, double exposureCompensationStep); + void create( + int identifier, + ExposureCompensationRange exposureCompensationRange, + double exposureCompensationStep); - static void setup(ExposureStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ExposureStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ExposureStateFlutterApi.create', codec, @@ -2043,18 +2081,20 @@ abstract class ExposureStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null int.'); - final ExposureCompensationRange? arg_exposureCompensationRange = (args[1] as ExposureCompensationRange?); + final ExposureCompensationRange? arg_exposureCompensationRange = + (args[1] as ExposureCompensationRange?); assert(arg_exposureCompensationRange != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null ExposureCompensationRange.'); final double? arg_exposureCompensationStep = (args[2] as double?); assert(arg_exposureCompensationStep != null, 'Argument for dev.flutter.pigeon.ExposureStateFlutterApi.create was null, expected non-null double.'); - api.create(arg_identifier!, arg_exposureCompensationRange!, arg_exposureCompensationStep!); + api.create(arg_identifier!, arg_exposureCompensationRange!, + arg_exposureCompensationStep!); return; }); } @@ -2067,7 +2107,8 @@ abstract class ZoomStateFlutterApi { void create(int identifier, double minZoomRatio, double maxZoomRatio); - static void setup(ZoomStateFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ZoomStateFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ZoomStateFlutterApi.create', codec, @@ -2077,7 +2118,7 @@ abstract class ZoomStateFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ZoomStateFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2106,12 +2147,16 @@ class ImageAnalysisHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int? arg_targetRotation, int? arg_resolutionSelectorId) async { + Future create(int arg_identifier, int? arg_targetRotation, + int? arg_resolutionSelectorId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_targetRotation, arg_resolutionSelectorId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_targetRotation, + arg_resolutionSelectorId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2128,12 +2173,14 @@ class ImageAnalysisHostApi { } } - Future setAnalyzer(int arg_identifier, int arg_analyzerIdentifier) async { + Future setAnalyzer( + int arg_identifier, int arg_analyzerIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_analyzerIdentifier]) as List?; + await channel.send([arg_identifier, arg_analyzerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2176,8 +2223,8 @@ class ImageAnalysisHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_rotation]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_rotation]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2266,7 +2313,8 @@ abstract class ObserverFlutterApi { void onChanged(int identifier, int valueIdentifier); - static void setup(ObserverFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ObserverFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverFlutterApi.onChanged', codec, @@ -2276,7 +2324,7 @@ abstract class ObserverFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); + 'Argument for dev.flutter.pigeon.ObserverFlutterApi.onChanged was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2297,7 +2345,8 @@ abstract class CameraStateErrorFlutterApi { void create(int identifier, int code); - static void setup(CameraStateErrorFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraStateErrorFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraStateErrorFlutterApi.create', codec, @@ -2307,7 +2356,7 @@ abstract class CameraStateErrorFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraStateErrorFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2338,7 +2387,7 @@ class _LiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2361,7 +2410,8 @@ class LiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_observerIdentifier]) as List?; + await channel.send([arg_identifier, arg_observerIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2400,12 +2450,13 @@ class LiveDataHostApi { } } - Future getValue(int arg_identifier, LiveDataSupportedTypeData arg_type) async { + Future getValue( + int arg_identifier, LiveDataSupportedTypeData arg_type) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_type]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_type]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2438,7 +2489,7 @@ class _LiveDataFlutterApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2451,7 +2502,8 @@ abstract class LiveDataFlutterApi { void create(int identifier, LiveDataSupportedTypeData type); - static void setup(LiveDataFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(LiveDataFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataFlutterApi.create', codec, @@ -2461,12 +2513,13 @@ abstract class LiveDataFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataFlutterApi.create was null, expected non-null LiveDataSupportedTypeData.'); api.create(arg_identifier!, arg_type!); @@ -2484,7 +2537,8 @@ abstract class AnalyzerFlutterApi { void analyze(int identifier, int imageProxyIdentifier); - static void setup(AnalyzerFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(AnalyzerFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerFlutterApi.create', codec, @@ -2494,7 +2548,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2513,7 +2567,7 @@ abstract class AnalyzerFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerFlutterApi.analyze was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2594,7 +2648,8 @@ abstract class ImageProxyFlutterApi { void create(int identifier, int format, int height, int width); - static void setup(ImageProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(ImageProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyFlutterApi.create', codec, @@ -2604,7 +2659,7 @@ abstract class ImageProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2631,7 +2686,8 @@ abstract class PlaneProxyFlutterApi { void create(int identifier, Uint8List buffer, int pixelStride, int rowStride); - static void setup(PlaneProxyFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(PlaneProxyFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PlaneProxyFlutterApi.create', codec, @@ -2641,7 +2697,7 @@ abstract class PlaneProxyFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2655,7 +2711,8 @@ abstract class PlaneProxyFlutterApi { final int? arg_rowStride = (args[3] as int?); assert(arg_rowStride != null, 'Argument for dev.flutter.pigeon.PlaneProxyFlutterApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); + api.create( + arg_identifier!, arg_buffer!, arg_pixelStride!, arg_rowStride!); return; }); } @@ -2681,9 +2738,9 @@ class _QualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2701,12 +2758,18 @@ class QualitySelectorHostApi { static const MessageCodec codec = _QualitySelectorHostApiCodec(); - Future create(int arg_identifier, List arg_videoQualityDataList, int? arg_fallbackStrategyId) async { + Future create( + int arg_identifier, + List arg_videoQualityDataList, + int? arg_fallbackStrategyId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_videoQualityDataList, arg_fallbackStrategyId]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_videoQualityDataList, + arg_fallbackStrategyId + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2723,12 +2786,13 @@ class QualitySelectorHostApi { } } - Future getResolution(int arg_cameraInfoId, VideoQuality arg_quality) async { + Future getResolution( + int arg_cameraInfoId, VideoQuality arg_quality) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_cameraInfoId, arg_quality.index]) as List?; + final List? replyList = await channel + .send([arg_cameraInfoId, arg_quality.index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2761,12 +2825,16 @@ class FallbackStrategyHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, VideoQuality arg_quality, VideoResolutionFallbackRule arg_fallbackRule) async { + Future create(int arg_identifier, VideoQuality arg_quality, + VideoResolutionFallbackRule arg_fallbackRule) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_quality.index, arg_fallbackRule.index]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_quality.index, + arg_fallbackRule.index + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2798,8 +2866,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_torch]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_torch]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2820,8 +2888,8 @@ class CameraControlHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_ratio]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_ratio]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2838,12 +2906,14 @@ class CameraControlHostApi { } } - Future startFocusAndMetering(int arg_identifier, int arg_focusMeteringActionId) async { + Future startFocusAndMetering( + int arg_identifier, int arg_focusMeteringActionId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_focusMeteringActionId]) as List?; + await channel.send([arg_identifier, arg_focusMeteringActionId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2882,12 +2952,14 @@ class CameraControlHostApi { } } - Future setExposureCompensationIndex(int arg_identifier, int arg_index) async { + Future setExposureCompensationIndex( + int arg_identifier, int arg_index) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_index]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_index]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -2910,7 +2982,8 @@ abstract class CameraControlFlutterApi { void create(int identifier); - static void setup(CameraControlFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(CameraControlFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlFlutterApi.create', codec, @@ -2920,7 +2993,7 @@ abstract class CameraControlFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraControlFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2948,7 +3021,7 @@ class _FocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2966,12 +3039,18 @@ class FocusMeteringActionHostApi { static const MessageCodec codec = _FocusMeteringActionHostApiCodec(); - Future create(int arg_identifier, List arg_meteringPointInfos, bool? arg_disableAutoCancel) async { + Future create( + int arg_identifier, + List arg_meteringPointInfos, + bool? arg_disableAutoCancel) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_meteringPointInfos, arg_disableAutoCancel]) as List?; + final List? replyList = await channel.send([ + arg_identifier, + arg_meteringPointInfos, + arg_disableAutoCancel + ]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3001,7 +3080,8 @@ class FocusMeteringResultHostApi { Future isFocusSuccessful(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3032,7 +3112,8 @@ abstract class FocusMeteringResultFlutterApi { void create(int identifier); - static void setup(FocusMeteringResultFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(FocusMeteringResultFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringResultFlutterApi.create', codec, @@ -3042,7 +3123,7 @@ abstract class FocusMeteringResultFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -3065,12 +3146,14 @@ class MeteringPointHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, double arg_x, double arg_y, double? arg_size, int arg_cameraInfoId) async { + Future create(int arg_identifier, double arg_x, double arg_y, + double? arg_size, int arg_cameraInfoId) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_x, arg_y, arg_size, arg_cameraInfoId]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_x, arg_y, arg_size, arg_cameraInfoId]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3091,8 +3174,7 @@ class MeteringPointHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send(null) as List?; + final List? replyList = await channel.send(null) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3148,19 +3230,19 @@ class _CaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3176,14 +3258,16 @@ class CaptureRequestOptionsHostApi { : _binaryMessenger = binaryMessenger; final BinaryMessenger? _binaryMessenger; - static const MessageCodec codec = _CaptureRequestOptionsHostApiCodec(); + static const MessageCodec codec = + _CaptureRequestOptionsHostApiCodec(); - Future create(int arg_identifier, Map arg_options) async { + Future create( + int arg_identifier, Map arg_options) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_options]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_options]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3211,12 +3295,14 @@ class Camera2CameraControlHostApi { static const MessageCodec codec = StandardMessageCodec(); - Future create(int arg_identifier, int arg_cameraControlIdentifier) async { + Future create( + int arg_identifier, int arg_cameraControlIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_cameraControlIdentifier]) as List?; + final List? replyList = await channel + .send([arg_identifier, arg_cameraControlIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3233,12 +3319,15 @@ class Camera2CameraControlHostApi { } } - Future addCaptureRequestOptions(int arg_identifier, int arg_captureRequestOptionsIdentifier) async { + Future addCaptureRequestOptions( + int arg_identifier, int arg_captureRequestOptionsIdentifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', + codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_identifier, arg_captureRequestOptionsIdentifier]) as List?; + final List? replyList = await channel.send( + [arg_identifier, arg_captureRequestOptionsIdentifier]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3271,7 +3360,7 @@ class _ResolutionFilterHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -3289,12 +3378,15 @@ class ResolutionFilterHostApi { static const MessageCodec codec = _ResolutionFilterHostApiCodec(); - Future createWithOnePreferredSize(int arg_identifier, ResolutionInfo arg_preferredResolution) async { + Future createWithOnePreferredSize( + int arg_identifier, ResolutionInfo arg_preferredResolution) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', codec, + 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', + codec, binaryMessenger: _binaryMessenger); final List? replyList = - await channel.send([arg_identifier, arg_preferredResolution]) as List?; + await channel.send([arg_identifier, arg_preferredResolution]) + as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3326,8 +3418,8 @@ class Camera2CameraInfoHostApi { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom', codec, binaryMessenger: _binaryMessenger); - final List? replyList = - await channel.send([arg_cameraInfoIdentifier]) as List?; + final List? replyList = await channel + .send([arg_cameraInfoIdentifier]) as List?; if (replyList == null) { throw PlatformException( code: 'channel-error', @@ -3351,7 +3443,8 @@ class Camera2CameraInfoHostApi { Future getSupportedHardwareLevel(int arg_identifier) async { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', codec, + 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', + codec, binaryMessenger: _binaryMessenger); final List? replyList = await channel.send([arg_identifier]) as List?; @@ -3409,7 +3502,8 @@ abstract class Camera2CameraInfoFlutterApi { void create(int identifier); - static void setup(Camera2CameraInfoFlutterApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(Camera2CameraInfoFlutterApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create', codec, @@ -3419,7 +3513,7 @@ abstract class Camera2CameraInfoFlutterApi { } else { channel.setMessageHandler((Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoFlutterApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, diff --git a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart index e9b846f71d77..971ef49390ac 100644 --- a/packages/camera/camera_android_camerax/lib/src/pending_recording.dart +++ b/packages/camera/camera_android_camerax/lib/src/pending_recording.dart @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:async'; - import 'package:flutter/services.dart' show BinaryMessenger; import 'package:meta/meta.dart' show immutable; @@ -32,10 +30,6 @@ class PendingRecording extends JavaObject { late final PendingRecordingHostApiImpl _api; - /// Stream that emits an event when the corresponding video recording is finalized. - static final StreamController videoRecordingFinalizedStreamController = - StreamController.broadcast(); - /// Starts the recording, making it an active recording. Future start() { return _api.startFromInstance(this); @@ -106,9 +100,4 @@ class PendingRecordingFlutterApiImpl extends PendingRecordingFlutterApi { ); }); } - - @override - void onVideoRecordingFinalized() { - PendingRecording.videoRecordingFinalizedStreamController.add(null); - } } diff --git a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart index 3bb6d4884389..f51eae8c306a 100644 --- a/packages/camera/camera_android_camerax/pigeons/camerax_library.dart +++ b/packages/camera/camera_android_camerax/pigeons/camerax_library.dart @@ -325,8 +325,6 @@ abstract class PendingRecordingHostApi { @FlutterApi() abstract class PendingRecordingFlutterApi { void create(int identifier); - - void onVideoRecordingFinalized(); } @HostApi(dartHostTestHandler: 'TestRecordingHostApi') diff --git a/packages/camera/camera_android_camerax/pubspec.yaml b/packages/camera/camera_android_camerax/pubspec.yaml index 9839102defa9..fec57ac97194 100644 --- a/packages/camera/camera_android_camerax/pubspec.yaml +++ b/packages/camera/camera_android_camerax/pubspec.yaml @@ -2,7 +2,7 @@ name: camera_android_camerax description: Android implementation of the camera plugin using the CameraX library. repository: https://github.com/flutter/packages/tree/main/packages/camera/camera_android_camerax issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+camera%22 -version: 0.6.4+2 +version: 0.6.5+1 environment: sdk: ^3.1.0 diff --git a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart index ede89e16dbc6..8a659e460cd7 100644 --- a/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart +++ b/packages/camera/camera_android_camerax/test/test_camerax_library.g.dart @@ -14,7 +14,8 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:camera_android_camerax/src/camerax_library.g.dart'; abstract class TestInstanceManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); /// Clear the native `InstanceManager`. @@ -22,15 +23,19 @@ abstract class TestInstanceManagerHostApi { /// This is typically only used after a hot restart. void clear(); - static void setup(TestInstanceManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestInstanceManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.InstanceManagerHostApi.clear', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.clear(); return []; @@ -41,22 +46,27 @@ abstract class TestInstanceManagerHostApi { } abstract class TestJavaObjectHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void dispose(int identifier); - static void setup(TestJavaObjectHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestJavaObjectHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.JavaObjectHostApi.dispose', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); + 'Argument for dev.flutter.pigeon.JavaObjectHostApi.dispose was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -70,7 +80,8 @@ abstract class TestJavaObjectHostApi { } abstract class TestCameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getSensorRotationDegrees(int identifier); @@ -81,17 +92,22 @@ abstract class TestCameraInfoHostApi { int getZoomState(int identifier); - static void setup(TestCameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraInfoHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', codec, + 'dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getSensorRotationDegrees was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -106,11 +122,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getCameraState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getCameraState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -125,11 +144,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getExposureState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getExposureState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -144,11 +166,14 @@ abstract class TestCameraInfoHostApi { 'dev.flutter.pigeon.CameraInfoHostApi.getZoomState', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); + 'Argument for dev.flutter.pigeon.CameraInfoHostApi.getZoomState was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -162,24 +187,29 @@ abstract class TestCameraInfoHostApi { } abstract class TestCameraSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? lensFacing); List filter(int identifier, List cameraInfoIds); - static void setup(TestCameraSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -195,19 +225,24 @@ abstract class TestCameraSelectorHostApi { 'dev.flutter.pigeon.CameraSelectorHostApi.filter', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); + 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null int.'); - final List? arg_cameraInfoIds = (args[1] as List?)?.cast(); + final List? arg_cameraInfoIds = + (args[1] as List?)?.cast(); assert(arg_cameraInfoIds != null, 'Argument for dev.flutter.pigeon.CameraSelectorHostApi.filter was null, expected non-null List.'); - final List output = api.filter(arg_identifier!, arg_cameraInfoIds!); + final List output = + api.filter(arg_identifier!, arg_cameraInfoIds!); return [output]; }); } @@ -216,14 +251,16 @@ abstract class TestCameraSelectorHostApi { } abstract class TestProcessCameraProviderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future getInstance(); List getAvailableCameraInfos(int identifier); - int bindToLifecycle(int identifier, int cameraSelectorIdentifier, List useCaseIds); + int bindToLifecycle( + int identifier, int cameraSelectorIdentifier, List useCaseIds); bool isBound(int identifier, int useCaseIdentifier); @@ -231,15 +268,19 @@ abstract class TestProcessCameraProviderHostApi { void unbindAll(int identifier); - static void setup(TestProcessCameraProviderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestProcessCameraProviderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getInstance', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = await api.getInstance(); return [output]; @@ -248,33 +289,42 @@ abstract class TestProcessCameraProviderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.getAvailableCameraInfos was null, expected non-null int.'); - final List output = api.getAvailableCameraInfos(arg_identifier!); + final List output = + api.getAvailableCameraInfos(arg_identifier!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', codec, + 'dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -282,10 +332,12 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_cameraSelectorIdentifier = (args[1] as int?); assert(arg_cameraSelectorIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null int.'); - final List? arg_useCaseIds = (args[2] as List?)?.cast(); + final List? arg_useCaseIds = + (args[2] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.bindToLifecycle was null, expected non-null List.'); - final int output = api.bindToLifecycle(arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); + final int output = api.bindToLifecycle( + arg_identifier!, arg_cameraSelectorIdentifier!, arg_useCaseIds!); return [output]; }); } @@ -295,11 +347,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -307,7 +362,8 @@ abstract class TestProcessCameraProviderHostApi { final int? arg_useCaseIdentifier = (args[1] as int?); assert(arg_useCaseIdentifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.isBound was null, expected non-null int.'); - final bool output = api.isBound(arg_identifier!, arg_useCaseIdentifier!); + final bool output = + api.isBound(arg_identifier!, arg_useCaseIdentifier!); return [output]; }); } @@ -317,16 +373,20 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null int.'); - final List? arg_useCaseIds = (args[1] as List?)?.cast(); + final List? arg_useCaseIds = + (args[1] as List?)?.cast(); assert(arg_useCaseIds != null, 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbind was null, expected non-null List.'); api.unbind(arg_identifier!, arg_useCaseIds!); @@ -339,11 +399,14 @@ abstract class TestProcessCameraProviderHostApi { 'dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); + 'Argument for dev.flutter.pigeon.ProcessCameraProviderHostApi.unbindAll was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -357,24 +420,29 @@ abstract class TestProcessCameraProviderHostApi { } abstract class TestCameraHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int getCameraInfo(int identifier); int getCameraControl(int identifier); - static void setup(TestCameraHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraHostApi.getCameraInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -389,11 +457,14 @@ abstract class TestCameraHostApi { 'dev.flutter.pigeon.CameraHostApi.getCameraControl', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); + 'Argument for dev.flutter.pigeon.CameraHostApi.getCameraControl was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -421,7 +492,7 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -430,29 +501,37 @@ class _TestSystemServicesHostApiCodec extends StandardMessageCodec { } abstract class TestSystemServicesHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestSystemServicesHostApiCodec(); - Future requestCameraPermissions(bool enableAudio); + Future requestCameraPermissions( + bool enableAudio); String getTempFilePath(String prefix, String suffix); - static void setup(TestSystemServicesHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestSystemServicesHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', codec, + 'dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null.'); final List args = (message as List?)!; final bool? arg_enableAudio = (args[0] as bool?); assert(arg_enableAudio != null, 'Argument for dev.flutter.pigeon.SystemServicesHostApi.requestCameraPermissions was null, expected non-null bool.'); - final CameraPermissionsErrorData? output = await api.requestCameraPermissions(arg_enableAudio!); + final CameraPermissionsErrorData? output = + await api.requestCameraPermissions(arg_enableAudio!); return [output]; }); } @@ -462,11 +541,14 @@ abstract class TestSystemServicesHostApi { 'dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); + 'Argument for dev.flutter.pigeon.SystemServicesHostApi.getTempFilePath was null.'); final List args = (message as List?)!; final String? arg_prefix = (args[0] as String?); assert(arg_prefix != null, @@ -483,26 +565,33 @@ abstract class TestSystemServicesHostApi { } abstract class TestDeviceOrientationManagerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void startListeningForDeviceOrientationChange(bool isFrontFacing, int sensorOrientation); + void startListeningForDeviceOrientationChange( + bool isFrontFacing, int sensorOrientation); void stopListeningForDeviceOrientationChange(); int getDefaultDisplayRotation(); - static void setup(TestDeviceOrientationManagerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestDeviceOrientationManagerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); + 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null.'); final List args = (message as List?)!; final bool? arg_isFrontFacing = (args[0] as bool?); assert(arg_isFrontFacing != null, @@ -510,19 +599,24 @@ abstract class TestDeviceOrientationManagerHostApi { final int? arg_sensorOrientation = (args[1] as int?); assert(arg_sensorOrientation != null, 'Argument for dev.flutter.pigeon.DeviceOrientationManagerHostApi.startListeningForDeviceOrientationChange was null, expected non-null int.'); - api.startListeningForDeviceOrientationChange(arg_isFrontFacing!, arg_sensorOrientation!); + api.startListeningForDeviceOrientationChange( + arg_isFrontFacing!, arg_sensorOrientation!); return []; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.stopListeningForDeviceOrientationChange', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.stopListeningForDeviceOrientationChange(); return []; @@ -531,12 +625,16 @@ abstract class TestDeviceOrientationManagerHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', codec, + 'dev.flutter.pigeon.DeviceOrientationManagerHostApi.getDefaultDisplayRotation', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final int output = api.getDefaultDisplayRotation(); return [output]; @@ -561,7 +659,7 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -570,7 +668,8 @@ class _TestPreviewHostApiCodec extends StandardMessageCodec { } abstract class TestPreviewHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestPreviewHostApiCodec(); void create(int identifier, int? rotation, int? resolutionSelectorId); @@ -583,17 +682,21 @@ abstract class TestPreviewHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestPreviewHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPreviewHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PreviewHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -610,11 +713,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setSurfaceProvider was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -626,12 +732,16 @@ abstract class TestPreviewHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', codec, + 'dev.flutter.pigeon.PreviewHostApi.releaseFlutterSurfaceTexture', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message api.releaseFlutterSurfaceTexture(); return []; @@ -643,11 +753,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.getResolutionInfo', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.getResolutionInfo was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -662,11 +775,14 @@ abstract class TestPreviewHostApi { 'dev.flutter.pigeon.PreviewHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.PreviewHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -683,7 +799,8 @@ abstract class TestPreviewHostApi { } abstract class TestVideoCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int withOutput(int videoOutputId); @@ -692,17 +809,21 @@ abstract class TestVideoCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestVideoCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestVideoCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.VideoCaptureHostApi.withOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.withOutput was null.'); final List args = (message as List?)!; final int? arg_videoOutputId = (args[0] as int?); assert(arg_videoOutputId != null, @@ -717,11 +838,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.getOutput', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.getOutput was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -736,11 +860,14 @@ abstract class TestVideoCaptureHostApi { 'dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.VideoCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -757,10 +884,12 @@ abstract class TestVideoCaptureHostApi { } abstract class TestRecorderHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); + void create( + int identifier, int? aspectRatio, int? bitRate, int? qualitySelectorId); int getAspectRatio(int identifier); @@ -768,17 +897,21 @@ abstract class TestRecorderHostApi { int prepareRecording(int identifier, String path); - static void setup(TestRecorderHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecorderHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecorderHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -786,7 +919,8 @@ abstract class TestRecorderHostApi { final int? arg_aspectRatio = (args[1] as int?); final int? arg_bitRate = (args[2] as int?); final int? arg_qualitySelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, arg_qualitySelectorId); + api.create(arg_identifier!, arg_aspectRatio, arg_bitRate, + arg_qualitySelectorId); return []; }); } @@ -796,11 +930,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.getAspectRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getAspectRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -812,14 +949,18 @@ abstract class TestRecorderHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', codec, + 'dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.getTargetVideoEncodingBitRate was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -834,11 +975,14 @@ abstract class TestRecorderHostApi { 'dev.flutter.pigeon.RecorderHostApi.prepareRecording', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); + 'Argument for dev.flutter.pigeon.RecorderHostApi.prepareRecording was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -855,22 +999,27 @@ abstract class TestRecorderHostApi { } abstract class TestPendingRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int start(int identifier); - static void setup(TestPendingRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestPendingRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.PendingRecordingHostApi.start', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); + 'Argument for dev.flutter.pigeon.PendingRecordingHostApi.start was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -884,7 +1033,8 @@ abstract class TestPendingRecordingHostApi { } abstract class TestRecordingHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void close(int identifier); @@ -895,17 +1045,21 @@ abstract class TestRecordingHostApi { void stop(int identifier); - static void setup(TestRecordingHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestRecordingHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.RecordingHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -920,11 +1074,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.pause', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.pause was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -939,11 +1096,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.resume', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.resume was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -958,11 +1118,14 @@ abstract class TestRecordingHostApi { 'dev.flutter.pigeon.RecordingHostApi.stop', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); + 'Argument for dev.flutter.pigeon.RecordingHostApi.stop was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -976,10 +1139,12 @@ abstract class TestRecordingHostApi { } abstract class TestImageCaptureHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? targetRotation, int? flashMode, int? resolutionSelectorId); + void create(int identifier, int? targetRotation, int? flashMode, + int? resolutionSelectorId); void setFlashMode(int identifier, int flashMode); @@ -987,17 +1152,21 @@ abstract class TestImageCaptureHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageCaptureHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageCaptureHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageCaptureHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1005,7 +1174,8 @@ abstract class TestImageCaptureHostApi { final int? arg_targetRotation = (args[1] as int?); final int? arg_flashMode = (args[2] as int?); final int? arg_resolutionSelectorId = (args[3] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_flashMode, arg_resolutionSelectorId); + api.create(arg_identifier!, arg_targetRotation, arg_flashMode, + arg_resolutionSelectorId); return []; }); } @@ -1015,11 +1185,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setFlashMode was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1037,11 +1210,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.takePicture', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.takePicture was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1056,11 +1232,14 @@ abstract class TestImageCaptureHostApi { 'dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageCaptureHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1091,7 +1270,7 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1100,22 +1279,28 @@ class _TestResolutionStrategyHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestResolutionStrategyHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestResolutionStrategyHostApiCodec(); void create(int identifier, ResolutionInfo? boundSize, int? fallbackRule); - static void setup(TestResolutionStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1131,22 +1316,28 @@ abstract class TestResolutionStrategyHostApi { } abstract class TestResolutionSelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, int? resolutionStrategyIdentifier, int? resolutionSelectorIdentifier, int? aspectRatioStrategyIdentifier); + void create(int identifier, int? resolutionStrategyIdentifier, + int? resolutionSelectorIdentifier, int? aspectRatioStrategyIdentifier); - static void setup(TestResolutionSelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionSelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ResolutionSelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ResolutionSelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1154,7 +1345,11 @@ abstract class TestResolutionSelectorHostApi { final int? arg_resolutionStrategyIdentifier = (args[1] as int?); final int? arg_resolutionSelectorIdentifier = (args[2] as int?); final int? arg_aspectRatioStrategyIdentifier = (args[3] as int?); - api.create(arg_identifier!, arg_resolutionStrategyIdentifier, arg_resolutionSelectorIdentifier, arg_aspectRatioStrategyIdentifier); + api.create( + arg_identifier!, + arg_resolutionStrategyIdentifier, + arg_resolutionSelectorIdentifier, + arg_aspectRatioStrategyIdentifier); return []; }); } @@ -1163,22 +1358,27 @@ abstract class TestResolutionSelectorHostApi { } abstract class TestAspectRatioStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int preferredAspectRatio, int fallbackRule); - static void setup(TestAspectRatioStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAspectRatioStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AspectRatioStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1189,7 +1389,8 @@ abstract class TestAspectRatioStrategyHostApi { final int? arg_fallbackRule = (args[2] as int?); assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.AspectRatioStrategyHostApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); + api.create( + arg_identifier!, arg_preferredAspectRatio!, arg_fallbackRule!); return []; }); } @@ -1198,7 +1399,8 @@ abstract class TestAspectRatioStrategyHostApi { } abstract class TestImageAnalysisHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int? targetRotation, int? resolutionSelectorId); @@ -1209,24 +1411,29 @@ abstract class TestImageAnalysisHostApi { void setTargetRotation(int identifier, int rotation); - static void setup(TestImageAnalysisHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageAnalysisHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageAnalysisHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.create was null, expected non-null int.'); final int? arg_targetRotation = (args[1] as int?); final int? arg_resolutionSelectorId = (args[2] as int?); - api.create(arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); + api.create( + arg_identifier!, arg_targetRotation, arg_resolutionSelectorId); return []; }); } @@ -1236,11 +1443,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1258,11 +1468,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.clearAnalyzer was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1277,11 +1490,14 @@ abstract class TestImageAnalysisHostApi { 'dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); + 'Argument for dev.flutter.pigeon.ImageAnalysisHostApi.setTargetRotation was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1298,22 +1514,27 @@ abstract class TestImageAnalysisHostApi { } abstract class TestAnalyzerHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestAnalyzerHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestAnalyzerHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.AnalyzerHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.AnalyzerHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1327,22 +1548,27 @@ abstract class TestAnalyzerHostApi { } abstract class TestObserverHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier); - static void setup(TestObserverHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestObserverHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ObserverHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.ObserverHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1370,7 +1596,7 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return LiveDataSupportedTypeData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1379,7 +1605,8 @@ class _TestLiveDataHostApiCodec extends StandardMessageCodec { } abstract class TestLiveDataHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestLiveDataHostApiCodec(); void observe(int identifier, int observerIdentifier); @@ -1388,17 +1615,21 @@ abstract class TestLiveDataHostApi { int? getValue(int identifier, LiveDataSupportedTypeData type); - static void setup(TestLiveDataHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestLiveDataHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.LiveDataHostApi.observe', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.observe was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1416,11 +1647,14 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.removeObservers', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.removeObservers was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1435,16 +1669,20 @@ abstract class TestLiveDataHostApi { 'dev.flutter.pigeon.LiveDataHostApi.getValue', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); + 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null int.'); - final LiveDataSupportedTypeData? arg_type = (args[1] as LiveDataSupportedTypeData?); + final LiveDataSupportedTypeData? arg_type = + (args[1] as LiveDataSupportedTypeData?); assert(arg_type != null, 'Argument for dev.flutter.pigeon.LiveDataHostApi.getValue was null, expected non-null LiveDataSupportedTypeData.'); final int? output = api.getValue(arg_identifier!, arg_type!); @@ -1456,24 +1694,29 @@ abstract class TestLiveDataHostApi { } abstract class TestImageProxyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); List getPlanes(int identifier); void close(int identifier); - static void setup(TestImageProxyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestImageProxyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.ImageProxyHostApi.getPlanes', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.getPlanes was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1488,11 +1731,14 @@ abstract class TestImageProxyHostApi { 'dev.flutter.pigeon.ImageProxyHostApi.close', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); + 'Argument for dev.flutter.pigeon.ImageProxyHostApi.close was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1523,9 +1769,9 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); - case 129: + case 129: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1534,33 +1780,41 @@ class _TestQualitySelectorHostApiCodec extends StandardMessageCodec { } abstract class TestQualitySelectorHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = _TestQualitySelectorHostApiCodec(); - void create(int identifier, List videoQualityDataList, int? fallbackStrategyId); + void create(int identifier, List videoQualityDataList, + int? fallbackStrategyId); ResolutionInfo getResolution(int cameraInfoId, VideoQuality quality); - static void setup(TestQualitySelectorHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestQualitySelectorHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.QualitySelectorHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null int.'); - final List? arg_videoQualityDataList = (args[1] as List?)?.cast(); + final List? arg_videoQualityDataList = + (args[1] as List?)?.cast(); assert(arg_videoQualityDataList != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.create was null, expected non-null List.'); final int? arg_fallbackStrategyId = (args[2] as int?); - api.create(arg_identifier!, arg_videoQualityDataList!, arg_fallbackStrategyId); + api.create(arg_identifier!, arg_videoQualityDataList!, + arg_fallbackStrategyId); return []; }); } @@ -1570,19 +1824,24 @@ abstract class TestQualitySelectorHostApi { 'dev.flutter.pigeon.QualitySelectorHostApi.getResolution', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); + 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null.'); final List args = (message as List?)!; final int? arg_cameraInfoId = (args[0] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.QualitySelectorHostApi.getResolution was null, expected non-null VideoQuality.'); - final ResolutionInfo output = api.getResolution(arg_cameraInfoId!, arg_quality!); + final ResolutionInfo output = + api.getResolution(arg_cameraInfoId!, arg_quality!); return [output]; }); } @@ -1591,30 +1850,39 @@ abstract class TestQualitySelectorHostApi { } abstract class TestFallbackStrategyHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, VideoQuality quality, VideoResolutionFallbackRule fallbackRule); + void create(int identifier, VideoQuality quality, + VideoResolutionFallbackRule fallbackRule); - static void setup(TestFallbackStrategyHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFallbackStrategyHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FallbackStrategyHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null int.'); - final VideoQuality? arg_quality = args[1] == null ? null : VideoQuality.values[args[1] as int]; + final VideoQuality? arg_quality = + args[1] == null ? null : VideoQuality.values[args[1] as int]; assert(arg_quality != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoQuality.'); - final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null ? null : VideoResolutionFallbackRule.values[args[2] as int]; + final VideoResolutionFallbackRule? arg_fallbackRule = args[2] == null + ? null + : VideoResolutionFallbackRule.values[args[2] as int]; assert(arg_fallbackRule != null, 'Argument for dev.flutter.pigeon.FallbackStrategyHostApi.create was null, expected non-null VideoResolutionFallbackRule.'); api.create(arg_identifier!, arg_quality!, arg_fallbackRule!); @@ -1626,7 +1894,8 @@ abstract class TestFallbackStrategyHostApi { } abstract class TestCameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); Future enableTorch(int identifier, bool torch); @@ -1639,17 +1908,21 @@ abstract class TestCameraControlHostApi { Future setExposureCompensationIndex(int identifier, int index); - static void setup(TestCameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCameraControlHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CameraControlHostApi.enableTorch', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.enableTorch was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1667,11 +1940,14 @@ abstract class TestCameraControlHostApi { 'dev.flutter.pigeon.CameraControlHostApi.setZoomRatio', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setZoomRatio was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1686,14 +1962,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1701,21 +1981,26 @@ abstract class TestCameraControlHostApi { final int? arg_focusMeteringActionId = (args[1] as int?); assert(arg_focusMeteringActionId != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.startFocusAndMetering was null, expected non-null int.'); - final int? output = await api.startFocusAndMetering(arg_identifier!, arg_focusMeteringActionId!); + final int? output = await api.startFocusAndMetering( + arg_identifier!, arg_focusMeteringActionId!); return [output]; }); } } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', codec, + 'dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.cancelFocusAndMetering was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1727,14 +2012,18 @@ abstract class TestCameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', codec, + 'dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); + 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1742,7 +2031,8 @@ abstract class TestCameraControlHostApi { final int? arg_index = (args[1] as int?); assert(arg_index != null, 'Argument for dev.flutter.pigeon.CameraControlHostApi.setExposureCompensationIndex was null, expected non-null int.'); - final int? output = await api.setExposureCompensationIndex(arg_identifier!, arg_index!); + final int? output = await api.setExposureCompensationIndex( + arg_identifier!, arg_index!); return [output]; }); } @@ -1765,7 +2055,7 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return MeteringPointInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1774,31 +2064,40 @@ class _TestFocusMeteringActionHostApiCodec extends StandardMessageCodec { } abstract class TestFocusMeteringActionHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestFocusMeteringActionHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestFocusMeteringActionHostApiCodec(); - void create(int identifier, List meteringPointInfos, bool? disableAutoCancel); + void create(int identifier, List meteringPointInfos, + bool? disableAutoCancel); - static void setup(TestFocusMeteringActionHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringActionHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.FocusMeteringActionHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null int.'); - final List? arg_meteringPointInfos = (args[1] as List?)?.cast(); + final List? arg_meteringPointInfos = + (args[1] as List?)?.cast(); assert(arg_meteringPointInfos != null, 'Argument for dev.flutter.pigeon.FocusMeteringActionHostApi.create was null, expected non-null List.'); final bool? arg_disableAutoCancel = (args[2] as bool?); - api.create(arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); + api.create( + arg_identifier!, arg_meteringPointInfos!, arg_disableAutoCancel); return []; }); } @@ -1807,22 +2106,28 @@ abstract class TestFocusMeteringActionHostApi { } abstract class TestFocusMeteringResultHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); bool isFocusSuccessful(int identifier); - static void setup(TestFocusMeteringResultHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestFocusMeteringResultHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', codec, + 'dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); + 'Argument for dev.flutter.pigeon.FocusMeteringResultHostApi.isFocusSuccessful was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1836,24 +2141,30 @@ abstract class TestFocusMeteringResultHostApi { } abstract class TestMeteringPointHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); - void create(int identifier, double x, double y, double? size, int cameraInfoId); + void create( + int identifier, double x, double y, double? size, int cameraInfoId); double getDefaultPointSize(); - static void setup(TestMeteringPointHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestMeteringPointHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.MeteringPointHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -1868,7 +2179,8 @@ abstract class TestMeteringPointHostApi { final int? arg_cameraInfoId = (args[4] as int?); assert(arg_cameraInfoId != null, 'Argument for dev.flutter.pigeon.MeteringPointHostApi.create was null, expected non-null int.'); - api.create(arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); + api.create( + arg_identifier!, arg_x!, arg_y!, arg_size, arg_cameraInfoId!); return []; }); } @@ -1878,9 +2190,12 @@ abstract class TestMeteringPointHostApi { 'dev.flutter.pigeon.MeteringPointHostApi.getDefaultPointSize', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { // ignore message final double output = api.getDefaultPointSize(); return [output]; @@ -1923,19 +2238,19 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return CameraPermissionsErrorData.decode(readValue(buffer)!); - case 129: + case 129: return CameraStateTypeData.decode(readValue(buffer)!); - case 130: + case 130: return ExposureCompensationRange.decode(readValue(buffer)!); - case 131: + case 131: return LiveDataSupportedTypeData.decode(readValue(buffer)!); - case 132: + case 132: return MeteringPointInfo.decode(readValue(buffer)!); - case 133: + case 133: return ResolutionInfo.decode(readValue(buffer)!); - case 134: + case 134: return VideoQualityData.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -1944,27 +2259,34 @@ class _TestCaptureRequestOptionsHostApiCodec extends StandardMessageCodec { } abstract class TestCaptureRequestOptionsHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestCaptureRequestOptionsHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestCaptureRequestOptionsHostApiCodec(); void create(int identifier, Map options); - static void setup(TestCaptureRequestOptionsHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCaptureRequestOptionsHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.CaptureRequestOptionsHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null int.'); - final Map? arg_options = (args[1] as Map?)?.cast(); + final Map? arg_options = + (args[1] as Map?)?.cast(); assert(arg_options != null, 'Argument for dev.flutter.pigeon.CaptureRequestOptionsHostApi.create was null, expected non-null Map.'); api.create(arg_identifier!, arg_options!); @@ -1976,24 +2298,30 @@ abstract class TestCaptureRequestOptionsHostApi { } abstract class TestCamera2CameraControlHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); void create(int identifier, int cameraControlIdentifier); - Future addCaptureRequestOptions(int identifier, int captureRequestOptionsIdentifier); + Future addCaptureRequestOptions( + int identifier, int captureRequestOptionsIdentifier); - static void setup(TestCamera2CameraControlHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCamera2CameraControlHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraControlHostApi.create', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.create was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2008,14 +2336,18 @@ abstract class TestCamera2CameraControlHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', codec, + 'dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2023,7 +2355,8 @@ abstract class TestCamera2CameraControlHostApi { final int? arg_captureRequestOptionsIdentifier = (args[1] as int?); assert(arg_captureRequestOptionsIdentifier != null, 'Argument for dev.flutter.pigeon.Camera2CameraControlHostApi.addCaptureRequestOptions was null, expected non-null int.'); - await api.addCaptureRequestOptions(arg_identifier!, arg_captureRequestOptionsIdentifier!); + await api.addCaptureRequestOptions( + arg_identifier!, arg_captureRequestOptionsIdentifier!); return []; }); } @@ -2046,7 +2379,7 @@ class _TestResolutionFilterHostApiCodec extends StandardMessageCodec { @override Object? readValueOfType(int type, ReadBuffer buffer) { switch (type) { - case 128: + case 128: return ResolutionInfo.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); @@ -2055,30 +2388,40 @@ class _TestResolutionFilterHostApiCodec extends StandardMessageCodec { } abstract class TestResolutionFilterHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; - static const MessageCodec codec = _TestResolutionFilterHostApiCodec(); + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; + static const MessageCodec codec = + _TestResolutionFilterHostApiCodec(); - void createWithOnePreferredSize(int identifier, ResolutionInfo preferredResolution); + void createWithOnePreferredSize( + int identifier, ResolutionInfo preferredResolution); - static void setup(TestResolutionFilterHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestResolutionFilterHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', codec, + 'dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null.'); + 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null, expected non-null int.'); - final ResolutionInfo? arg_preferredResolution = (args[1] as ResolutionInfo?); + final ResolutionInfo? arg_preferredResolution = + (args[1] as ResolutionInfo?); assert(arg_preferredResolution != null, 'Argument for dev.flutter.pigeon.ResolutionFilterHostApi.createWithOnePreferredSize was null, expected non-null ResolutionInfo.'); - api.createWithOnePreferredSize(arg_identifier!, arg_preferredResolution!); + api.createWithOnePreferredSize( + arg_identifier!, arg_preferredResolution!); return []; }); } @@ -2087,7 +2430,8 @@ abstract class TestResolutionFilterHostApi { } abstract class TestCamera2CameraInfoHostApi { - static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => TestDefaultBinaryMessengerBinding.instance; + static TestDefaultBinaryMessengerBinding? get _testBinaryMessengerBinding => + TestDefaultBinaryMessengerBinding.instance; static const MessageCodec codec = StandardMessageCodec(); int createFrom(int cameraInfoIdentifier); @@ -2096,17 +2440,21 @@ abstract class TestCamera2CameraInfoHostApi { String getCameraId(int identifier); - static void setup(TestCamera2CameraInfoHostApi? api, {BinaryMessenger? binaryMessenger}) { + static void setup(TestCamera2CameraInfoHostApi? api, + {BinaryMessenger? binaryMessenger}) { { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.createFrom was null.'); final List args = (message as List?)!; final int? arg_cameraInfoIdentifier = (args[0] as int?); assert(arg_cameraInfoIdentifier != null, @@ -2118,14 +2466,18 @@ abstract class TestCamera2CameraInfoHostApi { } { final BasicMessageChannel channel = BasicMessageChannel( - 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', codec, + 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel', + codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getSupportedHardwareLevel was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, @@ -2140,11 +2492,14 @@ abstract class TestCamera2CameraInfoHostApi { 'dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId', codec, binaryMessenger: binaryMessenger); if (api == null) { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, null); + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, null); } else { - _testBinaryMessengerBinding!.defaultBinaryMessenger.setMockDecodedMessageHandler(channel, (Object? message) async { + _testBinaryMessengerBinding!.defaultBinaryMessenger + .setMockDecodedMessageHandler(channel, + (Object? message) async { assert(message != null, - 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId was null.'); + 'Argument for dev.flutter.pigeon.Camera2CameraInfoHostApi.getCameraId was null.'); final List args = (message as List?)!; final int? arg_identifier = (args[0] as int?); assert(arg_identifier != null, From ccb88567cdf24f34688d996cbfe31fc635f6a63d Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 9 May 2024 19:01:22 -0400 Subject: [PATCH 12/15] Undo more test changes --- packages/camera/camera/example/pubspec.yaml | 3 +-- packages/camera/camera/pubspec.yaml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/camera/camera/example/pubspec.yaml b/packages/camera/camera/example/pubspec.yaml index ebbaae2bb405..6555d3f352c7 100644 --- a/packages/camera/camera/example/pubspec.yaml +++ b/packages/camera/camera/example/pubspec.yaml @@ -17,8 +17,7 @@ dependencies: flutter: sdk: flutter path_provider: ^2.0.0 - video_player: - path: ../../../video_player/video_player/ + video_player: ^2.7.0 dev_dependencies: build_runner: ^2.1.10 diff --git a/packages/camera/camera/pubspec.yaml b/packages/camera/camera/pubspec.yaml index c1afbd03d73b..4ef3147fbd62 100644 --- a/packages/camera/camera/pubspec.yaml +++ b/packages/camera/camera/pubspec.yaml @@ -21,7 +21,7 @@ flutter: default_package: camera_web dependencies: - camera_android_camerax: 0.6.5 + camera_android_camerax: ^0.6.5 camera_avfoundation: ^0.9.15 camera_platform_interface: ^2.6.0 camera_web: ^0.3.3 From b5108cc1ef26e1be8dc54ec92ff9f3ed0ef903c4 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Thu, 9 May 2024 19:15:37 -0400 Subject: [PATCH 13/15] Address comments from https://github.com/flutter/packages/pull/6697 --- packages/camera/camera/CHANGELOG.md | 3 ++- packages/camera/camera/README.md | 9 ++++++++ .../example/integration_test/camera_test.dart | 23 ++++++++----------- 3 files changed, 20 insertions(+), 15 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index 66ddea01267d..ee14ef514410 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,7 +1,8 @@ ## 0.11.0 * **Breaking Change** Changes the Android implementation of the camera plugin from `camera_android` - to `camera_android_camerax`. To continue using `camera_android`, use `camera <0.11.0`. + to `camera_android_camerax`, which has full feature parity with `camera_android` except for all + of the limitations listed in `README.md`. To continue using `camera_android`, use `camera <0.11.0`. ## 0.10.6 diff --git a/packages/camera/camera/README.md b/packages/camera/camera/README.md index 201599387572..b4453e740383 100644 --- a/packages/camera/camera/README.md +++ b/packages/camera/camera/README.md @@ -45,6 +45,11 @@ Change the minimum Android sdk version to 21 (or higher) in your `android/app/bu minSdkVersion 21 ``` +It's important to note that the endorsed [`camera_android_camerax`][2] implementation of the camera plugin +built with CameraX has several limitations; please see this list of all of [the list of limitations][3] +for more details. If you wish to use the [`camera_android`][4] implementation of the camera plugin built +with Camera2 that lacks these limitations, please follow [these instructions][5]. + ### Web integration For web integration details, see the @@ -165,3 +170,7 @@ class _CameraAppState extends State { For a more elaborate usage example see [here](https://github.com/flutter/packages/tree/main/packages/camera/camera/example). [1]: https://pub.dev/packages/camera_web#limitations-on-the-web-platform +[2]: https://pub.dev/packages/camera_android_camerax +[3]: https://pub.dev/packages/camera_android_camerax#limitations +[4]: https://pub.dev/packages/camera_android +[5]: https://pub.dev/packages/camera_android#usage diff --git a/packages/camera/camera/example/integration_test/camera_test.dart b/packages/camera/camera/example/integration_test/camera_test.dart index c3ecca9ab530..e1fe14a6132e 100644 --- a/packages/camera/camera/example/integration_test/camera_test.dart +++ b/packages/camera/camera/example/integration_test/camera_test.dart @@ -196,26 +196,21 @@ void main() { int startPause; int timePaused = 0; + const int pauseIterations = 2; await controller.startVideoRecording(); final int recordingStart = DateTime.now().millisecondsSinceEpoch; sleep(const Duration(milliseconds: 500)); - await controller.pauseVideoRecording(); - startPause = DateTime.now().millisecondsSinceEpoch; - sleep(const Duration(milliseconds: 500)); - await controller.resumeVideoRecording(); - timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - - sleep(const Duration(milliseconds: 500)); - - await controller.pauseVideoRecording(); - startPause = DateTime.now().millisecondsSinceEpoch; - sleep(const Duration(milliseconds: 500)); - await controller.resumeVideoRecording(); - timePaused += DateTime.now().millisecondsSinceEpoch - startPause; + for (int i = 0; i < pauseIterations; i++) { + await controller.pauseVideoRecording(); + startPause = DateTime.now().millisecondsSinceEpoch; + sleep(const Duration(milliseconds: 500)); + await controller.resumeVideoRecording(); + timePaused += DateTime.now().millisecondsSinceEpoch - startPause; - sleep(const Duration(milliseconds: 500)); + sleep(const Duration(milliseconds: 500)); + } final XFile file = await controller.stopVideoRecording(); final int recordingTime = From 961810d7dcfbe191ed25147a69c691ec1d13e06b Mon Sep 17 00:00:00 2001 From: camsim99 Date: Sat, 11 May 2024 12:33:36 -0400 Subject: [PATCH 14/15] Address review --- packages/camera/camera/CHANGELOG.md | 6 ++++-- packages/camera/camera/README.md | 8 ++++---- packages/camera/camera_android/README.md | 11 ++++------- packages/camera/camera_android_camerax/README.md | 15 +++------------ 4 files changed, 15 insertions(+), 25 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index ee14ef514410..d8a5359aedd2 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -1,8 +1,10 @@ ## 0.11.0 * **Breaking Change** Changes the Android implementation of the camera plugin from `camera_android` - to `camera_android_camerax`, which has full feature parity with `camera_android` except for all - of the limitations listed in `README.md`. To continue using `camera_android`, use `camera <0.11.0`. + to `camera_android_camerax`, which has better support for a wider range of devices. The CameraX + implementation full feature parity with `camera_android` except for the limitations listed in + `README.md`. To continue using `camera_android`, specify a dependency on `camera_android` in your + `pubspec.yaml`. ## 0.10.6 diff --git a/packages/camera/camera/README.md b/packages/camera/camera/README.md index b4453e740383..c5493160ab9a 100644 --- a/packages/camera/camera/README.md +++ b/packages/camera/camera/README.md @@ -45,10 +45,10 @@ Change the minimum Android sdk version to 21 (or higher) in your `android/app/bu minSdkVersion 21 ``` -It's important to note that the endorsed [`camera_android_camerax`][2] implementation of the camera plugin -built with CameraX has several limitations; please see this list of all of [the list of limitations][3] -for more details. If you wish to use the [`camera_android`][4] implementation of the camera plugin built -with Camera2 that lacks these limitations, please follow [these instructions][5]. +The endorsed [`camera_android_camerax`][2] implementation of the camera plugin built with CameraX has +better support for more devices than `camera_android`, but has some limitations; please see [this list][3] +for more details. If you wish to use the [`camera_android`][4] implementation of the camera plugin +built with Camera2 that lacks these limitations, please follow [these instructions][5]. ### Web integration diff --git a/packages/camera/camera_android/README.md b/packages/camera/camera_android/README.md index 4f1e00a9156d..486db6743284 100644 --- a/packages/camera/camera_android/README.md +++ b/packages/camera/camera_android/README.md @@ -11,16 +11,13 @@ run $ flutter pub add camera_android ``` -If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android_camerax`][3], -you can simply use `camera` normally because it is [endorsed][2]. This package will automatically -be included in your app when you do so, so you do not need to add it to your `pubspec.yaml`. - -However, if you `import` this package with a version lower than `0.11.0`, to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual. - ## Limitation of testing video recording on emulators -It's important to note that the `MediaRecorder` class is not working properly on emulators, as stated in the documentation: https://developer.android.com/reference/android/media/MediaRecorder. Specifically, when recording a video with sound enabled and trying to play it back, the duration won't be correct and you will only see the first frame. +`MediaRecorder` does not work properly on emulators, as stated in [the documentation][5]. Specifically, +when recording a video with sound enabled and trying to play it back, the duration won't be correct and +you will only see the first frame. [1]: https://pub.dev/packages/camera [2]: https://flutter.dev/docs/development/packages-and-plugins/developing-packages#endorsed-federated-plugin [3]: https://pub.dev/packages/camera_android_camerax [4]: https://developer.android.com/media/camera/camera2 +[5]: https://developer.android.com/reference/android/media/MediaRecorder diff --git a/packages/camera/camera_android_camerax/README.md b/packages/camera/camera_android_camerax/README.md index 203aeb2a65c9..04d96657e05f 100644 --- a/packages/camera/camera_android_camerax/README.md +++ b/packages/camera/camera_android_camerax/README.md @@ -16,15 +16,6 @@ in your app when you do, so you do not need to add it to your `pubspec.yaml`. However, if you `import` this package to use any of its APIs directly, you should add it to your `pubspec.yaml` as usual. -If using `camera: <0.11.0` and wish to use this plugin instead of [`camera_android`][4], -run - -```sh -$ flutter pub add camera_android_camerax -``` - -from your project's root directory. - ## Limitations ### Concurrent preview display, video recording, image capture, and image streaming @@ -45,9 +36,9 @@ use cases, the plugin behaves according to the following: ### 240p resolution configuration for video recording -240p resolution configuration for video recording is unsupported by CameraX, -and thus, the plugin will fall back to target 480p if configured with a -`ResolutionPreset`. +240p resolution configuration for video recording is unsupported by CameraX, and thus, +the plugin will fall back to target 480p (`ResolutionPreset.medium`) if configured with +`ResolutionPreset.low`. ### Setting maximum duration and stream options for video capture From 6849640428448d2382989c6f4e2521d61f157d25 Mon Sep 17 00:00:00 2001 From: camsim99 Date: Sat, 11 May 2024 12:37:08 -0400 Subject: [PATCH 15/15] Add link --- packages/camera/camera/CHANGELOG.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/camera/camera/CHANGELOG.md b/packages/camera/camera/CHANGELOG.md index d8a5359aedd2..82d2e82c35e2 100644 --- a/packages/camera/camera/CHANGELOG.md +++ b/packages/camera/camera/CHANGELOG.md @@ -3,8 +3,7 @@ * **Breaking Change** Changes the Android implementation of the camera plugin from `camera_android` to `camera_android_camerax`, which has better support for a wider range of devices. The CameraX implementation full feature parity with `camera_android` except for the limitations listed in - `README.md`. To continue using `camera_android`, specify a dependency on `camera_android` in your - `pubspec.yaml`. + `README.md`. To continue using `camera_android`, follow [these instructions](https://pub.dev/packages/camera_android#usage). ## 0.10.6