libcamera/src/android
Umang Jain b1cefe38f3 android: post_processor: Make post processing async
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>
2021-10-26 16:11:17 +05:30
..
cros android: cros: Simplify integration 2021-06-25 16:09:46 +01:00
data android: nautilus: Add camera HAL configuration 2021-08-04 09:03:37 +05:30
jpeg android: post_processor: Drop return value for process() 2021-10-26 16:11:17 +05:30
metadata android: metadata: Add SPDX tag 2019-08-12 10:34:13 +02:00
mm android: mm: cros_camera_buffer: Log failure error on cleanup 2021-09-09 11:44:30 +05:30
yuv android: post_processor: Drop return value for process() 2021-10-26 16:11:17 +05:30
camera3_hal.cpp libcamera/base: Move extended base functionality 2021-06-25 16:11:08 +01:00
camera_buffer.h android: camera_buffer: Add stride/offset/size function 2021-08-27 00:52:32 +03:00
camera_capabilities.cpp android: capabilities: Cap frame rate to 30 FPS 2021-10-15 09:32:32 +02:00
camera_capabilities.h android: capabilities: Collect absolute max frame durations 2021-10-15 09:32:31 +02:00
camera_device.cpp android: post_processor: Make post processing async 2021-10-26 16:11:17 +05:30
camera_device.h android: Track and notify post processing of streams 2021-10-26 16:11:17 +05:30
camera_hal_config.cpp libcamera: base: extensible: Pass private pointer as unique_ptr<> 2021-08-16 23:57:27 +03:00
camera_hal_config.h libcamera/base: Move class helpers to the base library 2021-06-25 16:11:03 +01:00
camera_hal_manager.cpp android: Override camera as "Internal" provided found in HAL config 2021-08-04 09:03:33 +05:30
camera_hal_manager.h android: Disable copy and move for CameraHalManager 2021-07-06 19:58:36 +03:00
camera_metadata.cpp android: camera_metadata: Rename get() to getMetadata() 2021-10-19 19:17:31 +05:30
camera_metadata.h android: camera_metadata: Rename get() to getMetadata() 2021-10-19 19:17:31 +05:30
camera_ops.cpp android: Implement flush() camera operation 2021-06-14 12:26:28 +02:00
camera_ops.h android: Remove internal thread 2020-02-13 13:23:23 +02:00
camera_request.cpp android: post_processor: Consolidate contextual information 2021-10-26 16:11:17 +05:30
camera_request.h android: Track and notify post processing of streams 2021-10-26 16:11:17 +05:30
camera_stream.cpp android: post_processor: Make post processing async 2021-10-26 16:11:17 +05:30
camera_stream.h android: post_processor: Make post processing async 2021-10-26 16:11:17 +05:30
camera_worker.cpp android: camera_worker: Use Camera3RequestDescriptor as cookie 2021-09-30 18:28:36 +05:30
camera_worker.h android: camera_worker: Use Camera3RequestDescriptor as cookie 2021-09-30 18:28:36 +05:30
meson.build camera_device: Remove private scope of Camera3RequestDescriptor 2021-10-19 19:14:53 +05:30
post_processor.h android: post_processor: Drop return value for process() 2021-10-26 16:11:17 +05:30