summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJimiChen <jimichen@google.com>2020-02-13 21:41:44 +0800
committerErik Cheng <erikcheng@google.com>2020-07-15 03:49:14 +0000
commit3af4327697c6710a7f1839cbf33faa55634c3dee (patch)
tree8c464cdc944a094c477f1f701525fbffc356f561
parent12b57f330aff7d91eb8ba4603ab6200a87a4ba91 (diff)
downloadplatform_hardware_google_camera-android11-dev.tar.gz
platform_hardware_google_camera-android11-dev.tar.bz2
platform_hardware_google_camera-android11-dev.zip
camera: fallback realtime pipeline capture when AE_ON_AUTO_FLASH andandroid11-dev
flash fired Bug: 147208294 Bug: 160556402 Test: cts, whatsapp, skype Change-Id: I10043ee2456b16e129be80ad3f40180aef2fa530 (cherry picked from commit 9df713161def7e81b69c29b0b02b067762c442b3)
-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;