From: <en...@ke...> - 2009-03-06 21:42:42
|
Module: gst-plugins-good Branch: master Commit: f86b485f3b7acf28ab8658243ba04354b6324e2b URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=f86b485f3b7acf28ab8658243ba04354b6324e2b Author: Stefan Kost <en...@us...> Date: Fri Mar 6 21:56:26 2009 +0200 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. --- 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 5abfda3..38671c9 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); |