[libcamera-devel] [PATCH] android: CameraDevice: Skip post processings to unsuccessful buffers

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue May 25 02:02:18 CEST 2021


Hi Hiro,

Thank you for the patch.

On Mon, Apr 26, 2021 at 12:02:24PM +0900, Hirokazu Honda wrote:
> This skips executing post processings to unsuccessful buffers as
> they are meaningless.

This conflicts with "[PATCH v3 0/8] Implement flush() camera operation".
That series already handles the case where the whole request fails.

We probably need to handle the case where only specific buffers fail,
that doesn't seem to be handled by Jacopo's series, neither for the
buffer that failed, nor for the buffers that should be produced from it
through reprocessing. Jacopo, is this correct ?

> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> ---
>  src/android/camera_device.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
> index a71aee2f..abb06810 100644
> --- a/src/android/camera_device.cpp
> +++ b/src/android/camera_device.cpp
> @@ -2064,6 +2064,9 @@ void CameraDevice::requestComplete(Request *request)
>  
>  	/* Handle any JPEG compression. */
>  	for (camera3_stream_buffer_t &buffer : descriptor.buffers_) {
> +		if (status == CAMERA3_BUFFER_STATUS_ERROR)
> +			continue;
> +
>  		CameraStream *cameraStream =
>  			static_cast<CameraStream *>(buffer.stream->priv);
>  
> @@ -2076,6 +2079,12 @@ void CameraDevice::requestComplete(Request *request)
>  			continue;
>  		}
>  
> +		if (src->metadata().status != FrameMetadata::FrameSuccess) {
> +			LOG(HAL, Debug) << "Skip post-processing because the "
> +					<< "buffer is not filled successfully";
> +			continue;
> +		}
> +
>  		int ret = cameraStream->process(*src,
>  						*buffer.buffer,
>  						descriptor.settings_,

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list