fix proxying elements to query peer caps and not their own ones

Original commit message from CVS:
fix proxying elements to query peer caps and not their own ones
This commit is contained in:
Benjamin Otte 2003-12-17 05:16:11 +00:00
parent b2bf8cc44a
commit 91b84eb539
3 changed files with 22 additions and 6 deletions

View file

@ -254,16 +254,20 @@ gst_spider_identity_getcaps (GstPad *pad)
{
GstSpiderIdentity *spider_identity = GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
GstPad *otherpad;
GstPad *peer;
if (pad == spider_identity->src)
otherpad = spider_identity->sink;
else
otherpad = spider_identity->src;
if (otherpad != NULL)
return gst_pad_get_allowed_caps (otherpad);
return NULL;
if (otherpad != NULL) {
peer = GST_PAD_PEER (otherpad);
if (peer)
return gst_pad_get_caps (peer);
}
return gst_caps2_new_any ();
}
GstPad*

View file

@ -167,6 +167,7 @@ gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
GstPad *otherpad;
GstPad *peer;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
@ -175,8 +176,13 @@ gst_identity_getcaps (GstPad *pad)
}
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
peer = GST_PAD_PEER (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
if (peer) {
return gst_pad_get_caps (peer);
} else {
return gst_caps2_new_any ();
}
}
static GstPadLinkReturn

View file

@ -167,6 +167,7 @@ gst_identity_getcaps (GstPad *pad)
{
GstIdentity *identity;
GstPad *otherpad;
GstPad *peer;
identity = GST_IDENTITY (gst_pad_get_parent (pad));
@ -175,8 +176,13 @@ gst_identity_getcaps (GstPad *pad)
}
otherpad = (pad == identity->srcpad ? identity->sinkpad : identity->srcpad);
peer = GST_PAD_PEER (otherpad);
return gst_caps2_copy (gst_pad_get_allowed_caps (otherpad));
if (peer) {
return gst_pad_get_caps (peer);
} else {
return gst_caps2_new_any ();
}
}
static GstPadLinkReturn