Commit c0ea459e authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

gst/elements/gsttee.c: I think this is actually moer correct...

Original commit message from CVS:
* gst/elements/gsttee.c: (gst_tee_getcaps), (gst_tee_link):
I think this is actually moer correct...
parent 7e75b2b0
2005-01-17 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/elements/gsttee.c: (gst_tee_getcaps), (gst_tee_link):
I think this is actually moer correct...
2005-01-16 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
* gst/gstprobe.c: (gst_probe_dispatcher_dispatch):
......
......@@ -162,62 +162,53 @@ name_pad_compare (gconstpointer a, gconstpointer b)
}
static GstCaps *
gst_tee_getcaps (GstPad * pad)
gst_tee_getcaps (GstPad * _pad)
{
GstTee *tee = GST_TEE (gst_pad_get_parent (pad));
if (pad == tee->sinkpad) {
GstCaps *caps = gst_caps_new_any (), *tmp, *res;
const GList *pads;
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
if (!GST_PAD_IS_SRC (pads->data))
continue;
tmp = gst_pad_get_allowed_caps (GST_PAD (pads->data));
res = gst_caps_intersect (caps, tmp);
gst_caps_free (tmp);
gst_caps_free (caps);
caps = res;
}
GstTee *tee = GST_TEE (gst_pad_get_parent (_pad));
GstCaps *caps = gst_caps_new_any (), *tmp, *res;
GstPad *pad;
const GList *pads;
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
pad = GST_PAD (pads->data);
if (pad == _pad)
continue;
return caps;
} else {
return gst_pad_get_allowed_caps (tee->sinkpad);
tmp = gst_pad_get_allowed_caps (pad);
res = gst_caps_intersect (caps, tmp);
gst_caps_free (tmp);
gst_caps_free (caps);
caps = res;
}
return caps;
}
static GstPadLinkReturn
gst_tee_link (GstPad * pad, const GstCaps * caps)
gst_tee_link (GstPad * _pad, const GstCaps * caps)
{
GstTee *tee = GST_TEE (gst_pad_get_parent (pad));
if (pad == tee->sinkpad) {
GstPadLinkReturn res;
const GList *pads;
GST_DEBUG_OBJECT (tee, "Forwarding link to all source pads");
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
if (!GST_PAD_IS_SRC (pads->data))
continue;
GstTee *tee = GST_TEE (gst_pad_get_parent (_pad));
GstPadLinkReturn res;
GstPad *pad;
const GList *pads;
res = gst_pad_try_set_caps (GST_PAD (pads->data), caps);
GST_DEBUG_OBJECT (tee, "Pad %s:%s gave response %d",
GST_DEBUG_PAD_NAME (GST_PAD (pads->data)), res);
if (GST_PAD_LINK_FAILED (res))
return res;
}
GST_DEBUG_OBJECT (tee, "Forwarding link to all other pads");
return GST_PAD_LINK_OK;
} else {
GST_DEBUG_OBJECT (tee, "Forwarding negotiation from source pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
pad = GST_PAD (pads->data);
if (pad == _pad)
continue;
return gst_pad_try_set_caps (tee->sinkpad, caps);
res = gst_pad_try_set_caps (pad, caps);
GST_DEBUG_OBJECT (tee, "Pad %s:%s gave response %d",
GST_DEBUG_PAD_NAME (pad), res);
if (GST_PAD_LINK_FAILED (res))
return res;
}
return GST_PAD_LINK_OK;
}
static GstPad *
......
......@@ -162,62 +162,53 @@ name_pad_compare (gconstpointer a, gconstpointer b)
}
static GstCaps *
gst_tee_getcaps (GstPad * pad)
gst_tee_getcaps (GstPad * _pad)
{
GstTee *tee = GST_TEE (gst_pad_get_parent (pad));
if (pad == tee->sinkpad) {
GstCaps *caps = gst_caps_new_any (), *tmp, *res;
const GList *pads;
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
if (!GST_PAD_IS_SRC (pads->data))
continue;
tmp = gst_pad_get_allowed_caps (GST_PAD (pads->data));
res = gst_caps_intersect (caps, tmp);
gst_caps_free (tmp);
gst_caps_free (caps);
caps = res;
}
GstTee *tee = GST_TEE (gst_pad_get_parent (_pad));
GstCaps *caps = gst_caps_new_any (), *tmp, *res;
GstPad *pad;
const GList *pads;
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
pad = GST_PAD (pads->data);
if (pad == _pad)
continue;
return caps;
} else {
return gst_pad_get_allowed_caps (tee->sinkpad);
tmp = gst_pad_get_allowed_caps (pad);
res = gst_caps_intersect (caps, tmp);
gst_caps_free (tmp);
gst_caps_free (caps);
caps = res;
}
return caps;
}
static GstPadLinkReturn
gst_tee_link (GstPad * pad, const GstCaps * caps)
gst_tee_link (GstPad * _pad, const GstCaps * caps)
{
GstTee *tee = GST_TEE (gst_pad_get_parent (pad));
if (pad == tee->sinkpad) {
GstPadLinkReturn res;
const GList *pads;
GST_DEBUG_OBJECT (tee, "Forwarding link to all source pads");
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
if (!GST_PAD_IS_SRC (pads->data))
continue;
GstTee *tee = GST_TEE (gst_pad_get_parent (_pad));
GstPadLinkReturn res;
GstPad *pad;
const GList *pads;
res = gst_pad_try_set_caps (GST_PAD (pads->data), caps);
GST_DEBUG_OBJECT (tee, "Pad %s:%s gave response %d",
GST_DEBUG_PAD_NAME (GST_PAD (pads->data)), res);
if (GST_PAD_LINK_FAILED (res))
return res;
}
GST_DEBUG_OBJECT (tee, "Forwarding link to all other pads");
return GST_PAD_LINK_OK;
} else {
GST_DEBUG_OBJECT (tee, "Forwarding negotiation from source pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
for (pads = gst_element_get_pad_list (GST_ELEMENT (tee));
pads != NULL; pads = pads->next) {
pad = GST_PAD (pads->data);
if (pad == _pad)
continue;
return gst_pad_try_set_caps (tee->sinkpad, caps);
res = gst_pad_try_set_caps (pad, caps);
GST_DEBUG_OBJECT (tee, "Pad %s:%s gave response %d",
GST_DEBUG_PAD_NAME (pad), res);
if (GST_PAD_LINK_FAILED (res))
return res;
}
return GST_PAD_LINK_OK;
}
static GstPad *
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment