From cb35ed23f3c7d3b03c4a6037f50934565ed8f030 Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Fri, 18 Dec 2020 16:28:43 +0100 Subject: android: camera_device: Report ColorFilterArrangement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Conditionally report the ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT property inspecting the draft property reported by the libcamera Camera. Reviewed-by: Paul Elder Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index b4618a68..bbf016c3 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -897,9 +897,12 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE, &sensitivityRange, 2); - uint16_t filterArr = ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG; - staticMetadata_->addEntry(ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, - &filterArr, 1); + /* Report the color filter arrangement if the camera reports it. */ + if (properties.contains(properties::draft::ColorFilterArrangement)) { + uint8_t filterArr = properties.get(properties::draft::ColorFilterArrangement); + staticMetadata_->addEntry(ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, + &filterArr, 1); + } int64_t exposureTimeRange[] = { 100000, 200000000, -- cgit v1.2.1