[libcamera-devel] [PATCH v5 8/9] android: Add skeletal still and manual request templates
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Sun Jul 25 03:02:23 CEST 2021
Hi Paul,
Thank you for the patch.
On Tue, Jul 20, 2021 at 07:13:06PM +0900, Paul Elder wrote:
> Add skeletal still and manual request templates so that we can expand
> them for FULL support.
>
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
> ---
> src/android/camera_capabilities.cpp | 18 ++++++++++++++++++
> src/android/camera_capabilities.h | 2 ++
> src/android/camera_device.cpp | 7 +++++--
> 3 files changed, 25 insertions(+), 2 deletions(-)
>
> diff --git a/src/android/camera_capabilities.cpp b/src/android/camera_capabilities.cpp
> index 4048a94b..8c425138 100644
> --- a/src/android/camera_capabilities.cpp
> +++ b/src/android/camera_capabilities.cpp
> @@ -1445,3 +1445,21 @@ std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateVideo() const
>
> return previewTemplate;
> }
> +
> +std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateStill() const
> +{
> + std::unique_ptr<CameraMetadata> stillTemplate = requestTemplatePreview();
> + if (!stillTemplate)
> + return nullptr;
> +
> + return stillTemplate;
> +}
> +
> +std::unique_ptr<CameraMetadata> CameraCapabilities::requestTemplateManual() const
> +{
> + std::unique_ptr<CameraMetadata> manualTemplate = requestTemplatePreview();
> + if (!manualTemplate)
> + return nullptr;
> +
> + return manualTemplate;
> +}
> diff --git a/src/android/camera_capabilities.h b/src/android/camera_capabilities.h
> index e0c2786b..b9395544 100644
> --- a/src/android/camera_capabilities.h
> +++ b/src/android/camera_capabilities.h
> @@ -34,6 +34,8 @@ public:
>
> std::unique_ptr<CameraMetadata> requestTemplatePreview() const;
> std::unique_ptr<CameraMetadata> requestTemplateVideo() const;
> + std::unique_ptr<CameraMetadata> requestTemplateStill() const;
> + std::unique_ptr<CameraMetadata> requestTemplateManual() const;
I'd sort these alphabetically. Apart from that,
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> private:
> LIBCAMERA_DISABLE_COPY_AND_MOVE(CameraCapabilities)
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 678cde23..692d0a5b 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -487,7 +487,7 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
> * for the torch mode we currently do not support.
> */
> captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_STILL_CAPTURE;
> - requestTemplate = capabilities_.requestTemplatePreview();
> + requestTemplate = capabilities_.requestTemplateStill();
> break;
> case CAMERA3_TEMPLATE_VIDEO_RECORD:
> captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_RECORD;
> @@ -497,9 +497,12 @@ const camera_metadata_t *CameraDevice::constructDefaultRequestSettings(int type)
> captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_VIDEO_SNAPSHOT;
> requestTemplate = capabilities_.requestTemplateVideo();
> break;
> + case CAMERA3_TEMPLATE_MANUAL:
> + captureIntent = ANDROID_CONTROL_CAPTURE_INTENT_MANUAL;
> + requestTemplate = capabilities_.requestTemplateManual();
> + break;
> /* \todo Implement templates generation for the remaining use cases. */
> case CAMERA3_TEMPLATE_ZERO_SHUTTER_LAG:
> - case CAMERA3_TEMPLATE_MANUAL:
> default:
> LOG(HAL, Error) << "Unsupported template request type: " << type;
> return nullptr;
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list