Commit 5602ac5d authored by Jasmine Chen's avatar Jasmine Chen Committed by Commit Bot

Update 3A states on every result metadata

We need to update 3A states on every result metadata. Previously when
the 3A stabilized callback wasn't set, camera 3A controller doesn't
update 3A states. This causes the 3A states to be incorrectly cached,
which then makes some requests being sent before 3A is actually
stabilized.

BUG=b:149355851
TEST=Tested on krane by capturing multiple photos and engaged
touch-to-focus to ensure it still functions nominally.

Change-Id: I43a3ef456a214cefdaf07cfb438c412bf6b5cd91
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2053269
Auto-Submit: Jasmine Chen <lnishan@google.com>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Commit-Queue: Jasmine Chen <lnishan@google.com>
Cr-Commit-Position: refs/heads/master@{#741015}
parent aaaf274a
...@@ -234,34 +234,32 @@ void Camera3AController::OnResultMetadataAvailable( ...@@ -234,34 +234,32 @@ void Camera3AController::OnResultMetadataAvailable(
base::TimeDelta::FromNanoseconds(sensor_timestamp[0])); base::TimeDelta::FromNanoseconds(sensor_timestamp[0]));
} }
if (af_mode_set_ && ae_mode_set_ && awb_mode_set_ && if (!af_mode_set_) {
!on_3a_stabilized_callback_ && !on_af_trigger_cancelled_callback_) { cros::mojom::AndroidControlAfMode af_mode;
// Process the result metadata only when we need to check if 3A modes are if (Get3AEntry(result_metadata,
// synchronized, or when there's a pending 3A stabilization request. cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AF_MODE,
return; &af_mode)) {
af_mode_set_ = (af_mode == af_mode_);
} else {
DVLOG(2) << "AF mode is not available in the metadata";
}
} }
cros::mojom::AndroidControlAfMode af_mode;
if (Get3AEntry(result_metadata,
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AF_MODE,
&af_mode)) {
af_mode_set_ = (af_mode == af_mode_);
} else {
DVLOG(2) << "AF mode is not available in the metadata";
}
if (!Get3AEntry(result_metadata, if (!Get3AEntry(result_metadata,
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AF_STATE, cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AF_STATE,
&af_state_)) { &af_state_)) {
DVLOG(2) << "AF state is not available in the metadata"; DVLOG(2) << "AF state is not available in the metadata";
} }
cros::mojom::AndroidControlAeMode ae_mode; if (!ae_mode_set_) {
if (Get3AEntry(result_metadata, cros::mojom::AndroidControlAeMode ae_mode;
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AE_MODE, if (Get3AEntry(result_metadata,
&ae_mode)) { cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AE_MODE,
ae_mode_set_ = (ae_mode == ae_mode_); &ae_mode)) {
} else { ae_mode_set_ = (ae_mode == ae_mode_);
DVLOG(2) << "AE mode is not available in the metadata"; } else {
DVLOG(2) << "AE mode is not available in the metadata";
}
} }
if (!Get3AEntry(result_metadata, if (!Get3AEntry(result_metadata,
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AE_STATE, cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AE_STATE,
...@@ -269,13 +267,15 @@ void Camera3AController::OnResultMetadataAvailable( ...@@ -269,13 +267,15 @@ void Camera3AController::OnResultMetadataAvailable(
DVLOG(2) << "AE state is not available in the metadata"; DVLOG(2) << "AE state is not available in the metadata";
} }
cros::mojom::AndroidControlAwbMode awb_mode; if (!awb_mode_set_) {
if (Get3AEntry(result_metadata, cros::mojom::AndroidControlAwbMode awb_mode;
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AWB_MODE, if (Get3AEntry(result_metadata,
&awb_mode)) { cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AWB_MODE,
awb_mode_set_ = (awb_mode == awb_mode_); &awb_mode)) {
} else { awb_mode_set_ = (awb_mode == awb_mode_);
DVLOG(2) << "AWB mode is not available in the metadata"; } else {
DVLOG(2) << "AWB mode is not available in the metadata";
}
} }
if (!Get3AEntry(result_metadata, if (!Get3AEntry(result_metadata,
cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AWB_STATE, cros::mojom::CameraMetadataTag::ANDROID_CONTROL_AWB_STATE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment