-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[camerax] Retrieve exposure and zoom camera information #3798
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
Conversation
} | ||
|
||
@Test | ||
@SuppressWarnings("unchecked") |
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 has to be used because I mock the generic type LiveData
, even with the cast.
public Long getZoomState(@NonNull Long identifier) { | ||
CameraInfo cameraInfo = | ||
(CameraInfo) Objects.requireNonNull(instanceManager.getInstance(identifier)); | ||
// TODO(camsim99): Create/return LiveData<ZoomState> once https://github.com/flutter/packages/pull/3419 lands. |
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 will fix this in that PR if this lands first if I have time. Otherwise, I'll file an issue and update this line in that PR.
@@ -269,6 +276,45 @@ class AndroidCameraCameraX extends CameraPlatform { | |||
}); | |||
} | |||
|
|||
/// Gets the minimum supported exposure offset for the selected camera in EV units. | |||
@override | |||
Future<double> getMinExposureOffset(int cameraId) async { |
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.
Why pass in a cameraId if the value is going to be ignored?
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 added comments about it not being used. I honestly don't know what the idea was behind passing it to some functions was, even though it's not used. I assume it was included in case any platforms needed access to it? @bparrishMines any insight?
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 wasn't involved when this feature was added, but I assume that it was included for other platform implementations and to follow the same pattern as the other methods.
@@ -42,14 +51,31 @@ class CameraInfoHostApiImpl extends CameraInfoHostApi { | |||
/// Maintains instances stored to communicate with native language objects. | |||
late final InstanceManager instanceManager; | |||
|
|||
/// Gets sensor orientation degrees of [CameraInfo]. | |||
/// Gets sensor orientation degrees of the specified [CameraInfo] instance. |
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 linking to the camerax documentation of sensor orientation.
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.
In the actual class, the documentation is linked, so I'm going to leave as is to avoid redundancy.
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.
Is this the object that dart callers will interact with?
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.
No, they'll interact with the CameraInfo
object.
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 class should probably be private, honestly
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.
No, they'll interact with the
CameraInfo
object.
This is a little confusing since this is camera_info.dart but consider my comment resolved.
Nonblocking for this pr. You might want to consider a pass where you make objects like this private or reduce their scope. After this is published those will be breaking changes.
return; | ||
} | ||
|
||
final Range<Integer> exposureCompensationRangeFromState = |
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 don't think this should block this PR, but I should move logic like this out of the create methods since they are constructor-adjacent.
flutter/packages@de6131d...f163786 2023-05-01 [email protected] [camerax] Retrieve exposure and zoom camera information (flutter/packages#3798) 2023-05-01 [email protected] Manual roll Flutter from 66fa4c5 to 828a040 (79 revisions) (flutter/packages#3874) 2023-05-01 [email protected] [video_player, google_sign_in] Updates functions without a prototype to avoid deprecation warning (flutter/packages#3873) 2023-05-01 [email protected] [various] Speed up build-examples (flutter/packages#3849) 2023-05-01 [email protected] [file_selector] Remove uses of `macUTIs` (flutter/packages#3859) 2023-05-01 [email protected] [file_selector] Add getDirectoryPaths implementation for macOS (flutter/packages#3703) 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
Implements retrieval of exposure and zoom camera information. Specifically, implements the following: - `getMinExposureOffset()` - `getMaxExposureOffset()` - `getExposureOffsetStepSize()` - `getMaxZoomLevel()` - `getMinZoomLevel()` Part of flutter/flutter#115846. Part of flutter/flutter#125371. Part of flutter/flutter#120468.
Implements retrieval of exposure and zoom camera information. Specifically, implements the following:
getMinExposureOffset()
getMaxExposureOffset()
getExposureOffsetStepSize()
getMaxZoomLevel()
getMinZoomLevel()
Part of flutter/flutter#115846.
Part of flutter/flutter#125371.
Part of flutter/flutter#120468.
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.///
).