mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 19:51:11 +00:00
Negotiation fixes
Original commit message from CVS: Negotiation fixes
This commit is contained in:
parent
8f8aaf83f4
commit
2ecb08f2bd
7 changed files with 19 additions and 96 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2003-12-31 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
|
* gst/elements/gstshaper.c: (gst_shaper_link):
|
||||||
|
* gst/elements/gsttee.c: (gst_tee_init), (gst_tee_request_new_pad):
|
||||||
|
* gst/gstqueue.c: (gst_queue_link):
|
||||||
|
Negotiation fixes.
|
||||||
|
|
||||||
2003-12-31 David Schleef <ds@schleef.org>
|
2003-12-31 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* gst/gstpad.c: (gst_pad_proxy_pad_link), (gst_pad_proxy_fixate):
|
* gst/gstpad.c: (gst_pad_proxy_pad_link), (gst_pad_proxy_fixate):
|
||||||
|
|
|
@ -213,7 +213,7 @@ gst_shaper_link (GstPad *pad, const GstCaps *caps)
|
||||||
|
|
||||||
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
|
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
|
||||||
|
|
||||||
return gst_pad_proxy_link (otherpad, caps);
|
return gst_pad_try_set_caps (otherpad, caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstShaperConnection*
|
static GstShaperConnection*
|
||||||
|
|
|
@ -137,58 +137,15 @@ gst_tee_class_init (GstTeeClass *klass)
|
||||||
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
|
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadLinkReturn
|
|
||||||
gst_tee_sinklink (GstPad *pad, const GstCaps *caps)
|
|
||||||
{
|
|
||||||
GstTee *tee;
|
|
||||||
const GList *pads;
|
|
||||||
GstPadLinkReturn set_retval;
|
|
||||||
|
|
||||||
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
|
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
if (!gst_caps_is_fixed (caps)) {
|
|
||||||
return GST_PAD_LINK_DELAYED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* go through all the src pads */
|
|
||||||
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
|
|
||||||
|
|
||||||
while (pads) {
|
|
||||||
GstPad *outpad = GST_PAD (pads->data);
|
|
||||||
pads = g_list_next (pads);
|
|
||||||
|
|
||||||
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC || !GST_PAD_IS_LINKED (outpad))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((set_retval = gst_pad_try_set_caps (outpad, caps)) <= 0) {
|
|
||||||
return set_retval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return GST_PAD_LINK_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstPadLinkReturn
|
|
||||||
gst_tee_srclink (GstPad *pad, const GstCaps *caps)
|
|
||||||
{
|
|
||||||
GstTee *tee;
|
|
||||||
|
|
||||||
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
|
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
return gst_pad_proxy_link (tee->sinkpad, caps);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_tee_init (GstTee *tee)
|
gst_tee_init (GstTee *tee)
|
||||||
{
|
{
|
||||||
tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
|
||||||
gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
|
gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
|
||||||
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinklink));
|
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
gst_pad_set_fixate_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_fixate));
|
||||||
|
|
||||||
tee->silent = FALSE;
|
tee->silent = FALSE;
|
||||||
tee->last_message = NULL;
|
tee->last_message = NULL;
|
||||||
|
@ -246,8 +203,9 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
|
|
||||||
srcpad = gst_pad_new_from_template (templ, name);
|
srcpad = gst_pad_new_from_template (templ, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
gst_pad_set_link_function (srcpad, GST_DEBUG_FUNCPTR (gst_tee_srclink));
|
gst_pad_set_link_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
gst_pad_set_fixate_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_fixate));
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
||||||
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
||||||
|
|
||||||
|
|
|
@ -332,7 +332,7 @@ gst_queue_otherpad (GstPad *pad)
|
||||||
static GstPadLinkReturn
|
static GstPadLinkReturn
|
||||||
gst_queue_link (GstPad *pad, const GstCaps *caps)
|
gst_queue_link (GstPad *pad, const GstCaps *caps)
|
||||||
{
|
{
|
||||||
return gst_pad_proxy_link (gst_queue_otherpad (pad), caps);
|
return gst_pad_try_set_caps (gst_queue_otherpad (pad), caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
|
@ -332,7 +332,7 @@ gst_queue_otherpad (GstPad *pad)
|
||||||
static GstPadLinkReturn
|
static GstPadLinkReturn
|
||||||
gst_queue_link (GstPad *pad, const GstCaps *caps)
|
gst_queue_link (GstPad *pad, const GstCaps *caps)
|
||||||
{
|
{
|
||||||
return gst_pad_proxy_link (gst_queue_otherpad (pad), caps);
|
return gst_pad_try_set_caps (gst_queue_otherpad (pad), caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
|
@ -213,7 +213,7 @@ gst_shaper_link (GstPad *pad, const GstCaps *caps)
|
||||||
|
|
||||||
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
|
otherpad = (pad == connection->srcpad ? connection->sinkpad : connection->srcpad);
|
||||||
|
|
||||||
return gst_pad_proxy_link (otherpad, caps);
|
return gst_pad_try_set_caps (otherpad, caps);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstShaperConnection*
|
static GstShaperConnection*
|
||||||
|
|
|
@ -137,58 +137,15 @@ gst_tee_class_init (GstTeeClass *klass)
|
||||||
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
|
gstelement_class->request_new_pad = GST_DEBUG_FUNCPTR(gst_tee_request_new_pad);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstPadLinkReturn
|
|
||||||
gst_tee_sinklink (GstPad *pad, const GstCaps *caps)
|
|
||||||
{
|
|
||||||
GstTee *tee;
|
|
||||||
const GList *pads;
|
|
||||||
GstPadLinkReturn set_retval;
|
|
||||||
|
|
||||||
GST_DEBUG ( "gst_tee_sinklink caps=%s", gst_caps_to_string(caps));
|
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
if (!gst_caps_is_fixed (caps)) {
|
|
||||||
return GST_PAD_LINK_DELAYED;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* go through all the src pads */
|
|
||||||
pads = gst_element_get_pad_list (GST_ELEMENT (tee));
|
|
||||||
|
|
||||||
while (pads) {
|
|
||||||
GstPad *outpad = GST_PAD (pads->data);
|
|
||||||
pads = g_list_next (pads);
|
|
||||||
|
|
||||||
if (GST_PAD_DIRECTION (outpad) != GST_PAD_SRC || !GST_PAD_IS_LINKED (outpad))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if ((set_retval = gst_pad_try_set_caps (outpad, caps)) <= 0) {
|
|
||||||
return set_retval;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return GST_PAD_LINK_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GstPadLinkReturn
|
|
||||||
gst_tee_srclink (GstPad *pad, const GstCaps *caps)
|
|
||||||
{
|
|
||||||
GstTee *tee;
|
|
||||||
|
|
||||||
GST_DEBUG ( "gst_tee_srclink caps=%s", gst_caps_to_string(caps));
|
|
||||||
|
|
||||||
tee = GST_TEE (gst_pad_get_parent (pad));
|
|
||||||
|
|
||||||
return gst_pad_proxy_link (tee->sinkpad, caps);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_tee_init (GstTee *tee)
|
gst_tee_init (GstTee *tee)
|
||||||
{
|
{
|
||||||
tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
tee->sinkpad = gst_pad_new ("sink", GST_PAD_SINK);
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
|
gst_element_add_pad (GST_ELEMENT (tee), tee->sinkpad);
|
||||||
gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
|
gst_pad_set_chain_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_chain));
|
||||||
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_tee_sinklink));
|
gst_pad_set_link_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
gst_pad_set_fixate_function (tee->sinkpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_fixate));
|
||||||
|
|
||||||
tee->silent = FALSE;
|
tee->silent = FALSE;
|
||||||
tee->last_message = NULL;
|
tee->last_message = NULL;
|
||||||
|
@ -246,8 +203,9 @@ gst_tee_request_new_pad (GstElement *element, GstPadTemplate *templ, const gchar
|
||||||
|
|
||||||
srcpad = gst_pad_new_from_template (templ, name);
|
srcpad = gst_pad_new_from_template (templ, name);
|
||||||
g_free (name);
|
g_free (name);
|
||||||
gst_pad_set_link_function (srcpad, GST_DEBUG_FUNCPTR (gst_tee_srclink));
|
gst_pad_set_link_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_pad_link));
|
||||||
gst_pad_set_getcaps_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
gst_pad_set_getcaps_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_getcaps));
|
||||||
|
gst_pad_set_fixate_function (srcpad, GST_DEBUG_FUNCPTR (gst_pad_proxy_fixate));
|
||||||
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
gst_element_add_pad (GST_ELEMENT (tee), srcpad);
|
||||||
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
GST_PAD_ELEMENT_PRIVATE (srcpad) = NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue