[libcamera-devel] [PATCH 3/3] libcamera: pipeline: Register device numbers with camera

Kieran Bingham kieran.bingham at ideasonboard.com
Wed May 3 16:02:39 CEST 2023


Quoting Barnabás Pőcze (2023-05-03 14:58:58)
> Hi
> 
> 
> 2023. április 19., szerda 10:58 keltezéssel, Kieran Bingham via libcamera-devel <libcamera-devel at lists.libcamera.org> írta:
> 
> > Register the identified device numbers with each camera as the Devices
> > property.
> > 
> > This facilitates camera daemons or other systems to identify which
> > devices are being managed by libcamera, and can prevent duplication of
> > camera resources.
> > 
> > Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
> > ---
> >  src/libcamera/pipeline_handler.cpp | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> > index f72613b8e515..66e7def51cd1 100644
> > --- a/src/libcamera/pipeline_handler.cpp
> > +++ b/src/libcamera/pipeline_handler.cpp
> > @@ -18,6 +18,7 @@
> >  #include <libcamera/camera.h>
> >  #include <libcamera/camera_manager.h>
> >  #include <libcamera/framebuffer.h>
> > +#include <libcamera/property_ids.h>
> > 
> >  #include "libcamera/internal/camera.h"
> >  #include "libcamera/internal/device_enumerator.h"
> > @@ -624,6 +625,13 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)
> >               }
> >       }
> > 
> > +     /*
> > +      * Store the associated devices as a property of the camera to allow
> > +      * systems to identify which devices are managed by libcamera.
> > +      */
> > +     Camera::Private *data = camera->_d();
> > +     data->properties_.set(properties::Devices, devnums);
> 
> I am getting an assertion failure while testing https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1611
> 
>   ASSERT(elementSize == ControlValueSize[type]);
> 
> in `controls.cpp:ControlValue::set()` fails because `sizeof(dev_t) != 4`.

Yes, this is fixed ready for a V2 ... but the first patch needs to use a
64 bit integer, not a 32 bit.

> 
> 
> > +
> >       manager_->addCamera(std::move(camera), devnums);
> >  }
> > 
> > --
> > 2.34.1
> 
> 
> Regards,
> Barnabás Pőcze


More information about the libcamera-devel mailing list