summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-20 20:27:41 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-20 20:27:41 +0000
commit28570d822b5f5e78d0a38b2aefb93dae1a3fc2ce (patch)
tree580d558d50500db40c78d522be22609fa03f47a9
parent564f651158bfde9b6889e243d81b2fcbc853471f (diff)
parentbc5aad627ad7dad4dd43ccfd5663835d267f8217 (diff)
downloadcamera-aml_art_331314010.tar.gz
Change-Id: I303dbaf10bfd06eeec97f3bae9d1309ae5deaf0c
-rw-r--r--common/hal/aidl_service/aidl_camera_provider.cc6
-rw-r--r--common/hal/utils/result_dispatcher.cc38
-rw-r--r--devices/EmulatedCamera/hwl/configs/emu_camera_back.json2
3 files changed, 27 insertions, 19 deletions
diff --git a/common/hal/aidl_service/aidl_camera_provider.cc b/common/hal/aidl_service/aidl_camera_provider.cc
index 91bc2c4..7eac3f2 100644
--- a/common/hal/aidl_service/aidl_camera_provider.cc
+++ b/common/hal/aidl_service/aidl_camera_provider.cc
@@ -181,6 +181,12 @@ status_t AidlCameraProvider::Initialize() {
ScopedAStatus AidlCameraProvider::setCallback(
const std::shared_ptr<ICameraProviderCallback>& callback) {
+ if (callback == nullptr) {
+ ALOGE("AidlCameraProvider::setCallback() called with nullptr");
+ return ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Status::ILLEGAL_ARGUMENT));
+ }
+
bool first_time = false;
{
std::unique_lock<std::mutex> lock(callbacks_lock_);
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;
diff --git a/devices/EmulatedCamera/hwl/configs/emu_camera_back.json b/devices/EmulatedCamera/hwl/configs/emu_camera_back.json
index 2280de9..97318f8 100644
--- a/devices/EmulatedCamera/hwl/configs/emu_camera_back.json
+++ b/devices/EmulatedCamera/hwl/configs/emu_camera_back.json
@@ -197,7 +197,7 @@
],
"android.request.availableDynamicRangeProfilesMap": [
"2",
- "2",
+ "3",
"0"
],
"android.request.recommendedTenBitDynamicRangeProfile": [