[libcamera-devel] [PATCH v2] android: camera_device: Set AE precapture trigger according to request

paul.elder at ideasonboard.com paul.elder at ideasonboard.com
Thu Jan 28 11:29:41 CET 2021


Hi me,

On Thu, Jan 28, 2021 at 07:21:40PM +0900, Paul Elder wrote:
> Set the AE precapture triggler tag in the android result metadata
> according to what was passed in the request metadata.
> 
> This allows the following CTS test to pass:
> - android.hardware.camera2.cts.StillCaptureTest#testAePrecaptureTriggerCancelJpegCapture
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> 
> ---
> Changes in v2:
> - move setting the tag to getResultMetadata()
> ---
>  src/android/camera_device.cpp | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 82bf0d3a..f5066709 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1965,8 +1965,11 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
>  				 aeFpsTarget.data(), aeFpsTarget.size());
>  
>  	value = ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER_IDLE;
> -	resultMetadata->addEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER,
> -				 &value, 1);
> +	camera_metadata_ro_entry_t entry;
> +	/* \todo Handle IPA appropriately */
> +	bool ret = descriptor->settings_.getEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER, &entry);
> +	resultMetadata->updateEntry(ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER,

This should be addEntry.

Paul

> +				    ret ? entry.data.u8 : &value, 1);
>  
>  	value = ANDROID_CONTROL_AE_STATE_CONVERGED;
>  	resultMetadata->addEntry(ANDROID_CONTROL_AE_STATE, &value, 1);
> @@ -2010,8 +2013,7 @@ CameraDevice::getResultMetadata(Camera3RequestDescriptor *descriptor,
>  	value = ANDROID_FLASH_STATE_UNAVAILABLE;
>  	resultMetadata->addEntry(ANDROID_FLASH_STATE, &value, 1);
>  
> -	camera_metadata_ro_entry_t entry;
> -	int ret = descriptor->settings_.getEntry(ANDROID_LENS_APERTURE, &entry);
> +	ret = descriptor->settings_.getEntry(ANDROID_LENS_APERTURE, &entry);
>  	if (ret)
>  		resultMetadata->addEntry(ANDROID_LENS_APERTURE, entry.data.f, 1);
>  
> -- 
> 2.27.0
> 


More information about the libcamera-devel mailing list