[libcamera-devel,v7,0/7] Async Post Processor
mbox series

Message ID 20211025203833.122460-1-umang.jain@ideasonboard.com
Headers show
Series
  • Async Post Processor
Related show

Message

Umang Jain Oct. 25, 2021, 8:38 p.m. UTC
This series primarily introduces a Thread worker class along
with a queue, in which request for post-process of streams
are queued and processed ansychronously. All the context information
is carried via Camera3RequestDescriptor.

1/7 and 2/7 are improved !nullptr checks that were spotted in previous
review.

3/7 under takes a refactor of splitting Camera3RequestDescriptor::Status
to denote only status(success/error). The "pending" status is de-coupled
into a separate variable now.

4/7 Consolidates all the information we need to run the post-processor
into Camera3RequestDescriptor::Stream. Now use this structure only and
update signature of PostProcessor::process() vfunc.

5/7 Introduces a post-processing request tracking std::map and a signal
of completion. The tracking map will help us to know if there are
multiple post-processing streams per descriptor (i.e. capture request).
If so, we need to wait, track until all streams are processed. Only
then we can mark descriptor for completion.

6/7 is a small inherent patch based on 5/7's change 

7/7 is where a post-processor's worker class is introduced. At this
point, the post-processor will run asynchronously.

Changes v6 -> v7:
- Remove all local boolean flags, hasPostProcessingErrors and
  needPostProcessing.
- Code out internal buffer placing back into camera-stream from
  setBufferStatus
- Use map.empty() instead of map.size() == 0
- Make CameraStream::process() and PostProcessor::process() coherent
- Few minor code migration from patch 5/7 to 7/7.

Umang Jain (7):
  android: camera_stream: Replace post-processor nullptr check
  android: post_processor_jpeg: Replace encoder_ nullptr check
  android: camera_device: Refactor descriptor status and
    sendCaptureResults()
  android: post_processor: Consolidate contextual information
  android: Track and notify post processing of streams
  android: post_processor: Drop return value for process()
  android: post_processor: Make post processing async

 src/android/camera_device.cpp            | 143 +++++++++++++---------
 src/android/camera_device.h              |   5 +
 src/android/camera_request.cpp           |   5 +-
 src/android/camera_request.h             |  17 ++-
 src/android/camera_stream.cpp            | 144 ++++++++++++++++++++---
 src/android/camera_stream.h              |  41 ++++++-
 src/android/jpeg/post_processor_jpeg.cpp |  20 ++--
 src/android/jpeg/post_processor_jpeg.h   |   4 +-
 src/android/post_processor.h             |  16 ++-
 src/android/yuv/post_processor_yuv.cpp   |  21 ++--
 src/android/yuv/post_processor_yuv.h     |   4 +-
 11 files changed, 310 insertions(+), 110 deletions(-)