capsnego fixes in adder, speed, and identity

Original commit message from CVS:
capsnego fixes in adder, speed, and identity
This commit is contained in:
Andy Wingo 2002-02-17 17:34:23 +00:00
parent b45b280847
commit 7e7cf82d70
2 changed files with 34 additions and 0 deletions

View file

@ -137,6 +137,22 @@ gst_identity_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstPadConnectReturn
gst_identity_connect_sink (GstPad *pad, GstCaps *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
if (GST_CAPS_IS_FIXED (caps))
if (gst_pad_try_set_caps (identity->srcpad, caps))
return GST_PAD_CONNECT_OK;
else
return GST_PAD_CONNECT_REFUSED;
else
return GST_PAD_CONNECT_DELAYED;
}
static void
gst_identity_init (GstIdentity *identity)
{
@ -144,6 +160,7 @@ gst_identity_init (GstIdentity *identity)
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect_sink);
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);

View file

@ -137,6 +137,22 @@ gst_identity_get_bufferpool (GstPad *pad)
return gst_pad_get_bufferpool (identity->srcpad);
}
static GstPadConnectReturn
gst_identity_connect_sink (GstPad *pad, GstCaps *caps)
{
GstIdentity *identity;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
if (GST_CAPS_IS_FIXED (caps))
if (gst_pad_try_set_caps (identity->srcpad, caps))
return GST_PAD_CONNECT_OK;
else
return GST_PAD_CONNECT_REFUSED;
else
return GST_PAD_CONNECT_DELAYED;
}
static void
gst_identity_init (GstIdentity *identity)
{
@ -144,6 +160,7 @@ gst_identity_init (GstIdentity *identity)
gst_element_add_pad (GST_ELEMENT (identity), identity->sinkpad);
gst_pad_set_chain_function (identity->sinkpad, GST_DEBUG_FUNCPTR (gst_identity_chain));
gst_pad_set_bufferpool_function (identity->sinkpad, gst_identity_get_bufferpool);
gst_pad_set_connect_function (identity->sinkpad, gst_identity_connect_sink);
identity->srcpad = gst_pad_new ("src", GST_PAD_SRC);
gst_element_add_pad (GST_ELEMENT (identity), identity->srcpad);