diff options
author | Nicolas Dufresne <nicolas.dufresne@collabora.com> | 2021-08-26 09:23:45 -0400 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-08-26 16:42:52 +0300 |
commit | 9c49106b9709da130d81bff913db8ce2daecd9b6 (patch) | |
tree | 881cec1ba36b257129bbeaa863d83ed9c56247c8 /src/gstreamer/gstlibcamera-utils.h | |
parent | 1ca5513396b4fa52f7305e19b7db0ae525dbd730 (diff) |
gstreamer: Fix concurrent access issues to CameraManager
It's not allowed to have multiple instances of CameraManager. This
requirement is not easy for GStreamer were the device monitor and
the camerasrc, or two camerasrc instances don't usually have any
interaction between each other. Fix this by implementing a minimalist
singleton around CameraManager constructor and start()/stop()
operations.
Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/gstreamer/gstlibcamera-utils.h')
-rw-r--r-- | src/gstreamer/gstlibcamera-utils.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gstreamer/gstlibcamera-utils.h b/src/gstreamer/gstlibcamera-utils.h index 2b3f26b6..67a06db3 100644 --- a/src/gstreamer/gstlibcamera-utils.h +++ b/src/gstreamer/gstlibcamera-utils.h @@ -9,16 +9,18 @@ #ifndef __GST_LIBCAMERA_UTILS_H__ #define __GST_LIBCAMERA_UTILS_H__ +#include <libcamera/camera_manager.h> +#include <libcamera/stream.h> + #include <gst/gst.h> #include <gst/video/video.h> -#include <libcamera/stream.h> - GstCaps *gst_libcamera_stream_formats_to_caps(const libcamera::StreamFormats &formats); GstCaps *gst_libcamera_stream_configuration_to_caps(const libcamera::StreamConfiguration &stream_cfg); void gst_libcamera_configure_stream_from_caps(libcamera::StreamConfiguration &stream_cfg, GstCaps *caps); void gst_libcamera_resume_task(GstTask *task); +std::shared_ptr<libcamera::CameraManager> gst_libcamera_get_camera_mananger(int &ret); /** * \class GLibLocker |