[PATCH v1] gstreamer: Use copied camera name

Barnabás Pőcze pobrn at protonmail.com
Tue May 14 23:52:00 CEST 2024


Hi


2024. május 14., kedd 21:16 keltezéssel, Laurent Pinchart <laurent.pinchart at ideasonboard.com> írta:

> Hi Barnabás,
> 
> Thank you for the patch.
> 
> On Tue, May 14, 2024 at 06:02:07PM +0000, Barnabás Pőcze wrote:
> > It seems the intent is to use the copied camera name to avoid
> > concurrency problems related to `gst_libcamera_src_set_property()`.
> >
> > However, the current code makes the copy, but does not actually
> > use it. So fix that.
> 
> Indeed, the local camera_name variable seems pointless otherwise.
> 
> Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> 
> Did you catch the issue by chance while reading the code, or did
> something trigger an investigation ?

I was experimenting with some code changes, and I noticed this discrepancy during that.


> 
> > Fixes: 58feb69f852289 ("gst: libcamerasrc: Implement selection and acquisition")
> > Signed-off-by: Barnabás Pőcze <pobrn at protonmail.com>
> > ---
> >  src/gstreamer/gstlibcamerasrc.cpp | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
> > index a284110b..9680d809 100644
> > --- a/src/gstreamer/gstlibcamerasrc.cpp
> > +++ b/src/gstreamer/gstlibcamerasrc.cpp
> > @@ -377,10 +377,10 @@ gst_libcamera_src_open(GstLibcameraSrc *self)
> >  	}
> >
> >  	if (camera_name) {
> > -		cam = cm->get(self->camera_name);
> > +		cam = cm->get(camera_name);
> >  		if (!cam) {
> >  			GST_ELEMENT_ERROR(self, RESOURCE, NOT_FOUND,
> > -					  ("Could not find a camera named '%s'.", self->camera_name),
> > +					  ("Could not find a camera named '%s'.", camera_name),
> >  					  ("libcamera::CameraMananger::get() returned nullptr"));
> >  			return false;
> >  		}
> [...]


Regards,
Barnabás Pőcze


More information about the libcamera-devel mailing list