[libcamera-devel,v6,0/3] Introduce CameraSensorProperties database
mbox series

Message ID 20210430173803.198220-1-jacopo@jmondi.org
Headers show
Series
  • Introduce CameraSensorProperties database
Related show

Message

Jacopo Mondi April 30, 2021, 5:38 p.m. UTC
Hello,
   reworked [1/3] to address Laurent's comments

- Drop SensorDatabase class and move the static get() method to
  CameraSensorProperties
- Remove the macro and initialize the CameraSensorProperties map in-place
- Drop tags as the patch has changed

I had to declare CameraSensorProperties as struct as otherwise initializing the
map with an initializer list gives me:

../src/libcamera/camera_sensor_properties.cpp:58:2: error: could not convert
‘{{"imx219", <expression error>}, {"ov5670", <expression error>}, {"ov13858",
<expression error>}}’ from ‘<brace-enclosed initializer list>’ to ‘const
std::map<std::__cxx11::basic_string<char>, const
libcamera::CameraSensorProperties>’

This could probably be closed by adding a constructor to the
CameraSensorProperties class. I fear that this won't scale well, as for any new
parameter added to the class we'll need to add an element to the constructor
and this could get ugly quite quickly. Hence, declare CameraSensorProperties as
a struct and allow named member initilization.

Thanks
  j


Jacopo Mondi (3):
  libcamera: Introduce camera sensor properties
  libcamera: camera_sensor: Register static properties
  android: camera_device: Report sensor physical size

 include/libcamera/internal/camera_sensor.h    |  1 +
 .../internal/camera_sensor_properties.h       | 24 +++++++
 include/libcamera/internal/meson.build        |  1 +
 src/android/camera_device.cpp                 | 30 ++++----
 src/libcamera/camera_sensor.cpp               | 16 ++++-
 src/libcamera/camera_sensor_properties.cpp    | 71 +++++++++++++++++++
 src/libcamera/meson.build                     |  1 +
 7 files changed, 129 insertions(+), 15 deletions(-)
 create mode 100644 include/libcamera/internal/camera_sensor_properties.h
 create mode 100644 src/libcamera/camera_sensor_properties.cpp

--
2.31.1