[libcamera-devel] android: CameraDevice: Skip post processings to unsuccessful buffers
diff mbox series

Message ID 20210426030224.2255533-1-hiroh@chromium.org
State Superseded
Headers show
Series
  • [libcamera-devel] android: CameraDevice: Skip post processings to unsuccessful buffers
Related show

Commit Message

Hirokazu Honda April 26, 2021, 3:02 a.m. UTC
This skips executing post processings to unsuccessful buffers as
they are meaningless.

Signed-off-by: Hirokazu Honda <hiroh@chromium.org>
---
 src/android/camera_device.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Laurent Pinchart May 25, 2021, 12:02 a.m. UTC | #1
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@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_,

Patch
diff mbox series

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_,