From 0e0cc2149ec10f6bad74a646ce3eaeba7f6c5b54 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 9 Jan 2020 14:31:18 -0500 Subject: gst: Add initial device provider This feature is used with GstDeviceMonitor in order to enumerate and monitor devices to be used with the source element. The resulting GstDevice implementation is also used by application to abstract the configuration of the source element. Implementation notes: - libcamera does not support polling yet - The device ID isn't unique in libcamera yet - The "name" property does not yet exist in libcamerasrc yet Signed-off-by: Nicolas Dufresne Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/gstreamer/gstlibcamera.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/gstreamer/gstlibcamera.c') diff --git a/src/gstreamer/gstlibcamera.c b/src/gstreamer/gstlibcamera.c index 7dd94ca0..81c7bb19 100644 --- a/src/gstreamer/gstlibcamera.c +++ b/src/gstreamer/gstlibcamera.c @@ -6,13 +6,19 @@ * gstlibcamera.c - GStreamer plugin */ +#include "gstlibcameraprovider.h" #include "gstlibcamerasrc.h" static gboolean plugin_init(GstPlugin *plugin) { - return gst_element_register(plugin, "libcamerasrc", GST_RANK_PRIMARY, - GST_TYPE_LIBCAMERA_SRC); + if (!gst_element_register(plugin, "libcamerasrc", GST_RANK_PRIMARY, + GST_TYPE_LIBCAMERA_SRC) || + !gst_device_provider_register(plugin, "libcameraprovider", + GST_RANK_PRIMARY, + GST_TYPE_LIBCAMERA_PROVIDER)) + return FALSE; + return TRUE; } -- cgit v1.2.1