[libcamera-devel] [PATCH 08/11] android: camera_device: Use abortRequest() instead of open-coding it
Jacopo Mondi
jacopo at jmondi.org
Mon Oct 18 18:33:23 CEST 2021
Hi Umang,
On Mon, Oct 18, 2021 at 06:59:20PM +0530, Umang Jain wrote:
> From: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
>
> Call abortRequest() in CameraDevice::requestComplete() instead of
> open-coding it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Indeed it seems the code is the same
Reviewed-by: Jacopo Mondi <jacopo at jmondi.org>
Thanks
j
> ---
> src/android/camera_device.cpp | 21 ++++++---------------
> 1 file changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index cd9e9fe2..216f29c2 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -831,6 +831,11 @@ void CameraDevice::abortRequest(Camera3RequestDescriptor *descriptor) const
> notifyError(descriptor->frameNumber_, nullptr, CAMERA3_MSG_ERROR_REQUEST);
>
> for (auto &buffer : descriptor->buffers_) {
> + /*
> + * Signal to the framework it has to handle fences that have not
> + * been waited on by setting the release fence to the acquire
> + * fence value.
> + */
> buffer.buffer.release_fence = buffer.buffer.acquire_fence;
> buffer.buffer.acquire_fence = -1;
> buffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;
> @@ -1111,21 +1116,7 @@ void CameraDevice::requestComplete(Request *request)
> << " not successfully completed: "
> << request->status();
>
> - notifyError(descriptor->frameNumber_, nullptr,
> - CAMERA3_MSG_ERROR_REQUEST);
> -
> - for (auto &buffer : descriptor->buffers_) {
> - /*
> - * Signal to the framework it has to handle fences that
> - * have not been waited on by setting the release fence
> - * to the acquire fence value.
> - */
> - buffer.buffer.release_fence = buffer.buffer.acquire_fence;
> - buffer.buffer.acquire_fence = -1;
> - buffer.buffer.status = CAMERA3_BUFFER_STATUS_ERROR;
> - }
> -
> - descriptor->status_ = Camera3RequestDescriptor::Status::Error;
> + abortRequest(descriptor);
> sendCaptureResults();
>
> return;
> --
> 2.31.0
>
More information about the libcamera-devel
mailing list