summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2024-05-14 18:02:07 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-05-14 23:51:57 +0300
commite43d2a35fa671c18dd8bae39ab21df9671b5f0a1 (patch)
treea4b0d33d4d2ccc137bad069b383e860aa5305fb5 /src
parentf113464b3481d76dee158a00c790b44671b382b7 (diff)
gstreamer: Use copied camera name
The camera name is copied in gst_libcamera_src_open() as we can't hold the lock protecting the name while calling GST_ELEMENT_ERROR(). The GST_ELEMENT_ERROR() macro sends a message on the bus, taking more locks and possibly causing issues. However, the current code makes the copy, but does not actually use it. So fix that. Fixes: 58feb69f852289 ("gst: libcamerasrc: Implement selection and acquisition") Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/gstreamer/gstlibcamerasrc.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp
index c0f4d506..6a95b6af 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;
}