Skip to content
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

[camera_android] Support concurrently image capture and image streaming #4332

Merged
merged 43 commits into from
Jun 30, 2023

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Jun 27, 2023

Properly configures surface needed for image capture when image streaming/recording is started to support concurrently still capture and image streaming.

Fixes flutter/flutter#125314.

Apologies for the many commits :(

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the package surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

@camsim99 camsim99 changed the title Xi debug [camera_android] Support concurrently image capture and image streaming Jun 27, 2023
if (image == null) {
return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated fix: acquireNextImage may return null, so added null check.

@@ -659,7 +669,6 @@ public void onCaptureCompleted(
};

try {
captureSession.stopRepeating();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated fix: This call should not be necessary for still capture to proceed.

@camsim99 camsim99 marked this pull request as ready for review June 28, 2023 21:25
Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I believe we were originally concerned with attempting preview, image streaming, and still image capture simultaneously due to hardware limitations on some devices. But it looks like all hardware supports all three simultaneously: https://developer.android.com/reference/android/hardware/camera2/CameraDevice#regular-capture.

However they can be limited by resolutions.

@camsim99
Copy link
Contributor Author

I believe we were originally concerned with attempting preview, image streaming, and still image capture simultaneously due to hardware limitations on some devices. But it looks like all hardware supports all three simultaneously:

Oh, I did not realize this, but that context makes sense. Definitely good to be aware of, though, if we start seeing related bugs. Thanks!

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 30, 2023
@auto-submit auto-submit bot merged commit d6e0d1f into flutter:main Jun 30, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 3, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 3, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jul 3, 2023
flutter/packages@53ed5a0...cdae854

2023-07-01 [email protected] Roll Flutter from ff838bc to aa5f4a2 (29 revisions) (flutter/packages#4363)
2023-07-01 [email protected] [tool] Add a flag to skip cleanup (flutter/packages#4357)
2023-07-01 [email protected] [file_selector] Endorse Android (flutter/packages#4329)
2023-07-01 [email protected] [google_sign_in] Convert Android to Pigeon (flutter/packages#4344)
2023-06-30 [email protected] [Pigeon] readme updates (flutter/packages#3705)
2023-06-30 [email protected] [camera_android] Support concurrently image capture and image streaming (flutter/packages#4332)
2023-06-30 [email protected] Prepare for utf8.encode() to return more precise Uint8List type (flutter/packages#4342)
2023-06-30 [email protected] [shared_preferences] Adds allowList to setPrefix method. (flutter/packages#3794)
2023-06-30 [email protected] Roll Flutter from 51bef1b to ff838bc (12 revisions) (flutter/packages#4346)

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 [email protected],[email protected] 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: camera platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Camera] CameraController.takePicture() crashes due to Unconfigured Input/Output Surface
3 participants