[libcamera-devel] [PATCH 4/7] android: camera_device: Report AF_MODE_OFF in template
Niklas Söderlund
niklas.soderlund at ragnatech.se
Thu Feb 4 10:29:58 CET 2021
Hi Jacopo,
Thanks for your work.
On 2021-02-03 17:25:57 +0100, Jacopo Mondi wrote:
> The CaptureResultTest#testCameraCaptureResultAllKeys CTS test
> enforces the presence of the auto focus mode in the preview
> request template.
>
> Add the only supported mode AF_MODE_OFF in the generated template.
>
> Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/android/camera_device.cpp | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 27f6ec109da9..fdda43e9b4af 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1306,7 +1306,7 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
> * \todo Keep this in sync with the actual number of entries.
> * Currently: 20 entries, 35 bytes
> */
> - CameraMetadata *requestTemplate = new CameraMetadata(20, 35);
> + CameraMetadata *requestTemplate = new CameraMetadata(21, 36);
> if (!requestTemplate->isValid()) {
> delete requestTemplate;
> return nullptr;
> @@ -1339,6 +1339,9 @@ CameraMetadata *CameraDevice::requestTemplatePreview()
> requestTemplate->addEntry(ANDROID_CONTROL_AE_ANTIBANDING_MODE,
> &aeAntibandingMode, 1);
>
> + uint8_t afMode = ANDROID_CONTROL_AF_MODE_OFF;
> + requestTemplate->addEntry(ANDROID_CONTROL_AF_MODE, &afMode, 1);
> +
> uint8_t afTrigger = ANDROID_CONTROL_AF_TRIGGER_IDLE;
> requestTemplate->addEntry(ANDROID_CONTROL_AF_TRIGGER,
> &afTrigger, 1);
> --
> 2.30.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list