Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0e59dbc
Fixes flutter/flutter#148013: setDescriptionWhileRecording with andro…
blackorbs-dev Aug 24, 2025
fcc11be
Fixes flutter/flutter#148013: updated Version and Changelog
blackorbs-dev Aug 24, 2025
971ebc8
Address review feedback: code fix
blackorbs-dev Aug 25, 2025
87c985e
Address review feedback: implement code fixes and suggestions
blackorbs-dev Aug 25, 2025
80d3c61
Merge branch 'main' into fix-issue-148013
blackorbs-dev Aug 27, 2025
0461e63
Update camera_android_camerax readme, revert changes for unaffected c…
blackorbs-dev Aug 27, 2025
f4a076d
Merge branch 'main' into fix-issue-148013
blackorbs-dev Aug 27, 2025
1a8397e
Merge branch 'main' into fix-issue-148013
blackorbs-dev Aug 28, 2025
a631f15
fix merge issue with main
blackorbs-dev Aug 28, 2025
4eece12
update version and changelog
blackorbs-dev Aug 28, 2025
3ac789c
Implement code fixes and suggestions
blackorbs-dev Aug 29, 2025
53e3aa3
Merge branch 'main' into fix-issue-148013
blackorbs-dev Aug 29, 2025
8fbb01c
Address some nits
blackorbs-dev Sep 3, 2025
41aac10
Merge branch 'main' into fix-issue-148013
blackorbs-dev Sep 3, 2025
b1c2ac1
Reformat merge from main
blackorbs-dev Sep 3, 2025
1ddc209
Merge branch 'main' into fix-issue-148013
blackorbs-dev Sep 9, 2025
3b2164f
checkout camera_avfoundation to upstream main
blackorbs-dev Sep 9, 2025
d73bccb
update camera_android_camerax readme
blackorbs-dev Sep 9, 2025
69eb480
Merge branch 'main' into fix-issue-148013
blackorbs-dev Sep 10, 2025
3e799c2
implement version bump for camera_platform_interface
blackorbs-dev Sep 11, 2025
5520c89
implement changes for platform consistency
blackorbs-dev Sep 11, 2025
8614a35
format code changes
blackorbs-dev Sep 11, 2025
d9ce45b
platform changes for setDescriptionWhileRecording with android camerax
blackorbs-dev Sep 13, 2025
5bc3992
platform changes for setDescriptionWhileRecording with android camerax
blackorbs-dev Sep 13, 2025
34f3862
Merge branch 'main' into split-camera-interface
blackorbs-dev Sep 13, 2025
8d971a4
update doc and changelog
blackorbs-dev Sep 13, 2025
3373107
Merge branch 'main' into split-camera-interface
blackorbs-dev Sep 16, 2025
3a74560
update changelog
blackorbs-dev Sep 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Address some nits
  • Loading branch information
blackorbs-dev committed Sep 3, 2025
commit 8fbb01c5f4d04e5e7d8e6d69d3055f34cb6f001d
6 changes: 3 additions & 3 deletions packages/camera/camera/lib/src/camera_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,9 +439,9 @@ class CameraController extends ValueNotifier<CameraValue> {

/// Sets the description of the camera.
///
/// On Android, calling this method will normally cancel any active recording.
/// To avoid this, start the recording with [startVideoRecording]
/// and set `enablePersistentRecording` to `true`.
/// On Android, you must start the recording with [startVideoRecording]
/// with `enablePersistentRecording` set to `true`
/// to avoid cancelling any active recording.
///
/// Throws a [CameraException] if setting the description fails.
Future<void> setDescription(CameraDescription description) async {
Expand Down
10 changes: 6 additions & 4 deletions packages/camera/camera_android_camerax/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ use cases, the plugin behaves according to the following:
video recording and image streaming is supported, but concurrent video recording, image
streaming, and image capture is not supported.

### setDescriptionWhileRecording
`setDescriptionWhileRecording`, used to switch cameras while recording video. Calling this method will normally cancel any active recording.
To avoid this, start the recording with `startVideoCapturing` and set `enablePersistentRecording` of `VideoCaptureOptions` to `true`.

### 240p resolution configuration for video recording

240p resolution configuration for video recording is unsupported by CameraX, and thus,
Expand Down Expand Up @@ -88,6 +84,12 @@ As of Android 14, to allow for background image streaming, you will need to spec
</manifest>
```

### Notes on video capture

#### Setting description while recording
To avoid cancelling any active recording when calling `setDescriptionWhileRecording`,
you must start the recording with `startVideoCapturing` with `enablePersistentRecording` set to `true`.

#### Configuring NV21 image format

If you initialize a `CameraController` with `ImageFormatGroup.nv21`, then streamed images will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,11 +245,7 @@ void main() {
await controller.initialize();
await controller.prepareForVideoRecording();

if (Platform.isAndroid) {
await controller.startVideoRecording(enablePersistentRecording: true);
} else {
await controller.startVideoRecording();
}
await controller.startVideoRecording(enablePersistentRecording: true);

await controller.setDescription(cameras[1]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -927,9 +927,9 @@ class AndroidCameraCameraX extends CameraPlatform {

/// Sets the active camera while recording.
///
/// Calling this method will normally cancel any active recording.
/// To avoid this, start the recording with [startVideoCapturing]
/// and set `enablePersistentRecording` of [VideoCaptureOptions] to `true`.
/// To avoid cancelling any active recording when this method is called,
/// you must start the recording with [startVideoCapturing]
/// with `enablePersistentRecording` set to `true`.
@override
Future<void> setDescriptionWhileRecording(
CameraDescription description,
Expand All @@ -950,7 +950,7 @@ class AndroidCameraCameraX extends CameraPlatform {
cameraInfoForFilter: chosenCameraInfo,
);

// unbind all use cases and rebind to new cameraSelector
// Unbind all use cases and rebind to new CameraSelector
final List<UseCase> useCases = <UseCase>[preview!, videoCapture!];
if (imageCapture != null &&
await processCameraProvider!.isBound(imageCapture!)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,9 @@ abstract class CameraPlatform extends PlatformInterface {

/// Sets the active camera while recording.
///
/// On Android, calling this method will normally cancel any active recording.
/// To avoid this, start the recording with [startVideoCapturing]
/// and set `enablePersistentRecording` of [VideoCaptureOptions] to `true`.
/// On Android, you must start the recording with [startVideoCapturing]
/// with `enablePersistentRecording` set to `true`
/// to avoid cancelling any active recording.
Future<void> setDescriptionWhileRecording(CameraDescription description) {
throw UnimplementedError(
'setDescriptionWhileRecording() is not implemented.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class VideoCaptureOptions {
/// A persistent recording will only be stopped by explicitly calling [CameraController.stopVideoRecording]
/// and will ignore events that would normally cause recording to stop, such as lifecycle events.
///
/// **Note:** On Android, calling [CameraController.setDescription] will normally cancel any active recording.
/// To avoid this, set this parameter to `true`.
/// On Android, you must set this parameter to `true`
/// to avoid cancelling any active recording when calling [CameraController.setDescription].
///
/// Defaults to `false`.
final bool enablePersistentRecording;
Expand Down