[libcamera-devel] [PATCH v3 05/10] android: camera_device: Store results metadata into Camera3RequestDescriptor
Jacopo Mondi
jacopo at jmondi.org
Tue Sep 21 13:13:14 CEST 2021
Hi Umang,
On Mon, Sep 20, 2021 at 11:07:47PM +0530, Umang Jain wrote:
> Store metadata which is sent as capture results into the
> Camera3RequestDescriptor. This is will remove the need to send the
> result metadata pointer separately to CameraStream::process().
> In the subsequent commit, a Camera3RequestDescriptor pointer
> will be passed to CameraStream::process() and the result metadata
> can be directly accessed from there.
>
> Signed-off-by: Umang Jain <umang.jain at ideasonboard.com>
> ---
> src/android/camera_device.cpp | 6 ++++--
> src/android/camera_device.h | 1 +
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 3d6a2bed..1ae4ac73 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1131,6 +1131,8 @@ void CameraDevice::requestComplete(Request *request)
> resultMetadata = std::make_unique<CameraMetadata>(0, 0);
> }
>
> + descriptor->resultMetadata_ = std::move(resultMetadata);
> +
Can't you
descriptor->resultMetadata_ = getResultMetadata(descriptor);
> /* Handle any JPEG compression. */
> for (camera3_stream_buffer_t &buffer : descriptor->buffers_) {
> CameraStream *cameraStream =
> @@ -1150,7 +1152,7 @@ void CameraDevice::requestComplete(Request *request)
>
> int ret = cameraStream->process(src, *buffer.buffer,
> descriptor->settings_,
> - resultMetadata.get());
> + descriptor->resultMetadata_.get());
It's probably more tedious work, as it requires fixing the whole post
processor hierarchy, but this could be just
cameraStream->process(src, *buffer.buffer,
descriptor);
> /*
> * Return the FrameBuffer to the CameraStream now that we're
> * done processing it.
> @@ -1165,7 +1167,7 @@ void CameraDevice::requestComplete(Request *request)
> }
> }
>
> - captureResult.result = resultMetadata->get();
> + captureResult.result = descriptor->resultMetadata_->get();
> callbacks_->process_capture_result(callbacks_, &captureResult);
>
> descriptors_.pop_front();
> diff --git a/src/android/camera_device.h b/src/android/camera_device.h
> index 59d6cd39..b2871e52 100644
> --- a/src/android/camera_device.h
> +++ b/src/android/camera_device.h
> @@ -47,6 +47,7 @@ struct Camera3RequestDescriptor {
> std::vector<std::unique_ptr<libcamera::FrameBuffer>> frameBuffers_;
> CameraMetadata settings_;
> std::unique_ptr<CaptureRequest> request_;
> + std::unique_ptr<CameraMetadata> resultMetadata_;
> };
>
> class CameraDevice : protected libcamera::Loggable
> --
> 2.31.1
>
More information about the libcamera-devel
mailing list