[libcamera-devel] [PATCH v2 5/9] android: camera_device: Create the Request and Camera3RequestDescriptor together
Niklas Söderlund
niklas.soderlund at ragnatech.se
Fri Jul 3 01:26:35 CEST 2020
Hi Kieran,
Thanks for your work.
On 2020-07-02 22:36:50 +0100, Kieran Bingham wrote:
> Move the construction of the Request higher in the code flow
> so that multiple buffers and streams can be added where required.
>
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> src/android/camera_device.cpp | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index 78ecfd7c2ee2..77083219d8a1 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -1066,6 +1066,10 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
> Camera3RequestDescriptor *descriptor =
> new Camera3RequestDescriptor(camera3Request->frame_number,
> camera3Request->num_output_buffers);
> +
> + Request *request =
> + camera_->createRequest(reinterpret_cast<uint64_t>(descriptor));
> +
> for (unsigned int i = 0; i < descriptor->numBuffers; ++i) {
> /*
> * Keep track of which stream the request belongs to and store
> @@ -1085,12 +1089,11 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
> FrameBuffer *buffer = newFrameBuffer(*camera3Buffers[0].buffer);
> if (!buffer) {
> LOG(HAL, Error) << "Failed to create buffer";
> + delete request;
> delete descriptor;
> return -ENOMEM;
> }
>
> - Request *request =
> - camera_->createRequest(reinterpret_cast<uint64_t>(descriptor));
> request->addBuffer(stream, buffer);
>
> int ret = camera_->queueRequest(request);
> --
> 2.25.1
>
> _______________________________________________
> 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