[libcamera-devel] [PATCH v2 0/5] generate and use fixed-sized Span Control types

Christian Rauch Rauch.Christian at gmx.de
Tue Apr 5 02:42:10 CEST 2022


Hello,

This is version 2 of my fixed-sized Span patch set. The changes from version 1 include changes to the code style in "gen-controls.py" and the way how memory for default constructed fixed-sized Spans is allocated.

The default Span constructor in version 1 used a temporarily constructed "std::array<>" resulting in the Span storing a pointer to deallocated memory. Version 2 replaced this with an empty Span. In practice, this means that a Span will store its target fixed-size as the "extent" and its current storage capacity by "size_".

Best,
Christian


Christian Rauch (5):
  define Span size as shape vector
  generate fixed- and variable-sized Span Controls
  provide a default fixed-sized Span constructor
  apply clang-format style
  apply explicit fixed-sized Span type casts

 include/libcamera/base/span.h                 |  47 +++---
 include/libcamera/controls.h                  |   2 +-
 src/ipa/raspberrypi/raspberrypi.cpp           |  21 +--
 src/libcamera/control_ids.yaml                |   2 +-
 .../pipeline/raspberrypi/raspberrypi.cpp      |  36 +++--
 src/libcamera/property_ids.yaml               |   4 +-
 src/qcam/dng_writer.cpp                       | 142 +++++++++---------
 test/span.cpp                                 |   4 +-
 utils/gen-controls.py                         |  33 ++--
 9 files changed, 154 insertions(+), 137 deletions(-)

--
2.25.1


More information about the libcamera-devel mailing list