[libcamera-devel] [PATCH 00/31] libcamera: Add support for array controls

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Feb 29 17:42:23 CET 2020


Hello,

This large patch series is the result of collective work from Jacopo and
me. It adds support in the libcamera Control classes to handle array of
values, in addition to the single values we support today.

The first two patches (01/31 and 02/31) add an implementation of the
C++20 std::span<> class and a related test. This will be used
extensively to support array controls.

The next 13 patches (03/31 to 15/31) refactor the control-related
classes, as well as the IPA control code, to prepare for array controls.
Patch 16/31 is then the main change in the series, implementing support
for array controls, and patch 17/31 improves the ControlList::set() API
to make array controls more usable. Patch 18/31 wires this up in the
yaml parser.

Patches 19/31 and 20/31 are a small intermission that add support for
float and int8_t controls. The latter is particularly useful to create
byte array controls.

Patch 21/31 adds support for array controls in the IPA protocol, patches
22/31 to 24/31 improve the ByteStreamBuffer class and patches 25/31 to
27/31 extend the control serializer to support array controls.

Patch 28/31 finally extends the cam utility to support array controls.

Patches 29/31 to 31/31 add test-cases specific to array controls. Those
are not meant to be integrated yet as we're missing a standard array
control in libcamera, the patches thus create a fictional control for
that purpose. They should be rebased on top of the first real array
control and merged at that point.

Jacopo Mondi (14):
  libcamera: Add a C++20-compliant std::span<> implementation
  libcamera: gen-controls: Fix documentation issue with <<
  libcamera: ipa: Remove unused IPA control types
  libcamera: controls: Reorder ControlValue methods
  libcamera: controls: Support array controls in ControlValue
  libcamera: controls: Add a 'size' yaml property
  libcamera: controls: Add support for float controls
  libcamera: controls: Add support for int8_t controls
  libcamera: byte_stream_buffer: Fix documentation of read() and write()
  libcamera: byte_stream_buffer: Add Span<> support
  libcamera: control_serializer: Add support for array controls
  cam: Add option to list camera properties
  DNI: test array controls
  DNI: test: serialization: Serialize array controls

Laurent Pinchart (17):
  test: Add Span test
  libcamera: ipa: Make <ipa/ipa_controls.h> self-contained
  libcamera: ipa: Test control structure size with static_assert
  libcamera: controls: Don't convert 32-bit and 64-bit implicitly
  libcamera: controls: Decouple control and value type in
    ControlList::set()
  libcamera: controls: Return control by value in ControlList::get()
  libcamera: controls: Add templates to convert a type T to a
    ControlType
  libcamera: controls: Move ControlValue get() and set() to controls.h
  libcamera: controls: Move ControlValue constructor to controls.h
  libcamera: controls: Move Control constructor to controls.h
  libcamera: controls: Expose raw data in ControlValue
  libcamera: controls: Allow passing an std::initializer list to set()
  libcamera: ipa: Support array controls in ipa_control_value_entry
  libcamera: byte_stream_buffer: Add zero-copy read() variant
  libcamera: control_serializer: Simplify serialization of ControlValue
  libcamera: control_serializer: Use zero-copy ByteStreamBuffer::read()
  DNI: test: serialization: Serialize array control with a single
    element

 Documentation/Doxyfile.in                    |   6 +-
 include/ipa/ipa_controls.h                   |  19 +-
 include/libcamera/controls.h                 | 170 +++++++-
 include/libcamera/meson.build                |   1 +
 include/libcamera/span.h                     | 417 +++++++++++++++++++
 src/cam/main.cpp                             |  28 ++
 src/cam/main.h                               |   1 +
 src/libcamera/byte_stream_buffer.cpp         |  61 ++-
 src/libcamera/control_ids.yaml               |   5 +
 src/libcamera/control_serializer.cpp         | 180 ++++----
 src/libcamera/controls.cpp                   | 312 ++++++++------
 src/libcamera/gen-controls.py                |  16 +-
 src/libcamera/include/byte_stream_buffer.h   |  26 ++
 src/libcamera/include/control_serializer.h   |   6 +-
 src/libcamera/ipa_controls.cpp               |  53 ++-
 src/libcamera/meson.build                    |   1 +
 src/libcamera/pipeline/vimc.cpp              |   5 +
 src/libcamera/span.cpp                       |  12 +
 test/controls/array_controls.cpp             | 107 +++++
 test/controls/meson.build                    |   1 +
 test/meson.build                             |   1 +
 test/serialization/control_serialization.cpp |   3 +-
 test/span.cpp                                | 177 ++++++++
 23 files changed, 1336 insertions(+), 272 deletions(-)
 create mode 100644 include/libcamera/span.h
 create mode 100644 src/libcamera/span.cpp
 create mode 100644 test/controls/array_controls.cpp
 create mode 100644 test/span.cpp

-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list