From 1435974c2df581b23555850dd6d1f2610ac4d0d7 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 19 Nov 2015 17:20:55 -0500 Subject: v4l2-probe: Skip devices without supported formats --- sys/v4l2/gstv4l2.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/v4l2/gstv4l2.c b/sys/v4l2/gstv4l2.c index 97d617b82..83fcc982a 100644 --- a/sys/v4l2/gstv4l2.c +++ b/sys/v4l2/gstv4l2.c @@ -168,6 +168,13 @@ gst_v4l2_probe_and_register (GstPlugin * plugin) gst_v4l2_probe_template_caps (it->device_path, video_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)); + /* Skip devices without any supported formats */ + if (gst_caps_is_empty (sink_caps) || gst_caps_is_empty (src_caps)) { + gst_caps_unref (sink_caps); + gst_caps_unref (src_caps); + continue; + } + basename = g_path_get_basename (it->device_path); if (gst_v4l2_is_video_dec (sink_caps, src_caps)) -- cgit v1.2.3