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

[camerax] Wrap Android classes/methods required to set the exposure mode #5966

Merged
merged 25 commits into from
Feb 5, 2024

Conversation

camsim99
Copy link
Contributor

@camsim99 camsim99 commented Jan 23, 2024

Wraps classes/methods needed to set capture request options that will allow us to implement setting the exposure mode, namely:

Camera2CameraControl

CaptureRequestOptions

Part of flutter/flutter#120468.

*Note that this required that I specify types of supported capture request options due to the Dart/native split. I took inspiration from our previous implementation of supported LiveData types (see pigeon file for details).

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 marked this pull request as ready for review January 29, 2024 22:53
@camsim99 camsim99 requested a review from gmackall January 29, 2024 22:53
Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

Mostly lgtm, just a couple of minor comments!

/// was previously set, these options will override those pre-existing. Once
/// merged, these values will be submitted with every repeating and single
/// capture requests issued by CameraX.
Future<void> addCaptureRequestOptions(
Copy link
Member

Choose a reason for hiding this comment

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

non blocking: This PR is just wrapping the classes, but I am curious: Will we not need clearCaptureRequestOptions wrapped to return to an "unset exposure mode" state? Or does setting all the previously set options to null have the same effect?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not 100% sure that we don't need it, but I was just going to wrap it later if I do.

My understanding, though, is that using clearCaptureRequestOption, which I wrap for CaptureRequestOptions has the same effect, so that's why I didn't worry about it for now.

camsim99 and others added 8 commits February 5, 2024 09:35
…o/flutter/plugins/camerax/Camera2CameraControlHostApiImpl.java

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
…control.dart

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
…control.dart

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
…_options.dart

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
….dart

Co-authored-by: Gray Mackall <34871572+gmackall@users.noreply.github.com>
@camsim99 camsim99 requested a review from gmackall February 5, 2024 17:56
Copy link
Member

@gmackall gmackall left a comment

Choose a reason for hiding this comment

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

LGTM!

@camsim99 camsim99 added the autosubmit Merge PR when tree becomes green via auto submit App label Feb 5, 2024
@auto-submit auto-submit bot merged commit 1a5a7ce into flutter:main Feb 5, 2024
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Feb 6, 2024
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Feb 6, 2024
flutter/packages@ae3494d...1a5a7ce

2024-02-05 43054281+camsim99@users.noreply.github.com [camerax] Wrap Android classes/methods required to set the exposure mode (flutter/packages#5966)
2024-02-05 engine-flutter-autoroll@skia.org Manual roll Flutter from e02e207 to 0b5cd50 (46 revisions) (flutter/packages#6053)

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
arc-yong pushed a commit to Arctuition/packages-arc that referenced this pull request Jun 14, 2024
…ode (flutter#5966)

Wraps classes/methods needed to set capture request options that will allow us to implement setting the exposure mode, namely:

**Camera2CameraControl**

- `create` method using [`from`](https://developer.android.com/reference/androidx/camera/camera2/interop/Camera2CameraControl#from(androidx.camera.core.CameraControl))
- [`setCaptureRequestOptions`](https://developer.android.com/reference/androidx/camera/camera2/interop/Camera2CameraControl#setCaptureRequestOptions(androidx.camera.camera2.interop.CaptureRequestOptions))

**CaptureRequestOptions**

- `create` method using its [builder](https://developer.android.com/reference/androidx/camera/camera2/interop/CaptureRequestOptions.Builder)*

Part of flutter/flutter#120468.

*Note that this required that I specify types of supported capture request options due to the Dart/native split. I took inspiration from our previous implementation of supported `LiveData` types (see [pigeon file](https://github.com/flutter/packages/blob/73c9bdc59b8d51ee558bff113bcdcdb53485cd08/packages/camera/camera_android_camerax/pigeons/camerax_library.dart#L80) for details).
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.

3 participants