[libcamera-devel] [PATCH v2 5/9] android: camera_device: Report ColorFilterArrangement

Jacopo Mondi jacopo at jmondi.org
Fri Dec 18 17:47:50 CET 2020


Report the ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT property
inspecting the draft property reported by the libcamera Camera.

Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
 src/android/camera_device.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index 1c7bf4ed8073..bad8a51ae7f7 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -897,7 +897,10 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()
 	staticMetadata_->addEntry(ANDROID_SENSOR_INFO_SENSITIVITY_RANGE,
 				  &sensitivityRange, 2);
 
+	/* Report the color filter arrangement: default it to GRBG. */
 	uint16_t filterArr = ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_GRBG;
+	if (properties.contains(properties::draft::ColorFilterArrangement))
+		filterArr = properties.get(properties::draft::ColorFilterArrangement);
 	staticMetadata_->addEntry(ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
 				  &filterArr, 1);
 
-- 
2.29.2



More information about the libcamera-devel mailing list