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

Hirokazu Honda hiroh at chromium.org
Mon Apr 26 05:02:24 CEST 2021


This skips executing post processings to unsuccessful buffers as
they are meaningless.

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_,
-- 
2.31.1.498.g6c1eba8ee3d-goog



More information about the libcamera-devel mailing list