summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcamera.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2020-01-09 14:31:18 -0500
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-07 01:57:45 +0200
commit0e0cc2149ec10f6bad74a646ce3eaeba7f6c5b54 (patch)
treef72d96ffc84dd852a1bd85570c623f42f6ecb80d /src/gstreamer/gstlibcamera.c
parenteee8f56f0a7f34574752948027843bf6a1912e90 (diff)
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 <nicolas.dufresne@collabora.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/gstreamer/gstlibcamera.c')
-rw-r--r--src/gstreamer/gstlibcamera.c10
1 files changed, 8 insertions, 2 deletions
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;
}