mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 15:53:54 +03:00
Introduce a dedicated worker class derived from libcamera::Thread. The worker class maintains a queue for post-processing requests and waits for a post-processing request to become available. It will process them as per FIFO before de-queuing it from the queue. The entire post-processing handling iteration is locked under streamsProcessMutex_ which helps us to queue all the post-processing request at once, before any of the post-processing completion slot (streamProcessingComplete()) is allowed to run for post-processing requests completing in parallel. This helps us to manage both synchronous and asynchronous errors encountered during the entire post processing operation. Since a post-processing operation can even complete after CameraDevice::requestComplete() has returned, we need to check and complete the descriptor from streamProcessingComplete() running in the PostProcessorWorker's thread. This patch also implements a flush() for the PostProcessorWorker class which is responsible to purge post-processing requests queued up while a camera is stopping/flushing. It is hooked with CameraStream::flush(), which isn't used currently but will be used when we handle flush/stop scenarios in greater detail subsequently (in a different patchset). The libcamera request completion handler CameraDevice::requestComplete() assumes that the request that has just completed is at the front of the queue. Now that the post-processor runs asynchronously, this isn't true anymore, a request being post-processed will stay in the queue and a new libcamera request may complete. Remove that assumption, and use the request cookie to obtain the Camera3RequestDescriptor. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
||
---|---|---|
.. | ||
cros | ||
data | ||
jpeg | ||
metadata | ||
mm | ||
yuv | ||
camera3_hal.cpp | ||
camera_buffer.h | ||
camera_capabilities.cpp | ||
camera_capabilities.h | ||
camera_device.cpp | ||
camera_device.h | ||
camera_hal_config.cpp | ||
camera_hal_config.h | ||
camera_hal_manager.cpp | ||
camera_hal_manager.h | ||
camera_metadata.cpp | ||
camera_metadata.h | ||
camera_ops.cpp | ||
camera_ops.h | ||
camera_request.cpp | ||
camera_request.h | ||
camera_stream.cpp | ||
camera_stream.h | ||
camera_worker.cpp | ||
camera_worker.h | ||
meson.build | ||
post_processor.h |