summaryrefslogtreecommitdiff
path: root/sys/v4l2/gstv4l2.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/v4l2/gstv4l2.c')
-rw-r--r--sys/v4l2/gstv4l2.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c
index 8333eab41..97d617b82 100644
--- a/sys/v4l2/gstv4l2.c
+++ b/sys/v4l2/gstv4l2.c
@@ -54,6 +54,7 @@
GST_DEBUG_CATEGORY (v4l2_debug);
#define GST_CAT_DEFAULT v4l2_debug
+#ifdef GST_V4L2_ENABLE_PROBE
/* This is a minimalist probe, for speed, we only enumerate formats */
static GstCaps *
gst_v4l2_probe_template_caps (const gchar * device, gint video_fd,
@@ -192,12 +193,21 @@ gst_v4l2_probe_and_register (GstPlugin * plugin)
return ret;
}
+#endif
static gboolean
plugin_init (GstPlugin * plugin)
{
+ const gchar *paths[] = { "/dev", "/dev/v4l2", NULL };
+ const gchar *names[] = { "video", NULL };
+
GST_DEBUG_CATEGORY_INIT (v4l2_debug, "v4l2", 0, "V4L2 API calls");
+ /* Add some depedency, so the dynamic features get updated upon changes in
+ * /dev/video* */
+ gst_plugin_add_dependency (plugin,
+ NULL, paths, names, GST_PLUGIN_DEPENDENCY_FLAG_FILE_NAME_IS_PREFIX);
+
if (!gst_element_register (plugin, "v4l2src", GST_RANK_PRIMARY,
GST_TYPE_V4L2SRC) ||
!gst_element_register (plugin, "v4l2sink", GST_RANK_NONE,
@@ -205,9 +215,12 @@ plugin_init (GstPlugin * plugin)
!gst_element_register (plugin, "v4l2radio", GST_RANK_NONE,
GST_TYPE_V4L2RADIO) ||
!gst_device_provider_register (plugin, "v4l2deviceprovider",
- GST_RANK_PRIMARY, GST_TYPE_V4L2_DEVICE_PROVIDER) ||
+ GST_RANK_PRIMARY, GST_TYPE_V4L2_DEVICE_PROVIDER)
/* etc. */
- !gst_v4l2_probe_and_register (plugin))
+#ifdef GST_V4L2_ENABLE_PROBE
+ || !gst_v4l2_probe_and_register (plugin)
+#endif
+ )
return FALSE;
#ifdef ENABLE_NLS