mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-27 02:30:35 +00:00
gst/gstpad.c (gst_pad_link_prepare): Re-add gst_pad_link_prepare. Please email the list with specific reasons for rev...
Original commit message from CVS: 2004-02-25 Andy Wingo <wingo@pobox.com> * gst/gstpad.c (gst_pad_link_prepare): Re-add gst_pad_link_prepare. Please email the list with specific reasons for reverting. ----------------------------------------------------------------------
This commit is contained in:
parent
3f5a8814d5
commit
bc13ad8a9e
2 changed files with 60 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
|||
2004-02-25 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* gst/gstpad.c (gst_pad_link_prepare): Re-add
|
||||
gst_pad_link_prepare. Please email the list with specific reasons
|
||||
for reverting.
|
||||
|
||||
2004-02-24 Andy Wingo <wingo@pobox.com>
|
||||
|
||||
* gst/gstelement.c (gst_element_dispose): Protect against multiple
|
||||
|
|
59
gst/gstpad.c
59
gst/gstpad.c
|
@ -1552,11 +1552,6 @@ gst_pad_can_link_filtered (GstPad *srcpad, GstPad *sinkpad,
|
|||
realsrc = GST_PAD_REALIZE (srcpad);
|
||||
realsink = GST_PAD_REALIZE (sinkpad);
|
||||
|
||||
g_return_val_if_fail (GST_RPAD_PEER (realsrc) == NULL, NULL);
|
||||
g_return_val_if_fail (GST_RPAD_PEER (realsink) == NULL, NULL);
|
||||
g_return_val_if_fail (GST_PAD_PARENT (realsrc) != NULL, NULL);
|
||||
g_return_val_if_fail (GST_PAD_PARENT (realsink) != NULL, NULL);
|
||||
|
||||
if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) {
|
||||
GST_CAT_INFO (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
|
||||
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
|
||||
|
@ -2089,6 +2084,60 @@ gst_pad_unnegotiate (GstPad *pad)
|
|||
gst_pad_link_unnegotiate (link);
|
||||
}
|
||||
|
||||
/* returning NULL indicates that the arguments are invalid */
|
||||
static GstPadLink*
|
||||
gst_pad_link_prepare (GstPad *srcpad, GstPad *sinkpad,
|
||||
const GstCaps *filtercaps)
|
||||
{
|
||||
GstRealPad *realsrc, *realsink;
|
||||
GstPadLink *link;
|
||||
|
||||
g_return_val_if_fail (GST_IS_PAD (srcpad), NULL);
|
||||
g_return_val_if_fail (GST_IS_PAD (sinkpad), NULL);
|
||||
|
||||
realsrc = GST_PAD_REALIZE (srcpad);
|
||||
realsink = GST_PAD_REALIZE (sinkpad);
|
||||
|
||||
if ((GST_PAD (realsrc) != srcpad) || (GST_PAD (realsink) != sinkpad)) {
|
||||
GST_CAT_DEBUG (GST_CAT_PADS, "*actually* linking %s:%s and %s:%s",
|
||||
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink));
|
||||
}
|
||||
|
||||
g_return_val_if_fail (GST_RPAD_PEER (realsrc) == NULL, NULL);
|
||||
g_return_val_if_fail (GST_RPAD_PEER (realsink) == NULL, NULL);
|
||||
g_return_val_if_fail (GST_PAD_PARENT (realsrc) != NULL, NULL);
|
||||
g_return_val_if_fail (GST_PAD_PARENT (realsink) != NULL, NULL);
|
||||
|
||||
if (!gst_pad_check_schedulers (realsrc, realsink)) {
|
||||
g_warning ("linking pads with different scheds requires "
|
||||
"exactly one decoupled element (such as queue)");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (GST_RPAD_DIRECTION (realsrc) == GST_RPAD_DIRECTION (realsink)) {
|
||||
g_warning ("%s:%s and %s:%s are both %s pads, failed",
|
||||
GST_DEBUG_PAD_NAME (realsrc), GST_DEBUG_PAD_NAME (realsink),
|
||||
GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC ? "src" : "sink");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
link = gst_pad_link_new ();
|
||||
|
||||
if (GST_RPAD_DIRECTION (realsrc) == GST_PAD_SRC) {
|
||||
link->srcpad = GST_PAD (realsrc);
|
||||
link->sinkpad = GST_PAD (realsink);
|
||||
} else {
|
||||
link->srcpad = GST_PAD (realsink);
|
||||
link->sinkpad = GST_PAD (realsrc);
|
||||
}
|
||||
|
||||
link->srccaps = gst_pad_get_caps (link->srcpad);
|
||||
link->sinkcaps = gst_pad_get_caps (link->sinkpad);
|
||||
if (filtercaps) link->filtercaps = gst_caps_copy (filtercaps);
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
/**
|
||||
* gst_pad_try_relink_filtered:
|
||||
* @srcpad: the source #GstPad to relink.
|
||||
|
|
Loading…
Reference in a new issue