-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[camerax] Prevent using unsupported concurrent camera use cases #6608
Conversation
#getSupportedHardwareLevel, | ||
[identifier], | ||
), | ||
returnValue: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider a comment saying this is LIMITED. It could help in debugging later to know that the device might not have returned limited but we had an error. https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is generated code :/ I think it's just a mock value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I glossed over the code that appeared generated.
Just realized I didn't check for LIMITED level devices to disable image capture...just wanted to note I need to add this check + test before landing this! |
…ter#6608) Adds logic + documentation to prevent the usage of unsupported (by CameraX) concurrent camera use cases. The CameraX plugin should only support the concurrent camera use cases supported by Camerax; see [their documentation](https://developer.android.com/media/camera/camerax/architecture#combine-use-cases) for more information. To avoid the usage of unsupported concurrent use cases, this PR changes the plugin so that it behaves according to the following: * If the preview is paused (via `pausePreview`), concurrent video recording and image streaming (via `startVideoCapturing(cameraId, VideoCaptureOptions(streamCallback:...))`) is supported. * If the preview is not paused * **and** the camera device is at least supported hardware [`LIMITED`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED), then concurrent image capture and video recording is supported. * **and** the camera device is at least supported hardware [`LEVEL_3`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3), then concurrent video recording and image streaming is supported, but if used, concurrent image capture alongside this is not supported. Also changes `Surface` constants to match Dart style and small documentation nits I noticed. Fixes flutter/flutter#146395, fixes flutter/flutter#144414.
flutter/packages@2dfe645...5ccddfc 2024-05-06 15619084+vashworth@users.noreply.github.com [shared_preferences_foundation] Adds Swift Package Manager compatibility (flutter/packages#6640) 2024-05-06 stuartmorgan@google.com [file_selector] Add support for SPM (flutter/packages#6672) 2024-05-06 43054281+camsim99@users.noreply.github.com [camerax] Add empty implementation for `prepareForVideoRecording` not used on Android (flutter/packages#6676) 2024-05-06 stuartmorgan@google.com [ci] Reduce the number of tasks in recipe CQ (flutter/packages#6673) 2024-05-06 engine-flutter-autoroll@skia.org Roll Flutter from f1037a0 to 04424e1 (25 revisions) (flutter/packages#6674) 2024-05-06 43054281+camsim99@users.noreply.github.com [camerax] Prevent using unsupported concurrent camera use cases (flutter/packages#6608) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC flutter-ecosystem@google.com,rmistry@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ter#6608) Adds logic + documentation to prevent the usage of unsupported (by CameraX) concurrent camera use cases. The CameraX plugin should only support the concurrent camera use cases supported by Camerax; see [their documentation](https://developer.android.com/media/camera/camerax/architecture#combine-use-cases) for more information. To avoid the usage of unsupported concurrent use cases, this PR changes the plugin so that it behaves according to the following: * If the preview is paused (via `pausePreview`), concurrent video recording and image streaming (via `startVideoCapturing(cameraId, VideoCaptureOptions(streamCallback:...))`) is supported. * If the preview is not paused * **and** the camera device is at least supported hardware [`LIMITED`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED), then concurrent image capture and video recording is supported. * **and** the camera device is at least supported hardware [`LEVEL_3`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3), then concurrent video recording and image streaming is supported, but if used, concurrent image capture alongside this is not supported. Also changes `Surface` constants to match Dart style and small documentation nits I noticed. Fixes flutter/flutter#146395, fixes flutter/flutter#144414.
…to `camera_android_camerax` (flutter#6629) Breaking change: Changes default Android implementation from `camera_android` to `camera_android_camerax` via a breaking change and updates relevant documentation. ~<ins>**Note:**</ins> Planning to land this after flutter#6608, as it is a semi-crucial fix.~ Done :)
…ter#6608) Adds logic + documentation to prevent the usage of unsupported (by CameraX) concurrent camera use cases. The CameraX plugin should only support the concurrent camera use cases supported by Camerax; see [their documentation](https://developer.android.com/media/camera/camerax/architecture#combine-use-cases) for more information. To avoid the usage of unsupported concurrent use cases, this PR changes the plugin so that it behaves according to the following: * If the preview is paused (via `pausePreview`), concurrent video recording and image streaming (via `startVideoCapturing(cameraId, VideoCaptureOptions(streamCallback:...))`) is supported. * If the preview is not paused * **and** the camera device is at least supported hardware [`LIMITED`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_LIMITED), then concurrent image capture and video recording is supported. * **and** the camera device is at least supported hardware [`LEVEL_3`](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata#INFO_SUPPORTED_HARDWARE_LEVEL_3), then concurrent video recording and image streaming is supported, but if used, concurrent image capture alongside this is not supported. Also changes `Surface` constants to match Dart style and small documentation nits I noticed. Fixes flutter/flutter#146395, fixes flutter/flutter#144414.
…to `camera_android_camerax` (flutter#6629) Breaking change: Changes default Android implementation from `camera_android` to `camera_android_camerax` via a breaking change and updates relevant documentation. ~<ins>**Note:**</ins> Planning to land this after flutter#6608, as it is a semi-crucial fix.~ Done :)
Adds logic + documentation to prevent the usage of unsupported (by CameraX) concurrent camera use cases.
The CameraX plugin should only support the concurrent camera use cases supported by Camerax; see their documentation for more information. To avoid the usage of unsupported concurrent use cases, this PR changes the plugin so that it behaves according to the following:
pausePreview
), concurrent video recording and image streaming (viastartVideoCapturing(cameraId, VideoCaptureOptions(streamCallback:...))
) is supported.LIMITED
, then concurrentimage capture and video recording is supported.
LEVEL_3
, then concurrent video recording and image streaming is supported, but if used, concurrent image capture alongside this is not supported.Also changes
Surface
constants to match Dart style and small documentation nits I noticed.Fixes flutter/flutter#146395, fixes flutter/flutter#144414.
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style.///
).