From e730de0bce435716cd48d79d21eeaf21e6838461 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 19 Feb 2002 05:59:06 +0000 Subject: changes to spider: add padtemplates so the connect functions can connect two request-pad elements add a hack in gstel... Original commit message from CVS: * changes to spider: * add padtemplates so the connect functions can connect two request-pad elements * add a hack in gstelement.c. please look at this, Company, and see how we can get around this * add backwards caps-propagation support in identity, int2float, float2int, adder, speed, volume --- gst/speed/gstspeed.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gst/speed/gstspeed.c') diff --git a/gst/speed/gstspeed.c b/gst/speed/gstspeed.c index bbbe7fd8..e91604df 100644 --- a/gst/speed/gstspeed.c +++ b/gst/speed/gstspeed.c @@ -110,16 +110,18 @@ static GstElementClass *parent_class = NULL; //static guint gst_filter_signals[LAST_SIGNAL] = { 0 }; static GstPadConnectReturn -speed_connect_sink (GstPad *pad, GstCaps *caps) +speed_connect (GstPad *pad, GstCaps *caps) { GstSpeed *filter; + GstPad *otherpad; filter = GST_SPEED (gst_pad_get_parent (pad)); g_return_val_if_fail (filter != NULL, GST_PAD_CONNECT_REFUSED); g_return_val_if_fail (GST_IS_SPEED (filter), GST_PAD_CONNECT_REFUSED); - + otherpad = (pad == filter->srcpad ? filter->sinkpad : filter->srcpad); + if (GST_CAPS_IS_FIXED (caps)) { - if (!speed_parse_caps (filter, caps) || !gst_pad_try_set_caps (filter->srcpad, caps)) + if (!speed_parse_caps (filter, caps) || !gst_pad_try_set_caps (otherpad, caps)) return GST_PAD_CONNECT_REFUSED; return GST_PAD_CONNECT_OK; @@ -219,9 +221,10 @@ static void speed_init (GstSpeed *filter) { filter->sinkpad = gst_pad_new_from_template(speed_sink_factory (),"sink"); - gst_pad_set_connect_function(filter->sinkpad,speed_connect_sink); + gst_pad_set_connect_function(filter->sinkpad,speed_connect); gst_pad_set_bufferpool_function (filter->sinkpad, speed_sink_get_bufferpool); filter->srcpad = gst_pad_new_from_template(speed_src_factory (),"src"); + gst_pad_set_connect_function(filter->srcpad,speed_connect); gst_element_add_pad(GST_ELEMENT(filter),filter->sinkpad); gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad); -- cgit v1.2.1