summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-07-16 18:27:53 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-07-16 18:27:53 +0000
commitf9229c0dbd51aeb43a495930e11d2954338721d9 (patch)
tree8c464cdc944a094c477f1f701525fbffc356f561
parentd95b71ee87f6db066150f41fd34b419e905ea161 (diff)
parent6ff1cfdc949847110db3907a0a076b179eb90f76 (diff)
downloadcamera-android11-mainline-release.tar.gz
Change-Id: Ia4f05988f724b95a5948f77c397084f8abe91675
-rw-r--r--common/hal/utils/zsl_buffer_manager.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/hal/utils/zsl_buffer_manager.cc b/common/hal/utils/zsl_buffer_manager.cc
index 4855abf..9183476 100644
--- a/common/hal/utils/zsl_buffer_manager.cc
+++ b/common/hal/utils/zsl_buffer_manager.cc
@@ -407,6 +407,24 @@ void ZslBufferManager::GetMostRecentZslBuffers(
zsl_buffer_iter++;
}
+ // Fallback to realtime pipeline capture if there are any flash-fired frame
+ // in zsl buffers with AE_MODE_ON_AUTO_FLASH.
+ camera_metadata_ro_entry entry = {};
+ res = zsl_buffer_iter->second.metadata->Get(ANDROID_CONTROL_AE_MODE, &entry);
+ if (res == OK && entry.data.u8[0] == ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH) {
+ for (auto search_iter = filled_zsl_buffers_.begin();
+ search_iter != filled_zsl_buffers_.end(); search_iter++) {
+ res = search_iter->second.metadata->Get(ANDROID_FLASH_STATE, &entry);
+ if (res == OK && entry.count == 1) {
+ if (entry.data.u8[0] == ANDROID_FLASH_STATE_FIRED) {
+ ALOGD("%s: Returns empty zsl_buffers due to flash fired",
+ __FUNCTION__);
+ return;
+ }
+ }
+ }
+ }
+
for (uint32_t i = 0; i < num_buffers; i++) {
camera_metadata_ro_entry entry = {};
int64_t buffer_timestamp;