[libcamera-devel] [PATCH v3 4/5] libcamera: properties: Provide a Devices camera property
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Mon Jun 12 19:44:37 CEST 2023
On Mon, Jun 12, 2023 at 05:28:19PM +0100, Kieran Bingham via libcamera-devel wrote:
> Quoting Barnabás Pőcze (2023-06-11 22:46:06)
> > 2023. május 15., hétfő 14:45 keltezéssel, Kieran Bingham via libcamera-devel <libcamera-devel at lists.libcamera.org> írta:
> >
> > > Provide a new Camera property that allows pipeline handlers to list any
> > > devices used to operate the device. This allows other frameworks and
> > > daemons such as Pipewire to better understand the resources consumed by
> > > a Camera and consider ignoring those resources when enumerating camera
> > > devices on a system.
> > >
> > > Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > > Reviewed-by: Jacopo Mondi <jacopo.mondi at ideasonboard.com>
> > > ---
> > > src/libcamera/property_ids.yaml | 7 +++++++
> > > 1 file changed, 7 insertions(+)
> > >
> > > diff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml
> > > index cb55e0ed2283..6141942969f9 100644
> > > --- a/src/libcamera/property_ids.yaml
> > > +++ b/src/libcamera/property_ids.yaml
> > > @@ -690,6 +690,13 @@ controls:
> > > that is twice that of the full resolution mode. This value will be valid
> > > after the configure method has returned successfully.
> > >
> > > + - Devices:
> > > + type: int64_t
> >
> > I am wondering why the type is `int64_t`. POSIX only says `dev_t` is an integer type[0].
> > Both glibc[1] and musl[2] define it as an unsigned (64-bit) integer (at least as far as I checked).
>
> Indeed every implementation I can see define it as a 64-bit, but the
> kernel uses only 32 bits.
>
> This is a libcamera control limitation ultimately, as we don't have
> unsigned integer controls. I'm not sure yet if adding would be helpful
> or difficult. It might be worth trying out.
An int64_t makes sure it will always fit the dev_t value regardless of
the platform, so I don't really see much added value in adding a
platform-dependent integer type for controls.
> > > + size: [n]
> > > + description: |
> > > + A list of integer values of type dev_t denoting major and minor device
> > > + number of the underlying devices used in the operation of this camera.
> > > +
> > > # ----------------------------------------------------------------------------
> > > # Draft properties section
> > >
> >
> > [0]: https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_types.h.html#tag_13_67
> > [1]: https://sourceware.org/git/?p=glibc.git;a=blob;f=bits/typesizes.h;h=5dd1700649463583c573b95cc6df8ac677316ea9;hb=HEAD#l29
> > [2]: https://git.musl-libc.org/cgit/musl/tree/include/alltypes.h.in?id=718f363bc2067b6487900eddc9180c84e7739f80#n31
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list