summaryrefslogtreecommitdiff
path: root/src/android/camera_device.cpp
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2020-12-18 16:28:43 +0100
committerJacopo Mondi <jacopo@jmondi.org>2020-12-30 11:22:52 +0100
commitcb35ed23f3c7d3b03c4a6037f50934565ed8f030 (patch)
tree1eb0b778606d9890e3b0c5c97ce235c156fdfc5e /src/android/camera_device.cpp
parent0a0264da8d6d845b743fdf7ad1092aa26eccc547 (diff)
android: camera_device: Report ColorFilterArrangement
Conditionally report the ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT property inspecting the draft property reported by the libcamera Camera. Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'src/android/camera_device.cpp')
-rw-r--r--src/android/camera_device.cpp9
1 files 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,