From e01766664522aa10f0d7ca4ecc780010ef49784d Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Thu, 12 Dec 2013 16:46:09 -0500 Subject: [PATCH] v4l2object: Don't force framerate field for OUTPUT If there is nothing that seems to force a certain framerate on output device, it is preferable to simply not set that feild. This allow negotiation with tsdemux in a decoder for example. https://bugzilla.gnome.org/show_bug.cgi?id=720568 --- sys/v4l2/gstv4l2object.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/v4l2/gstv4l2object.c b/sys/v4l2/gstv4l2object.c index 0713f33..67b35c5 100644 --- a/sys/v4l2/gstv4l2object.c +++ b/sys/v4l2/gstv4l2object.c @@ -2072,7 +2072,8 @@ return_data: * value */ gst_structure_set_value (s, "framerate", &rates); g_value_unset (&rates); - } else { + } else if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || + v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { gst_structure_set (s, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL); } @@ -2311,7 +2312,8 @@ default_frame_sizes: if (fix_num) { gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION, fix_num, fix_denom, NULL); - } else { + } else if (v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || + v4l2object->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { /* if norm can't be used, copy the template framerate */ gst_structure_set (tmp, "framerate", GST_TYPE_FRACTION_RANGE, 0, 1, 100, 1, NULL); -- 2.7.4