[libcamera-devel] [RFC 0/2] libcamera: Implement stream properties

Jacopo Mondi jacopo at jmondi.org
Mon Apr 1 12:14:08 CEST 2019


Hello,
   this RFC series implement support for static stream properties and
implements their usage in the library, by modifying the way
streamConfiguration() works.

The first patch adds the StreamProperties and StreamUsage classes, and creates
IPU3 streams with associated properties.

The IPU3 implementation uses a sub-class of StreamProperties, demonstrating
how to use it to store pipeline-specific configurations.

The patch does not introduced any dependency betwee the Stream and
StreamProperties class, as the second contains informations not visible to the
applications, and should be sub-classed by pipeline handler. For this reason,
each pipeline hander has to maintain an association between streams and their
properties. This could be later generalized by introducing per-Stream data in
the pipeline handler base class.

The second patch modifies the way application retrieve default stream
configurations. The StreamConfiguration class has been expanded to support
what has been named 'usage hints'. Each configuration reports a desired size,
format and intended usage, and pipeline handlers shall try to associate a
configuration with a stream, and return it with an associated default
configuration.

To demonstrate the usage, implement the new behaviour in the library, using the
IPU3 multi-stream pipeline handler implementation (not merged yet) as an
example. Also modify the cam application to require configurations for two
streams (STILL_CAPTURE and VIEWFINDER) and modify the viewfinder sizes.

The two patches are based on v2 of multi-stream support for IPU3, which has
not been yet sent as the ImgU support series has not been merged yet. I have
pushed to the 'jmondi/imgu-v5-multi' branch.

Verified by using the hacked version of camera app, which captures from view
finder and takes a snapshot from output every ten frames.

Sending as RFC as it depends on a lot of out of tree code, and to request early
feedbacks.

Thanks
  j

Jacopo Mondi (2):
  libcamera: stream: Implement StreamProperties
  libcamera: Modify streamConfiguration()

 include/libcamera/camera.h                |   2 +-
 include/libcamera/meson.build             |   1 +
 include/libcamera/stream.h                |   7 ++
 include/libcamera/stream_usages.h         |  20 ++++
 src/cam/main.cpp                          |  48 ++++----
 src/libcamera/camera.cpp                  |  30 +++--
 src/libcamera/include/pipeline_handler.h  |   3 +-
 src/libcamera/include/stream_properties.h |  41 +++++++
 src/libcamera/meson.build                 |   1 +
 src/libcamera/pipeline/ipu3/ipu3.cpp      | 127 +++++++++++++++++-----
 src/libcamera/pipeline/uvcvideo.cpp       |   4 +-
 src/libcamera/pipeline/vimc.cpp           |   4 +-
 src/libcamera/pipeline_handler.cpp        |  23 ++--
 src/libcamera/stream.cpp                  |  25 +++++
 src/libcamera/stream_properties.cpp       | 121 +++++++++++++++++++++
 15 files changed, 379 insertions(+), 78 deletions(-)
 create mode 100644 include/libcamera/stream_usages.h
 create mode 100644 src/libcamera/include/stream_properties.h
 create mode 100644 src/libcamera/stream_properties.cpp

--
2.21.0



More information about the libcamera-devel mailing list