Loading camera/camera_platform.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -280,3 +280,13 @@ flag { description: "Applies system controlled effects targetting video conferencing" bug: "376797335" } flag { namespace: "camera_platform" name: "metadata_resize_fix" description: "metadata resize during update needs to consider existing entry" bug: "379388099" metadata { purpose: PURPOSE_BUGFIX } } services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp +28 −2 Original line number Diff line number Diff line Loading @@ -499,7 +499,20 @@ AidlProviderInfo::AidlDeviceInfo3::AidlDeviceInfo3( int resV = validate_camera_metadata_structure(buffer, &expectedSize); if (resV == OK || resV == CAMERA_METADATA_VALIDATION_SHIFTED) { set_camera_metadata_vendor_id(buffer, mProviderTagid); if (flags::metadata_resize_fix()) { //b/379388099: Create a CameraCharacteristics object slightly larger //to accommodate framework addition/modification. This is to //optimize memory because the CameraMetadata::update() doubles the //memory footprint, which could be significant if original //CameraCharacteristics is already large. mCameraCharacteristics = { get_camera_metadata_entry_count(buffer) + CHARACTERISTICS_EXTRA_ENTRIES, get_camera_metadata_data_count(buffer) + CHARACTERISTICS_EXTRA_DATA_SIZE }; mCameraCharacteristics.append(buffer); } else { mCameraCharacteristics = buffer; } } else { ALOGE("%s: Malformed camera metadata received from HAL", __FUNCTION__); return; Loading Loading @@ -703,7 +716,20 @@ AidlProviderInfo::AidlDeviceInfo3::AidlDeviceInfo3( int res = validate_camera_metadata_structure(pBuffer, &expectedSize); if (res == OK || res == CAMERA_METADATA_VALIDATION_SHIFTED) { set_camera_metadata_vendor_id(pBuffer, mProviderTagid); if (flags::metadata_resize_fix()) { //b/379388099: Create a CameraCharacteristics object slightly larger //to accommodate framework addition/modification. This is to //optimize memory because the CameraMetadata::update() doubles the //memory footprint, which could be significant if original //CameraCharacteristics is already large. mPhysicalCameraCharacteristics[id] = { get_camera_metadata_entry_count(pBuffer) + CHARACTERISTICS_EXTRA_ENTRIES, get_camera_metadata_data_count(pBuffer) + CHARACTERISTICS_EXTRA_DATA_SIZE }; mPhysicalCameraCharacteristics[id].append(pBuffer); } else { mPhysicalCameraCharacteristics[id] = pBuffer; } } else { ALOGE("%s: Malformed camera metadata received from HAL", __FUNCTION__); return; Loading services/camera/libcameraservice/common/aidl/AidlProviderInfo.h +18 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,24 @@ struct AidlProviderInfo : public CameraProviderManager::ProviderInfo { }; ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; // Estimate based on the camera framework modification on camera // characteristics: // - Flash strength: 4 entries // - Dynamic depth: 6 entries // - Heic: 6 entries // - Rotation and crop: 1 entry // - Autoframing: 1 entry // - Pre-correction active array size: 1 entry // - Zoom ratio: 1 entry // - Readout timestamp: 1 entry // - color correction modes: 1 entry // - AE priority modes: 1 entry // - Torch strength level: 2 entries // - Session config query version: 1 entry // // Total: 26 entries. Round up to 64 entries. static constexpr size_t CHARACTERISTICS_EXTRA_ENTRIES = 64; static constexpr size_t CHARACTERISTICS_EXTRA_DATA_SIZE = 1024; // in bytes }; } // namespace android Loading Loading
camera/camera_platform.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -280,3 +280,13 @@ flag { description: "Applies system controlled effects targetting video conferencing" bug: "376797335" } flag { namespace: "camera_platform" name: "metadata_resize_fix" description: "metadata resize during update needs to consider existing entry" bug: "379388099" metadata { purpose: PURPOSE_BUGFIX } }
services/camera/libcameraservice/common/aidl/AidlProviderInfo.cpp +28 −2 Original line number Diff line number Diff line Loading @@ -499,7 +499,20 @@ AidlProviderInfo::AidlDeviceInfo3::AidlDeviceInfo3( int resV = validate_camera_metadata_structure(buffer, &expectedSize); if (resV == OK || resV == CAMERA_METADATA_VALIDATION_SHIFTED) { set_camera_metadata_vendor_id(buffer, mProviderTagid); if (flags::metadata_resize_fix()) { //b/379388099: Create a CameraCharacteristics object slightly larger //to accommodate framework addition/modification. This is to //optimize memory because the CameraMetadata::update() doubles the //memory footprint, which could be significant if original //CameraCharacteristics is already large. mCameraCharacteristics = { get_camera_metadata_entry_count(buffer) + CHARACTERISTICS_EXTRA_ENTRIES, get_camera_metadata_data_count(buffer) + CHARACTERISTICS_EXTRA_DATA_SIZE }; mCameraCharacteristics.append(buffer); } else { mCameraCharacteristics = buffer; } } else { ALOGE("%s: Malformed camera metadata received from HAL", __FUNCTION__); return; Loading Loading @@ -703,7 +716,20 @@ AidlProviderInfo::AidlDeviceInfo3::AidlDeviceInfo3( int res = validate_camera_metadata_structure(pBuffer, &expectedSize); if (res == OK || res == CAMERA_METADATA_VALIDATION_SHIFTED) { set_camera_metadata_vendor_id(pBuffer, mProviderTagid); if (flags::metadata_resize_fix()) { //b/379388099: Create a CameraCharacteristics object slightly larger //to accommodate framework addition/modification. This is to //optimize memory because the CameraMetadata::update() doubles the //memory footprint, which could be significant if original //CameraCharacteristics is already large. mPhysicalCameraCharacteristics[id] = { get_camera_metadata_entry_count(pBuffer) + CHARACTERISTICS_EXTRA_ENTRIES, get_camera_metadata_data_count(pBuffer) + CHARACTERISTICS_EXTRA_DATA_SIZE }; mPhysicalCameraCharacteristics[id].append(pBuffer); } else { mPhysicalCameraCharacteristics[id] = pBuffer; } } else { ALOGE("%s: Malformed camera metadata received from HAL", __FUNCTION__); return; Loading
services/camera/libcameraservice/common/aidl/AidlProviderInfo.h +18 −0 Original line number Diff line number Diff line Loading @@ -173,6 +173,24 @@ struct AidlProviderInfo : public CameraProviderManager::ProviderInfo { }; ndk::ScopedAIBinder_DeathRecipient mDeathRecipient; // Estimate based on the camera framework modification on camera // characteristics: // - Flash strength: 4 entries // - Dynamic depth: 6 entries // - Heic: 6 entries // - Rotation and crop: 1 entry // - Autoframing: 1 entry // - Pre-correction active array size: 1 entry // - Zoom ratio: 1 entry // - Readout timestamp: 1 entry // - color correction modes: 1 entry // - AE priority modes: 1 entry // - Torch strength level: 2 entries // - Session config query version: 1 entry // // Total: 26 entries. Round up to 64 entries. static constexpr size_t CHARACTERISTICS_EXTRA_ENTRIES = 64; static constexpr size_t CHARACTERISTICS_EXTRA_DATA_SIZE = 1024; // in bytes }; } // namespace android Loading