[0/3] libcamera: controls: Add namespace to ControlId
mbox series

Message ID 20241010084719.712485-1-paul.elder@ideasonboard.com
Headers show
Series
  • libcamera: controls: Add namespace to ControlId
Related show

Message

Paul Elder Oct. 10, 2024, 8:47 a.m. UTC
This series adds vendor (aka namespace) information to ControlId so that
it can be queried by appliations, and presumably used to organize the UI
with relation to control namespaces.

The word "vendor" is used instead of namespace, as it is what shows up
in control_ranges.yaml, and also since it doesn't conflict with the C++
keyword.

Paul Elder (3):
  libcamera: controls: Add vendor information to ControlId
  apps: cam: Print control vendor information when listing controls
  py: Add bindings for ControlId vendor information

 include/libcamera/controls.h         |  8 ++++++--
 src/apps/cam/camera_session.cpp      |  7 +++++--
 src/libcamera/control_ids.cpp.in     |  4 ++--
 src/libcamera/control_serializer.cpp |  2 +-
 src/libcamera/controls.cpp           | 16 +++++++++++++---
 src/libcamera/v4l2_device.cpp        |  2 +-
 src/py/libcamera/py_main.cpp         |  1 +
 7 files changed, 29 insertions(+), 11 deletions(-)

Comments

Laurent Pinchart Oct. 10, 2024, 8:05 p.m. UTC | #1
On Thu, Oct 10, 2024 at 05:47:16PM +0900, Paul Elder wrote:
> This series adds vendor (aka namespace) information to ControlId so that
> it can be queried by appliations, and presumably used to organize the UI
> with relation to control namespaces.
> 
> The word "vendor" is used instead of namespace, as it is what shows up
> in control_ranges.yaml, and also since it doesn't conflict with the C++
> keyword.

I was expecting "namespace" (or "ns") instead of "vendor", but "vendor"
makes sense, especially as it avoids the keyword clash.

> Paul Elder (3):
>   libcamera: controls: Add vendor information to ControlId
>   apps: cam: Print control vendor information when listing controls
>   py: Add bindings for ControlId vendor information
> 
>  include/libcamera/controls.h         |  8 ++++++--
>  src/apps/cam/camera_session.cpp      |  7 +++++--
>  src/libcamera/control_ids.cpp.in     |  4 ++--
>  src/libcamera/control_serializer.cpp |  2 +-
>  src/libcamera/controls.cpp           | 16 +++++++++++++---
>  src/libcamera/v4l2_device.cpp        |  2 +-
>  src/py/libcamera/py_main.cpp         |  1 +
>  7 files changed, 29 insertions(+), 11 deletions(-)
Paul Elder Oct. 16, 2024, 11:22 a.m. UTC | #2
On Thu, Oct 10, 2024 at 11:05:28PM +0300, Laurent Pinchart wrote:
> On Thu, Oct 10, 2024 at 05:47:16PM +0900, Paul Elder wrote:
> > This series adds vendor (aka namespace) information to ControlId so that
> > it can be queried by appliations, and presumably used to organize the UI
> > with relation to control namespaces.
> > 
> > The word "vendor" is used instead of namespace, as it is what shows up
> > in control_ranges.yaml, and also since it doesn't conflict with the C++
> > keyword.
> 
> I was expecting "namespace" (or "ns") instead of "vendor", but "vendor"
> makes sense, especially as it avoids the keyword clash.

I was expecting that too but namespace clashes and ns is too short and
nondescriptive so I went with vendor since that's what was already used.


Paul

> 
> > Paul Elder (3):
> >   libcamera: controls: Add vendor information to ControlId
> >   apps: cam: Print control vendor information when listing controls
> >   py: Add bindings for ControlId vendor information
> > 
> >  include/libcamera/controls.h         |  8 ++++++--
> >  src/apps/cam/camera_session.cpp      |  7 +++++--
> >  src/libcamera/control_ids.cpp.in     |  4 ++--
> >  src/libcamera/control_serializer.cpp |  2 +-
> >  src/libcamera/controls.cpp           | 16 +++++++++++++---
> >  src/libcamera/v4l2_device.cpp        |  2 +-
> >  src/py/libcamera/py_main.cpp         |  1 +
> >  7 files changed, 29 insertions(+), 11 deletions(-)