diff --git a/packages/camera/camera_android_camerax/CHANGELOG.md b/packages/camera/camera_android_camerax/CHANGELOG.md index 863f99b8aa80..17c007087abf 100644 --- a/packages/camera/camera_android_camerax/CHANGELOG.md +++ b/packages/camera/camera_android_camerax/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.4+1 + +* Adds empty implementation for `prepareForVideoRecording` since this optimization is not used on Android. + ## 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/lib/src/android_camera_camerax.dart b/packages/camera/camera_android_camerax/lib/src/android_camera_camerax.dart index b73ce0186bec..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 @@ -867,6 +867,15 @@ class AndroidCameraCameraX extends CameraPlatform { } } + /// Prepare the capture session for video recording. + /// + /// This optimization is not used on Android, so this implementation is a + /// no-op. + @override + Future prepareForVideoRecording() { + return Future.value(); + } + /// Configures and starts a video recording. Returns silently without doing /// anything if there is currently an active recording. /// 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 diff --git a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart index f0caef74a24c..23af67c5ca18 100644 --- a/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart +++ b/packages/camera/camera_android_camerax/test/android_camera_camerax_test.dart @@ -4040,4 +4040,22 @@ void main() { verify( camera.processCameraProvider!.unbind([camera.imageAnalysis!])); }); + + test( + 'prepareForVideoRecording does not make any calls involving starting video recording', + () async { + final AndroidCameraCameraX camera = AndroidCameraCameraX(); + + // Set directly for test versus calling createCamera. + camera.processCameraProvider = MockProcessCameraProvider(); + camera.recorder = MockRecorder(); + camera.videoCapture = MockVideoCapture(); + camera.camera = MockCamera(); + + await camera.prepareForVideoRecording(); + verifyNoMoreInteractions(camera.processCameraProvider); + verifyNoMoreInteractions(camera.recorder); + verifyNoMoreInteractions(camera.videoCapture); + verifyNoMoreInteractions(camera.camera); + }); }