[libcamera-devel,v7,1/7] android: camera_stream: Replace post-processor nullptr check
diff mbox series

Message ID 20211025203833.122460-2-umang.jain@ideasonboard.com
State Superseded
Delegated to: Umang Jain
Headers show
Series
  • Async Post Processor
Related show

Commit Message

Umang Jain Oct. 25, 2021, 8:38 p.m. UTC
Instead of checking postProcessor for nullptr, replace this
check with an assertion that checks if the camera stream's
type is not Type::Direct. Since it makes no sense to call
CameraStream::process() on a Type::Direct camera stream.

Signed-off-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/android/camera_stream.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp
index f44a2717..5d991fe5 100644
--- a/src/android/camera_stream.cpp
+++ b/src/android/camera_stream.cpp
@@ -150,6 +150,8 @@  int CameraStream::process(const FrameBuffer &source,
 			  Camera3RequestDescriptor::StreamBuffer &dest,
 			  Camera3RequestDescriptor *request)
 {
+	ASSERT(type_ != Type::Direct);
+
 	/* Handle waiting on fences on the destination buffer. */
 	if (dest.fence != -1) {
 		int ret = waitFence(dest.fence);
@@ -163,9 +165,6 @@  int CameraStream::process(const FrameBuffer &source,
 		dest.fence = -1;
 	}
 
-	if (!postProcessor_)
-		return 0;
-
 	/*
 	 * \todo Buffer mapping and processing should be moved to a
 	 * separate thread.