gst/elements/gsttypefindelement.c: Use gst_pad_use_explicit_caps for src pad.

Original commit message from CVS:
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_have_type), (gst_type_find_element_init):
Use gst_pad_use_explicit_caps for src pad.
* gst/gstpad.c: (gst_pad_try_set_caps):  Check that link exists
before using it.
This commit is contained in:
David Schleef 2004-01-03 10:01:35 +00:00
parent d4142ec0a0
commit 599926b18e
6 changed files with 21 additions and 15 deletions

View file

@ -1,3 +1,11 @@
2004-01-03 David Schleef <ds@schleef.org>
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_have_type), (gst_type_find_element_init):
Use gst_pad_use_explicit_caps for src pad.
* gst/gstpad.c: (gst_pad_try_set_caps): Check that link exists
before using it.
2004-01-03 David Schleef <ds@schleef.org>
* gst/gstelement.c: (gst_element_link_pads_filtered),

View file

@ -152,9 +152,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
typefind->caps = gst_caps_copy (caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
gst_pad_set_explicit_caps (typefind->src, gst_caps_copy(caps));
}
static void
gst_type_find_element_base_init (gpointer g_class)
@ -216,6 +214,7 @@ gst_type_find_element_init (GTypeInstance *instance, gpointer g_class)
gst_static_pad_template_get (&type_find_element_src_template), "src");
gst_pad_set_event_function (typefind->src, gst_type_find_element_src_event);
gst_pad_set_event_mask_function (typefind->src, gst_type_find_element_src_event_mask);
gst_pad_use_explicit_caps (typefind->src);
gst_element_add_pad (GST_ELEMENT (typefind), typefind->src);
typefind->caps = NULL;

View file

@ -152,9 +152,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
typefind->caps = gst_caps_copy (caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
gst_pad_set_explicit_caps (typefind->src, gst_caps_copy(caps));
}
static void
gst_type_find_element_base_init (gpointer g_class)
@ -216,6 +214,7 @@ gst_type_find_element_init (GTypeInstance *instance, gpointer g_class)
gst_static_pad_template_get (&type_find_element_src_template), "src");
gst_pad_set_event_function (typefind->src, gst_type_find_element_src_event);
gst_pad_set_event_mask_function (typefind->src, gst_type_find_element_src_event_mask);
gst_pad_use_explicit_caps (typefind->src);
gst_element_add_pad (GST_ELEMENT (typefind), typefind->src);
typefind->caps = NULL;

View file

@ -1268,10 +1268,11 @@ GstPadLinkReturn
gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps)
{
GstPadLink *link;
GstPadLink *oldlink;
GstPadLinkReturn ret;
g_return_val_if_fail (pad != NULL, GST_PAD_LINK_REFUSED);
g_return_val_if_fail (GST_IS_PAD (pad), GST_PAD_LINK_REFUSED);
g_return_val_if_fail (GST_IS_REAL_PAD (pad), GST_PAD_LINK_REFUSED);
g_return_val_if_fail (!GST_FLAG_IS_SET (pad, GST_PAD_NEGOTIATING),
GST_PAD_LINK_REFUSED);
@ -1311,8 +1312,9 @@ gst_pad_try_set_caps (GstPad *pad, const GstCaps *caps)
return GST_PAD_LINK_DELAYED;
}
if (GST_REAL_PAD(pad)->link->filtercaps) {
link->filtercaps = gst_caps_copy (GST_REAL_PAD(pad)->link->filtercaps);
oldlink = GST_REAL_PAD(pad)->link;
if (oldlink && oldlink->filtercaps) {
link->filtercaps = gst_caps_copy (oldlink->filtercaps);
}
if (link->srcpad == pad) {
link->srccaps = gst_caps_copy(caps);

View file

@ -152,9 +152,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
typefind->caps = gst_caps_copy (caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
gst_pad_set_explicit_caps (typefind->src, gst_caps_copy(caps));
}
static void
gst_type_find_element_base_init (gpointer g_class)
@ -216,6 +214,7 @@ gst_type_find_element_init (GTypeInstance *instance, gpointer g_class)
gst_static_pad_template_get (&type_find_element_src_template), "src");
gst_pad_set_event_function (typefind->src, gst_type_find_element_src_event);
gst_pad_set_event_mask_function (typefind->src, gst_type_find_element_src_event_mask);
gst_pad_use_explicit_caps (typefind->src);
gst_element_add_pad (GST_ELEMENT (typefind), typefind->src);
typefind->caps = NULL;

View file

@ -152,9 +152,7 @@ gst_type_find_element_have_type (GstTypeFindElement *typefind, guint probability
GST_INFO_OBJECT (typefind, "found caps %s", caps_str);
g_free (caps_str);
typefind->caps = gst_caps_copy (caps);
if (gst_pad_try_set_caps (typefind->src, caps) < GST_PAD_LINK_OK) {
gst_element_error (GST_ELEMENT (typefind), "could not set caps on source pad");
}
gst_pad_set_explicit_caps (typefind->src, gst_caps_copy(caps));
}
static void
gst_type_find_element_base_init (gpointer g_class)
@ -216,6 +214,7 @@ gst_type_find_element_init (GTypeInstance *instance, gpointer g_class)
gst_static_pad_template_get (&type_find_element_src_template), "src");
gst_pad_set_event_function (typefind->src, gst_type_find_element_src_event);
gst_pad_set_event_mask_function (typefind->src, gst_type_find_element_src_event_mask);
gst_pad_use_explicit_caps (typefind->src);
gst_element_add_pad (GST_ELEMENT (typefind), typefind->src);
typefind->caps = NULL;