[libcamera-devel] [PATCH v1 0/6] Async post-processor

Umang Jain umang.jain at ideasonboard.com
Tue Sep 7 21:56:58 CEST 2021


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

Patch (1,2,3)/6 introduces basic plumbing with respect to signals. The signals
notify about the post-processing status to upper layers, based on which
slots in upper layers can send back results(or errors) to framework.

Patch 4/6 adds a queue and slot to signal introduced in previous patches.
Signals are emitted for post-processing completion and capture results
are added to queue if there is a request for post-processing.
The queue ensures we send back capture results in order, to the framework.
This patch also saves the context(as part of Camera3RequestDescriptor) 
while queuing so that, we can ressurect all the context information again,
when we actually send back capture results to the framework.

Uptill this point, the post-processing still runs synchrously i.e.
status quo is maintained as per master.

Patch 5/6 and 6/6 brings in a new Thread to run the post-processor, which
actually makes the post-processor run async.

---
Testing:
post-processor-jpeg runs in a separate thread and saves an image
on shutter-click. Streaming of image data continues as usual.
Multiple shutter-click with reasonable gap(one-ish shutter-click per second)
saves image as expected.

However, if you become a woodpecker with the shutter button, you might be able to
see https://paste.debian.net/1210728/. Kieran and I will be looking into it.

There seems a current breakage of camera service with CTS on master.
I'll keep an eye and will try to get CTS results with this series, once fixed.
--- 

Umang Jain (6):
  android: camera_stream: Pass FrameBuffer pointer instead of reference
  android: post_processor: Notify post processing completion status
  android: camera_stream: Notify process() status with a Signal
  android: camera_device: Add a queue for sending capture results
  android: camera_device: Move buffer mapping for post-processing
  android: camera_stream: Run post-processor in a separate thread

 src/android/camera_device.cpp            | 149 +++++++++++++++++++++--
 src/android/camera_device.h              |  28 +++++
 src/android/camera_stream.cpp            |  39 +++---
 src/android/camera_stream.h              |  43 ++++++-
 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 |  11 +-
 src/android/jpeg/post_processor_jpeg.h   |   4 +-
 src/android/jpeg/thumbnailer.cpp         |   4 +-
 src/android/jpeg/thumbnailer.h           |   2 +-
 src/android/post_processor.h             |  10 +-
 src/android/yuv/post_processor_yuv.cpp   |  22 ++--
 src/android/yuv/post_processor_yuv.h     |   4 +-
 14 files changed, 272 insertions(+), 52 deletions(-)

-- 
2.31.0



More information about the libcamera-devel mailing list