From a3c75bba84bac0a4f8a4c815cc7dcd9a72116c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= Date: Tue, 26 Jan 2021 18:17:06 +0100 Subject: cam: Only queue the exact number of requests asked for MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cam option --capture=N is suppose to only capture N requests. But if the processing done for each request is large (such as writing it to a slow disk) the current implementation could queue more than N requests before the exit condition is detected and capturing stopped. Solve this by only queueing N requests while still waiting for N requests to complete before exiting. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/cam/capture.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/cam/capture.h') diff --git a/src/cam/capture.h b/src/cam/capture.h index d21c95a2..c7c9dc00 100644 --- a/src/cam/capture.h +++ b/src/cam/capture.h @@ -32,6 +32,7 @@ public: private: int capture(libcamera::FrameBufferAllocator *allocator); + int queueRequest(libcamera::Request *request); void requestComplete(libcamera::Request *request); void processRequest(libcamera::Request *request); @@ -43,6 +44,7 @@ private: uint64_t last_; EventLoop *loop_; + unsigned int queueCount_; unsigned int captureCount_; unsigned int captureLimit_; -- cgit v1.2.1