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

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Tue Dec 29 05:53:43 CET 2020


Hi Jacopo,

On Mon, Dec 28, 2020 at 05:40:02PM +0100, Jacopo Mondi wrote:
> Conditionally report the ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
> property inspecting the draft property reported by the libcamera Camera.
> 
> Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>

Reviewed-by: Paul Elder <paul.elder at ideasonboard.com>

> ---
>  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 b4618a680f41..bbf016c323a7 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,
> -- 
> 2.29.2
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel


More information about the libcamera-devel mailing list