diff options
author | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 21:56:26 +0200 |
---|---|---|
committer | Stefan Kost <ensonic@users.sf.net> | 2009-03-06 21:57:53 +0200 |
commit | f86b485f3b7acf28ab8658243ba04354b6324e2b (patch) | |
tree | 720c2a4b29062139b67854ea76a7beb3401bf299 /sys | |
parent | 636cd65ebfd74f7d8a4f206d6e2f3c6ce70099f3 (diff) |
v4l2src: fix pads, so that they are subset of template caps
Do not add w=0 | h=0. When we can't get a framerate add fraction range.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/v4l2/v4l2src_calls.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/v4l2/v4l2src_calls.c b/sys/v4l2/v4l2src_calls.c index 5abfda310..38671c958 100644 --- a/sys/v4l2/v4l2src_calls.c +++ b/sys/v4l2/v4l2src_calls.c @@ -749,6 +749,9 @@ return_data: * value */ gst_structure_set_value (s, "framerate", &rates); g_value_unset (&rates); + } else { + gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, + NULL); } return s; @@ -817,11 +820,13 @@ gst_v4l2src_probe_caps_for_format (GstV4l2Src * v4l2src, guint32 pixelformat, w = MIN (size.discrete.width, G_MAXINT); h = MIN (size.discrete.height, G_MAXINT); - tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat, - w, h, template); + if (w && h) { + tmp = gst_v4l2src_probe_caps_for_format_and_size (v4l2src, pixelformat, + w, h, template); - if (tmp) - results = g_list_prepend (results, tmp); + if (tmp) + results = g_list_prepend (results, tmp); + } size.index++; } while (v4l2_ioctl (fd, VIDIOC_ENUM_FRAMESIZES, &size) >= 0); |