diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-07-07 01:37:37 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-07-07 01:37:37 +0000 |
commit | 28fffb8daf5c7e4a97b908dd5851ff42a51c5e5b (patch) | |
tree | 580d558d50500db40c78d522be22609fa03f47a9 | |
parent | 1d5723b6b1d1deccabae03a96c17a38209e369a0 (diff) | |
parent | bc5aad627ad7dad4dd43ccfd5663835d267f8217 (diff) | |
download | camera-28fffb8daf5c7e4a97b908dd5851ff42a51c5e5b.tar.gz |
Snap for 8803894 from bc5aad627ad7dad4dd43ccfd5663835d267f8217 to mainline-permission-releaseaml_per_331913010aml_per_331812030aml_per_331710050aml_per_331611010aml_per_331512020aml_per_331411000aml_per_331313010aml_per_331115020aml_per_331019040aml_per_330912010android13-mainline-permission-release
Change-Id: Idec01c99e05e4a8d37b1371bd36bc2716fc0635e
-rw-r--r-- | common/hal/utils/result_dispatcher.cc | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/common/hal/utils/result_dispatcher.cc b/common/hal/utils/result_dispatcher.cc index 2d6d120..0a4832c 100644 --- a/common/hal/utils/result_dispatcher.cc +++ b/common/hal/utils/result_dispatcher.cc @@ -240,27 +240,29 @@ status_t ResultDispatcher::AddShutter(uint32_t frame_number, int64_t timestamp_ns, int64_t readout_timestamp_ns) { ATRACE_CALL(); - std::lock_guard<std::mutex> lock(result_lock_); + { + std::lock_guard<std::mutex> lock(result_lock_); - auto shutter_it = pending_shutters_.find(frame_number); - if (shutter_it == pending_shutters_.end()) { - ALOGE("%s: Cannot find the pending shutter for frame %u", __FUNCTION__, - frame_number); - return NAME_NOT_FOUND; - } + auto shutter_it = pending_shutters_.find(frame_number); + if (shutter_it == pending_shutters_.end()) { + ALOGE("%s: Cannot find the pending shutter for frame %u", __FUNCTION__, + frame_number); + return NAME_NOT_FOUND; + } - if (shutter_it->second.ready) { - ALOGE("%s: Already received shutter (%" PRId64 - ") for frame %u. New " - "timestamp %" PRId64, - __FUNCTION__, shutter_it->second.timestamp_ns, frame_number, - timestamp_ns); - return ALREADY_EXISTS; - } + if (shutter_it->second.ready) { + ALOGE("%s: Already received shutter (%" PRId64 + ") for frame %u. New " + "timestamp %" PRId64, + __FUNCTION__, shutter_it->second.timestamp_ns, frame_number, + timestamp_ns); + return ALREADY_EXISTS; + } - shutter_it->second.timestamp_ns = timestamp_ns; - shutter_it->second.readout_timestamp_ns = readout_timestamp_ns; - shutter_it->second.ready = true; + shutter_it->second.timestamp_ns = timestamp_ns; + shutter_it->second.readout_timestamp_ns = readout_timestamp_ns; + shutter_it->second.ready = true; + } { std::unique_lock<std::mutex> lock(notify_callback_lock_); is_result_shutter_updated_ = true; |