gst/autoplug/gstspideridentity.c: don't delay links on the sink elements, it causes unnegotiated links.

Original commit message from CVS:
* gst/autoplug/gstspideridentity.c: (gst_spider_identity_link):
don't delay links on the sink elements, it causes unnegotiated
links.
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_base_init):
add our padtemplates, we indeed do have some.
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_handle_event),
(gst_type_find_element_chain):
don't push data when typefinding failed.
* gst/gstpad.c: (gst_pad_link_fixate):
check that no fixate function returns empty caps.
* gst/gstpad.c: (gst_pad_push):
check that the link is negotiated before data gets pushed.
* tools/gst-register.c: (main):
don't assert (fixes #148283)
This commit is contained in:
Benjamin Otte 2004-07-25 15:01:52 +00:00
parent 3330b4665b
commit 1a8f31e577
6 changed files with 61 additions and 9 deletions

View file

@ -1,3 +1,22 @@
2004-07-25 Benjamin Otte <otte@gnome.org>
* gst/autoplug/gstspideridentity.c: (gst_spider_identity_link):
don't delay links on the sink elements, it causes unnegotiated
links.
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_base_init):
add our padtemplates, we indeed do have some.
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_handle_event),
(gst_type_find_element_chain):
don't push data when typefinding failed.
* gst/gstpad.c: (gst_pad_link_fixate):
check that no fixate function returns empty caps.
* gst/gstpad.c: (gst_pad_push):
check that the link is negotiated before data gets pushed.
* tools/gst-register.c: (main):
don't assert (fixes #148283)
2004-07-25 Steve Lhomme <steve.lhomme@free.fr>
* docs/gst/gstreamer-sections.txt:

View file

@ -257,14 +257,15 @@ gst_spider_identity_link (GstPad * pad, const GstCaps * caps)
GST_SPIDER_IDENTITY (gst_pad_get_parent (pad));
GstPad *otherpad;
if (pad == spider_identity->src)
if (pad == spider_identity->src) {
otherpad = spider_identity->sink;
else
otherpad = spider_identity->src;
g_return_val_if_fail (otherpad != NULL, GST_PAD_LINK_REFUSED);
if (GST_PAD_PEER (otherpad) == NULL)
return GST_PAD_LINK_DELAYED;
} else {
otherpad = spider_identity->src;
}
g_return_val_if_fail (otherpad != NULL, GST_PAD_LINK_REFUSED);
return gst_pad_try_set_caps (otherpad, caps);
}

View file

@ -127,6 +127,10 @@ gst_type_find_element_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_sink_template));
gst_element_class_set_details (gstelement_class,
&gst_type_find_element_details);
}
@ -426,9 +430,13 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0,
entry->probability, entry->caps);
}
stop_typefinding (typefind);
gst_pad_event_default (pad, event);
} else {
gst_pad_event_default (pad, event);
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
stop_typefinding (typefind);
}
break;
default:
gst_data_unref (GST_DATA (event));
@ -610,6 +618,7 @@ gst_type_find_element_chain (GstPad * pad, GstData * data)
stop_typefinding (typefind);
} else if (typefind->possibilities == NULL) {
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
stop_typefinding (typefind);
} else {
/* set up typefind element for next iteration */
typefind->possibilities =

View file

@ -1217,6 +1217,11 @@ gst_pad_link_fixate (GstPadLink * link)
if (i == 4) {
/* we trust the default fixation function unconditionally */
bad = FALSE;
} else if (gst_caps_is_empty (newcaps)) {
g_warning
("a fixation function did not fixate correctly, it returned empty caps");
gst_caps_free (newcaps);
continue;
} else if (gst_caps_is_any (caps)) {
bad = gst_caps_is_any (newcaps);
} else {
@ -3176,6 +3181,13 @@ gst_pad_push (GstPad * pad, GstData * data)
return;
}
if (GST_IS_BUFFER (data) && !gst_pad_is_negotiated (pad)) {
g_warning ("pushing data on non-negotiated pad %s:%s, not allowed.",
GST_DEBUG_PAD_NAME (pad));
gst_data_unref (data);
return;
}
GST_CAT_LOG_OBJECT (GST_CAT_SCHEDULING, pad, "pushing");
peer = GST_RPAD_PEER (pad);

View file

@ -127,6 +127,10 @@ gst_type_find_element_base_init (gpointer g_class)
{
GstElementClass *gstelement_class = GST_ELEMENT_CLASS (g_class);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_sink_template));
gst_element_class_set_details (gstelement_class,
&gst_type_find_element_details);
}
@ -426,9 +430,13 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
GST_PLUGIN_FEATURE_NAME (entry->factory), entry->probability);
g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], 0,
entry->probability, entry->caps);
}
stop_typefinding (typefind);
gst_pad_event_default (pad, event);
} else {
gst_pad_event_default (pad, event);
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
stop_typefinding (typefind);
}
break;
default:
gst_data_unref (GST_DATA (event));
@ -610,6 +618,7 @@ gst_type_find_element_chain (GstPad * pad, GstData * data)
stop_typefinding (typefind);
} else if (typefind->possibilities == NULL) {
GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, (NULL), (NULL));
stop_typefinding (typefind);
} else {
/* set up typefind element for next iteration */
typefind->possibilities =

View file

@ -135,7 +135,9 @@ main (int argc, char *argv[])
/* move over paths from this registry to the next one */
path_spill = g_list_concat (path_spill,
gst_registry_get_path_list (registry));
g_assert (path_spill != NULL);
/* this assertion triggers for a non-readable/writable user registry,
* see #148283 */
/* g_assert (path_spill != NULL); */
}
/* also move over paths if the registry wasn't writable
* FIXME: we should check if the paths that were loaded from this