From 3b47dd30d634d9797a170b372c765a22897aa3c3 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Wed, 12 May 2004 14:53:58 +0000 Subject: ext/audiofile/gstafsrc.c: Remove old debug output Original commit message from CVS: * ext/audiofile/gstafsrc.c: (gst_afsrc_get): Remove old debug output * ext/dv/gstdvdec.c: (gst_dvdec_quality_get_type), (gst_dvdec_class_init), (gst_dvdec_loop), (gst_dvdec_change_state), (gst_dvdec_set_property), (gst_dvdec_get_property): Change the quality setting to an enum, so it works from gst-launch Don't renegotiate a non-linked pad. Allows audio only decoding. * gst/deinterlace/gstdeinterlace.c: (gst_deinterlace_getcaps), (gst_deinterlace_link), (gst_deinterlace_init): * gst/videodrop/gstvideodrop.c: (gst_videodrop_getcaps), (gst_videodrop_link): Some caps negotiation fixes --- gst/videodrop/gstvideodrop.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'gst/videodrop/gstvideodrop.c') diff --git a/gst/videodrop/gstvideodrop.c b/gst/videodrop/gstvideodrop.c index e4f2e4ec..447a1bc7 100644 --- a/gst/videodrop/gstvideodrop.c +++ b/gst/videodrop/gstvideodrop.c @@ -162,9 +162,9 @@ gst_videodrop_getcaps (GstPad * pad) gst_structure_set (structure, "framerate", GST_TYPE_DOUBLE_RANGE, 0.0, G_MAXDOUBLE, NULL); } - if (negotiated) { - for (i = 0; i < gst_caps_get_size (caps); i++) { - structure = gst_caps_get_structure (caps, i); + if ((negotiated) && (videodrop->speed != 1.0)) { + for (i = 0; i < gst_caps_get_size (copy2); i++) { + structure = gst_caps_get_structure (copy2, i); gst_structure_set (structure, "framerate", G_TYPE_DOUBLE, otherfps * videodrop->speed, NULL); @@ -195,14 +195,30 @@ gst_videodrop_link (GstPad * pad, const GstCaps * caps) ret = gst_structure_get_double (structure, "framerate", &fps); if (!ret) return GST_PAD_LINK_REFUSED; + if (pad == videodrop->srcpad) { - videodrop->from_fps = fps; - } else { videodrop->to_fps = fps; + } else { + videodrop->from_fps = fps; } if (gst_pad_is_negotiated (otherpad)) { - gst_pad_renegotiate (otherpad); + /* + * Ensure that the other side talks the format we're trying to set + */ + GstCaps *newcaps = gst_caps_copy (caps); + + if (pad == videodrop->srcpad) { + gst_caps_set_simple (newcaps, + "framerate", G_TYPE_DOUBLE, videodrop->from_fps, NULL); + } else { + gst_caps_set_simple (newcaps, + "framerate", G_TYPE_DOUBLE, videodrop->to_fps, NULL); + } + ret = gst_pad_try_set_caps (otherpad, newcaps); + if (GST_PAD_LINK_FAILED (ret)) { + return GST_PAD_LINK_REFUSED; + } } return GST_PAD_LINK_OK; -- cgit v1.2.1