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
This commit is contained in:
parent
f1e09f94aa
commit
e730de0bce
@ -110,16 +110,18 @@ static GstElementClass *parent_class = NULL;
|
|||||||
//static guint gst_filter_signals[LAST_SIGNAL] = { 0 };
|
//static guint gst_filter_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
static GstPadConnectReturn
|
static GstPadConnectReturn
|
||||||
speed_connect_sink (GstPad *pad, GstCaps *caps)
|
speed_connect (GstPad *pad, GstCaps *caps)
|
||||||
{
|
{
|
||||||
GstSpeed *filter;
|
GstSpeed *filter;
|
||||||
|
GstPad *otherpad;
|
||||||
|
|
||||||
filter = GST_SPEED (gst_pad_get_parent (pad));
|
filter = GST_SPEED (gst_pad_get_parent (pad));
|
||||||
g_return_val_if_fail (filter != NULL, GST_PAD_CONNECT_REFUSED);
|
g_return_val_if_fail (filter != NULL, GST_PAD_CONNECT_REFUSED);
|
||||||
g_return_val_if_fail (GST_IS_SPEED (filter), 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 (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_REFUSED;
|
||||||
|
|
||||||
return GST_PAD_CONNECT_OK;
|
return GST_PAD_CONNECT_OK;
|
||||||
@ -219,9 +221,10 @@ static void
|
|||||||
speed_init (GstSpeed *filter)
|
speed_init (GstSpeed *filter)
|
||||||
{
|
{
|
||||||
filter->sinkpad = gst_pad_new_from_template(speed_sink_factory (),"sink");
|
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);
|
gst_pad_set_bufferpool_function (filter->sinkpad, speed_sink_get_bufferpool);
|
||||||
filter->srcpad = gst_pad_new_from_template(speed_src_factory (),"src");
|
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->sinkpad);
|
||||||
gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad);
|
gst_element_add_pad(GST_ELEMENT(filter),filter->srcpad);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user