DO NOT MERGE Camera: Enable session parameter handling for Rotate&Crop
Service managed settings like Rotate&Crop are overridden just
before they are sent to camera provider. The session update
logic runs prior to that so it cannot detect any modifications
for keys advertised as session parameters by CameraHal.
Refactor the parameter override logic so it can be triggered
before the request thread starts processing the requests.
Additionally consolidate the specific override logic so it
can be re-used by the parameter session filter during
stream configuration.
Specifically for Rotate&Crop incoming AUTO session
values will be overridden accordingly.
In case 'mOverrideToPortrait' is enabled, the Rotate&Crop
session parameter value will always include the configured
override.
Bug: 272528553
Test: Camera CTS,
Manual using Camera2Basic on CF with R&C set
to AUTO. The overridden filtered R&C session value is
NONE.
Change-Id: I685f32e15510d69b15dc2f4749068645a4d172a0
diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index cd214f6..e6073a9 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -581,6 +581,9 @@
// overriding of ROTATE_AND_CROP value and adjustment of coordinates
// in several other controls in both the request and the result
bool mRotateAndCropAuto;
+ // Indicates that the ROTATE_AND_CROP value within 'mSettingsList' was modified
+ // irrespective of the original value.
+ bool mRotateAndCropChanged = false;
// Whether this capture request has its zoom ratio set to 1.0x before
// the framework overrides it for camera HAL consumption.
@@ -767,6 +770,11 @@
*/
static nsecs_t getMonoToBoottimeOffset();
+ // Override rotate_and_crop control if needed
+ static bool overrideAutoRotateAndCrop(const sp<CaptureRequest> &request /*out*/,
+ bool overrideToPortrait,
+ camera_metadata_enum_android_scaler_rotate_and_crop_t rotateAndCropOverride);
+
struct RequestTrigger {
// Metadata tag number, e.g. android.control.aePrecaptureTrigger
uint32_t metadataTag;
@@ -917,7 +925,7 @@
status_t addFakeTriggerIds(const sp<CaptureRequest> &request);
// Override rotate_and_crop control if needed; returns true if the current value was changed
- bool overrideAutoRotateAndCrop(const sp<CaptureRequest> &request);
+ bool overrideAutoRotateAndCrop(const sp<CaptureRequest> &request /*out*/);
// Override test_pattern control if needed for camera mute; returns true
// if the current value was changed
@@ -1356,6 +1364,8 @@
// Whether the camera framework overrides the device characteristics for
// app compatibility reasons.
bool mOverrideToPortrait;
+ camera_metadata_enum_android_scaler_rotate_and_crop_t mRotateAndCropOverride;
+ bool mComposerOutput;
// Current active physical id of the logical multi-camera, if any
std::string mActivePhysicalId;