[libcamera-devel] [PATCH v4 00/12] libcamera: ipu3: Multiple streams support

Jacopo Mondi jacopo at jmondi.org
Tue Apr 9 21:25:36 CEST 2019


Hello,
  4th version of multiple stream support for IPU3 platform.

Quite a few changes from v3:
- Rebase on latest master, including StreamUsages
- Improved streamConfiguration to support more (but not all :P) use cases
- Introduced a sub-class of Stream for IPU3, and make the stream selection
  logic use that sub-class during configuration, memory allocation and request
  queueing
- Changed most of the patches touching the library to include Niklas' and
  Laurent's comments
  - replace 'request from buffer' with
    "buffer: Store Request reference in Buffer"
  - refuse empty requests not to mess up pipeline handler
  - expose the Stream's 'stream to buffer' map instead of exposing 'Stream *'
    and save a few iterations on the request's map
- Changed request completion handling on IPU3 to complete requests in order
- I'm not sure if I missed this in v3, but it was there in v2: the output
  device node should be queued with buffers otherwise the IPU3 stalls.
  Use the internal pool or the stream's pool to grab a free buffer and queue
  buffers to 'output' even if it is not part of the capture request

Open points:
- allocation failures handling: see email thread
- buffer queuing to ImgU's output: I'm not too proud of that part and I'm
  sure it could be improved.

As a bonus 12/12 is a sketched patch that captures from still image output
every 10 viewfinder frames. Its purpose it mostly to demonstrate how
applications could associate streams to their assigned roles.

Tested with several combinations with the 'cam' testing app (sorry for the
place holder variables, this comes from my testing scripts)

src/cam/cam -c "$SDEV" -C -s role=still,width=$W,height=$H -s role=viewfinder,width=640,height=480 --file=/tmp/frame-#
src/cam/cam -c "$SDEV" -C -s role=still,width=$W,height=$H -s role=video,width=640,height=480 --file=/tmp/frame-#
src/cam/cam -c "$SDEV" -C -s role=still,width=$W,height=$H --file=/tmp/frame-#
src/cam/cam -c "$SDEV" -C -s role=viewfinder,width=640,height=480 --file=/tmp/frame-#

I had hoped for a much slimmer change-log, and I'm afraid another few iterations
will be required.

Any further testing is appreciated.

Thanks
  j

Jacopo Mondi (12):
  libcamera: ipu3: Sub-class Stream with IPU3Stream
  libcamera: ipu3: Create camera with 2 streams
  libcamera: camera: allocateBuffers: Pass the stream set
  libcamera: ipu3: Add multiple stream memory management
  libcamera: request: Expose the Stream to Buffers map
  libcamera: ipu3: Queue requests for multiple streams
  libcamera: request: Add empty() method
  libcamera: camera: Refuse empty requests
  libcamera: buffer: Store Request reference in Buffer
  libcamera: ipu3: Connect viewfinder's BufferReady signal
  libcamera: ipu3: Use roles in stream configuration
  [HACK] still capture every 10 frames

 include/libcamera/buffer.h               |   5 +
 include/libcamera/request.h              |   4 +
 include/libcamera/stream.h               |   4 +-
 src/cam/main.cpp                         |  46 ++-
 src/libcamera/buffer.cpp                 |  39 ++-
 src/libcamera/camera.cpp                 |  21 +-
 src/libcamera/include/pipeline_handler.h |   6 +-
 src/libcamera/pipeline/ipu3/ipu3.cpp     | 426 +++++++++++++++++------
 src/libcamera/pipeline/uvcvideo.cpp      |  13 +-
 src/libcamera/pipeline/vimc.cpp          |  13 +-
 src/libcamera/pipeline_handler.cpp       |  11 +-
 src/libcamera/request.cpp                |  25 +-
 12 files changed, 483 insertions(+), 130 deletions(-)

--
2.21.0



More information about the libcamera-devel mailing list