[libcamera-devel] [PATCH v3 00/10] Async post processor

Umang Jain umang.jain at ideasonboard.com
Mon Sep 20 19:37:42 CEST 2021


This series aims to enable async post-processing of streams
in the HAL layer.

Patch [1,2]/10 transforms the Camera3RequestDescriptor's map
to a queue. The queue is helpful and easier to track when operations
(like post-processing are running asynchronously).

Patch 3/10 is a patch of using pointer instead of reference, since
we will be using Object::invokeMethod() for async processing, 

Patch [4,5,6]/10 expands the breadth of Camera3RequestDescriptor
which can be thought as a "context" structure booking-keeping all
the data for async post-processing. It also manages the lifetime
of source framebuffers.

Patch [7,8]/10 introduces a notification mechanism via a Signal to
infer if a post-processing has been completed. It shall handle success
/error paths accordingly.

Patch 9/10 inspects the queue's head and check if descriptor can be
offloaded from the queue, if "ready". If yes, it will send the capture
results present in the descriptor and drop it from the queue.

Patch 10/10 introduces a threading mechanism which will run the post-processor
in a separate thread.
(It currently runs with ConnectionTypeBlocking, but it should run with
ConnectionTypeQueued. There is WIP debugging issue and marked as TODO)

Umang Jain (10):
  android: camera_worker: Use Camera3RequestDescriptor as cookie
  android: camera_device: Transform descriptors_ map to queue
  android: camera_stream: Pass FrameBuffer pointer instead of reference
  camera_device: Remove private scope of Camera3RequestDescriptor
  android: camera_device: Store results metadata into
    Camera3RequestDescriptor
  android: camera_stream: Plumb process() with Camera3RequestDescriptor
  android: post_processor: Notify post processing completion status
  android: camera_stream: Drop return value for process()
  android: camera_device: Send capture results inspecting the descriptor
  android: camera_stream: Run post processor in a thread

 src/android/camera_device.cpp            | 158 +++++++++++++++--------
 src/android/camera_device.h              |  52 +++++---
 src/android/camera_stream.cpp            |  55 +++++---
 src/android/camera_stream.h              |  16 ++-
 src/android/camera_worker.cpp            |   6 +-
 src/android/camera_worker.h              |   5 +-
 src/android/jpeg/encoder.h               |   2 +-
 src/android/jpeg/encoder_libjpeg.cpp     |   4 +-
 src/android/jpeg/encoder_libjpeg.h       |   2 +-
 src/android/jpeg/post_processor_jpeg.cpp |  25 ++--
 src/android/jpeg/post_processor_jpeg.h   |   9 +-
 src/android/jpeg/thumbnailer.cpp         |   4 +-
 src/android/jpeg/thumbnailer.h           |   2 +-
 src/android/post_processor.h             |  16 ++-
 src/android/yuv/post_processor_yuv.cpp   |  43 +++---
 src/android/yuv/post_processor_yuv.h     |   9 +-
 16 files changed, 263 insertions(+), 145 deletions(-)

-- 
2.31.1



More information about the libcamera-devel mailing list