[libcamera-devel,0/2] libcamera: Introduce sensor database
mbox series

Message ID 20201208090042.4824-1-jacopo@jmondi.org
Headers show
Series
  • libcamera: Introduce sensor database
Related show

Message

Jacopo Mondi Dec. 8, 2020, 9 a.m. UTC
Introduce a database of camera sensor properties to record the camera
sensor characteristics which are not retrievable at run-time.

The per-sensor entries can easily be generated from a yaml schema.

Jacopo Mondi (2):
  libcamera: Introduce camera sensor database
  android: camera_device: Get sensor properties from DB

 include/libcamera/camera_sensor_database.h |  41 +++++++
 include/libcamera/meson.build              |   1 +
 src/android/camera_device.cpp              |  27 ++++-
 src/libcamera/camera_sensor_database.cpp   | 119 +++++++++++++++++++++
 src/libcamera/meson.build                  |   1 +
 5 files changed, 184 insertions(+), 5 deletions(-)
 create mode 100644 include/libcamera/camera_sensor_database.h
 create mode 100644 src/libcamera/camera_sensor_database.cpp

--
2.29.1

Comments

Niklas Söderlund Dec. 10, 2020, 4:09 p.m. UTC | #1
Hi Jacopo,

Thanks for this work.

On 2020-12-08 10:00:40 +0100, Jacopo Mondi wrote:
> Introduce a database of camera sensor properties to record the camera
> sensor characteristics which are not retrievable at run-time.

I have looked at the series and on their own I think the patches are 
good. I'm a little concerned if this is the API we want to use for this.  
Would it not make more sens for users (like the HAL) to read this 
information as static metadata exposed by the camera? Maybe there is 
some use-case I do not understand.

> 
> The per-sensor entries can easily be generated from a yaml schema.
> 
> Jacopo Mondi (2):
>   libcamera: Introduce camera sensor database
>   android: camera_device: Get sensor properties from DB
> 
>  include/libcamera/camera_sensor_database.h |  41 +++++++
>  include/libcamera/meson.build              |   1 +
>  src/android/camera_device.cpp              |  27 ++++-
>  src/libcamera/camera_sensor_database.cpp   | 119 +++++++++++++++++++++
>  src/libcamera/meson.build                  |   1 +
>  5 files changed, 184 insertions(+), 5 deletions(-)
>  create mode 100644 include/libcamera/camera_sensor_database.h
>  create mode 100644 src/libcamera/camera_sensor_database.cpp
> 
> --
> 2.29.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Dec. 10, 2020, 4:17 p.m. UTC | #2
Hello,

On Thu, Dec 10, 2020 at 05:09:00PM +0100, Niklas Söderlund wrote:
> On 2020-12-08 10:00:40 +0100, Jacopo Mondi wrote:
> > Introduce a database of camera sensor properties to record the camera
> > sensor characteristics which are not retrievable at run-time.
> 
> I have looked at the series and on their own I think the patches are 
> good. I'm a little concerned if this is the API we want to use for this.  
> Would it not make more sens for users (like the HAL) to read this 
> information as static metadata exposed by the camera? Maybe there is 
> some use-case I do not understand.

I was going to mention the same. I think the database should be internal
to the CameraSensor class, which would create corresponding properties.
The HAL would then translate those properties to HAL metadata.

> > The per-sensor entries can easily be generated from a yaml schema.
> > 
> > Jacopo Mondi (2):
> >   libcamera: Introduce camera sensor database
> >   android: camera_device: Get sensor properties from DB
> > 
> >  include/libcamera/camera_sensor_database.h |  41 +++++++
> >  include/libcamera/meson.build              |   1 +
> >  src/android/camera_device.cpp              |  27 ++++-
> >  src/libcamera/camera_sensor_database.cpp   | 119 +++++++++++++++++++++
> >  src/libcamera/meson.build                  |   1 +
> >  5 files changed, 184 insertions(+), 5 deletions(-)
> >  create mode 100644 include/libcamera/camera_sensor_database.h
> >  create mode 100644 src/libcamera/camera_sensor_database.cpp
Jacopo Mondi Dec. 10, 2020, 4:24 p.m. UTC | #3
Hi Niklas, Laurent,

On Thu, Dec 10, 2020 at 06:17:42PM +0200, Laurent Pinchart wrote:
> Hello,
>
> On Thu, Dec 10, 2020 at 05:09:00PM +0100, Niklas Söderlund wrote:
> > On 2020-12-08 10:00:40 +0100, Jacopo Mondi wrote:
> > > Introduce a database of camera sensor properties to record the camera
> > > sensor characteristics which are not retrievable at run-time.
> >
> > I have looked at the series and on their own I think the patches are
> > good. I'm a little concerned if this is the API we want to use for this.
> > Would it not make more sens for users (like the HAL) to read this
> > information as static metadata exposed by the camera? Maybe there is
> > some use-case I do not understand.
>
> I was going to mention the same. I think the database should be internal
> to the CameraSensor class, which would create corresponding properties.
> The HAL would then translate those properties to HAL metadata.
>

yes, we had this discussion last week and concluded that the config
file will be parsed by the camera sensor and properties exposed by it
using, if required, draft ones.

> > > The per-sensor entries can easily be generated from a yaml schema.
> > >
> > > Jacopo Mondi (2):
> > >   libcamera: Introduce camera sensor database
> > >   android: camera_device: Get sensor properties from DB
> > >
> > >  include/libcamera/camera_sensor_database.h |  41 +++++++
> > >  include/libcamera/meson.build              |   1 +
> > >  src/android/camera_device.cpp              |  27 ++++-
> > >  src/libcamera/camera_sensor_database.cpp   | 119 +++++++++++++++++++++
> > >  src/libcamera/meson.build                  |   1 +
> > >  5 files changed, 184 insertions(+), 5 deletions(-)
> > >  create mode 100644 include/libcamera/camera_sensor_database.h
> > >  create mode 100644 src/libcamera/camera_sensor_database.cpp
>
> --
> Regards,
>
> Laurent Pinchart