summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2015-11-19 17:20:55 -0500
committerNicolas Dufresne <nicolas.dufresne@collabora.com>2015-11-25 14:31:29 -0500
commit1435974c2df581b23555850dd6d1f2610ac4d0d7 (patch)
tree8e266a71b217175b24e7a9d2e4eef4b7e5035204
parent3cdc700e3e65feb0b78be2c5201c7d3f589cf72a (diff)
v4l2-probe: Skip devices without supported formats
-rw-r--r--sys/v4l2/gstv4l2.c7
1 files changed, 7 insertions, 0 deletions
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))