diff options
author | Emilian Peev <epeev@google.com> | 2022-02-17 17:00:51 -0800 |
---|---|---|
committer | Emilian Peev <epeev@google.com> | 2022-02-23 00:26:22 +0000 |
commit | a8638f9583719ab06d9249149f0ad96c6f3ac094 (patch) | |
tree | 9f58de721c7886788721b2f19fd9aa6c0b46e581 | |
parent | 7e5a03537c30e3be2a43b58d89841b987616bf6f (diff) | |
download | camera-a8638f9583719ab06d9249149f0ad96c6f3ac094.tar.gz |
EmulatedCamera: Update the dynamic range profile map
The dynamic range profile map includes a new entry for
flagging extra latency. Extend the front and back device
static metadata accordingly.
Bug: 215396395
Test: Camera CTS
Change-Id: I42adc552b6242c8e82e33e532c72407762be776b
-rw-r--r-- | devices/EmulatedCamera/hwl/configs/emu_camera_back.json | 3 | ||||
-rw-r--r-- | devices/EmulatedCamera/hwl/configs/emu_camera_front.json | 9 | ||||
-rw-r--r-- | devices/EmulatedCamera/hwl/utils/HWLUtils.cpp | 12 |
3 files changed, 14 insertions, 10 deletions
diff --git a/devices/EmulatedCamera/hwl/configs/emu_camera_back.json b/devices/EmulatedCamera/hwl/configs/emu_camera_back.json index 1415a44..2280de9 100644 --- a/devices/EmulatedCamera/hwl/configs/emu_camera_back.json +++ b/devices/EmulatedCamera/hwl/configs/emu_camera_back.json @@ -197,7 +197,8 @@ ], "android.request.availableDynamicRangeProfilesMap": [ "2", - "2" + "2", + "0" ], "android.request.recommendedTenBitDynamicRangeProfile": [ "2" diff --git a/devices/EmulatedCamera/hwl/configs/emu_camera_front.json b/devices/EmulatedCamera/hwl/configs/emu_camera_front.json index 3461e0e..4a0207b 100644 --- a/devices/EmulatedCamera/hwl/configs/emu_camera_front.json +++ b/devices/EmulatedCamera/hwl/configs/emu_camera_front.json @@ -307,7 +307,8 @@ ], "android.request.availableDynamicRangeProfilesMap": [ "2", - "2" + "2", + "0" ], "android.request.recommendedTenBitDynamicRangeProfile": [ "2" @@ -1743,7 +1744,8 @@ ], "android.request.availableDynamicRangeProfilesMap": [ "2", - "2" + "2", + "0" ], "android.request.recommendedTenBitDynamicRangeProfile": [ "2" @@ -3200,7 +3202,8 @@ ], "android.request.availableDynamicRangeProfilesMap": [ "2", - "2" + "2", + "0" ], "android.request.recommendedTenBitDynamicRangeProfile": [ "2" diff --git a/devices/EmulatedCamera/hwl/utils/HWLUtils.cpp b/devices/EmulatedCamera/hwl/utils/HWLUtils.cpp index 1cbfb28..b444465 100644 --- a/devices/EmulatedCamera/hwl/utils/HWLUtils.cpp +++ b/devices/EmulatedCamera/hwl/utils/HWLUtils.cpp @@ -67,30 +67,30 @@ status_t GetSensorCharacteristics(const HalCameraMetadata* metadata, ANDROID_REQUEST_AVAILABLE_CAPABILITIES_DYNAMIC_RANGE_TEN_BIT)) { ret = metadata->Get(ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP, &entry); - if ((ret != OK) || ((entry.count % 2) != 0)) { + if ((ret != OK) || ((entry.count % 3) != 0)) { ALOGE("%s: Invalid ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP!", __FUNCTION__); return BAD_VALUE; } - for (size_t i = 0; i < entry.count; i += 2) { + for (size_t i = 0; i < entry.count; i += 3) { sensor_chars->dynamic_range_profiles.emplace( static_cast< camera_metadata_enum_android_request_available_dynamic_range_profiles_map>( - entry.data.i32[i]), + entry.data.i64[i]), std::unordered_set< camera_metadata_enum_android_request_available_dynamic_range_profiles_map>()); const auto profile_end = ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_DOLBY_VISION_8B_HDR_OEM_PO << 1; - uint32_t current_profile = + uint64_t current_profile = ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD; for (; current_profile != profile_end; current_profile <<= 1) { - if (entry.data.i32[i + 1] & current_profile) { + if (entry.data.i64[i + 1] & current_profile) { sensor_chars->dynamic_range_profiles .at(static_cast< camera_metadata_enum_android_request_available_dynamic_range_profiles_map>( - entry.data.i32[i])) + entry.data.i64[i])) .emplace( static_cast< camera_metadata_enum_android_request_available_dynamic_range_profiles_map>( |