[libcamera-devel] [PATCH 05/12] android: camera_device: Report EXPOSURE_TIME

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Jan 10 23:30:17 CET 2021


Hi Jacopo,

Thank you for the patch.

On Tue, Jan 05, 2021 at 08:05:15PM +0100, Jacopo Mondi wrote:
> Instead of reporting a fake value in the dynamic metadata for the
> EXPOSURE_TIME control, use the value provided by the pipeline.
> 
> The metadata is only meaningfull in FULL mode.
> 
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
>  src/android/camera_device.cpp | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index de3ead275e91..e6cee75581f2 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1871,11 +1871,6 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
>  	resultMetadata->addEntry(ANDROID_SENSOR_ROLLING_SHUTTER_SKEW,
>  				 &rolling_shutter_skew, 1);
>  
> -	/* 16.6 msec */
> -	const int64_t exposure_time = 16600000;
> -	resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME,
> -				 &exposure_time, 1);
> -
>  	const uint8_t lens_shading_map_mode =
>  				ANDROID_STATISTICS_LENS_SHADING_MAP_MODE_OFF;
>  	resultMetadata->addEntry(ANDROID_STATISTICS_LENS_SHADING_MAP_MODE,
> @@ -1893,6 +1888,12 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
>  					 &pipeline_depth, 1);
>  	}
>  
> +	if (metadata.contains(controls::ExposureTime)) {
> +		int32_t exposure = metadata.get(controls::ExposureTime);
> +		resultMetadata->addEntry(ANDROID_SENSOR_EXPOSURE_TIME,
> +					 &exposure, 1);
> +	}

It's a small patch, it may seem trivial, but lots of effort was required
to get to this point. It's very nice to see pieces falling into place,
good work !

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> +
>  	/*
>  	 * Return the result metadata pack even is not valid: get() will return
>  	 * nullptr.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list