gst/elements/gsttypefindelement.c: Don't restart typefinding on a discont.

Original commit message from CVS:
2005-06-23  Jan Schmidt  <thaytan@mad.scientist.com>

* gst/elements/gsttypefindelement.c:
(gst_type_find_element_handle_event):
Don't restart typefinding on a discont.
* gst/gstelement.c: (gst_element_set_state):
Debug spelling fix.
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_send_event):
Allow changing mode of an active pad.
Debug output fixes.
* gst/registries/gstlibxmlregistry.c: (load_feature):
Don't cast a static pad template to a normal pad template.
This commit is contained in:
Jan Schmidt 2005-06-23 11:43:39 +00:00
parent e6b233bb4d
commit 8bd306b791
6 changed files with 30 additions and 13 deletions

View file

@ -1,3 +1,16 @@
2005-06-23 Jan Schmidt <thaytan@mad.scientist.com>
* gst/elements/gsttypefindelement.c:
(gst_type_find_element_handle_event):
Don't restart typefinding on a discont.
* gst/gstelement.c: (gst_element_set_state):
Debug spelling fix.
* gst/gstpad.c: (gst_pad_set_active), (gst_pad_send_event):
Allow changing mode of an active pad.
Debug output fixes.
* gst/registries/gstlibxmlregistry.c: (load_feature):
Don't cast a static pad template to a normal pad template.
2005-06-23 Thomas Vander Stichele <thomas at apestaart dot org>
* check/gst/gstvalue.c: (START_TEST), (gst_value_suite):

View file

@ -514,7 +514,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
}
break;
case MODE_NORMAL:
if (GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
if (FALSE) { // GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
start_typefinding (typefind);
gst_event_unref (event);
res = TRUE;

View file

@ -1781,7 +1781,8 @@ invalid_return:
{
GST_STATE_UNLOCK (element);
/* somebody added a GST_STATE_ and forgot to do stuff here ! */
g_critical ("unkown return value from a state change function");
g_critical ("unknown return value %d from a state change function",
return_val);
return GST_STATE_FAILURE;
}
}

View file

@ -427,7 +427,7 @@ gst_pad_set_active (GstPad * pad, GstActivateMode mode)
oldactive = GST_PAD_MODE_ACTIVATE (old);
/* if nothing changed, we can just exit */
if (G_UNLIKELY (oldactive == active))
if (G_UNLIKELY (oldactive == active && old == mode))
goto was_ok;
/* FIXME, no mode switching yet, need more design docs first */
@ -436,8 +436,10 @@ gst_pad_set_active (GstPad * pad, GstActivateMode mode)
goto was_ok;
#endif
/* make sure data is disallowed when going inactive */
if (!active) {
/* make sure data is disallowed when going inactive or changing
* mode
*/
if (!active || oldactive) {
GST_CAT_DEBUG (GST_CAT_PADS, "de-activating pad %s:%s",
GST_DEBUG_PAD_NAME (pad));
GST_PAD_SET_FLUSHING (pad);
@ -2915,12 +2917,11 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
if (GST_EVENT_SRC (event) == NULL)
GST_EVENT_SRC (event) = gst_object_ref (GST_OBJECT (pad));
GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d on pad %s:%s",
GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH:
GST_CAT_DEBUG (GST_CAT_EVENT, "have flush event");
GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d (FLUSH) on pad %s:%s",
GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
if (GST_EVENT_FLUSH_DONE (event)) {
GST_PAD_UNSET_FLUSHING (pad);
GST_CAT_DEBUG (GST_CAT_EVENT, "cleared flush flag");
@ -2933,6 +2934,9 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
}
break;
default:
GST_CAT_DEBUG (GST_CAT_EVENT, "have event type %d on pad %s:%s",
GST_EVENT_TYPE (event), GST_DEBUG_PAD_NAME (pad));
if (GST_PAD_IS_FLUSHING (pad))
goto flushing;
break;
@ -2962,7 +2966,7 @@ no_function:
flushing:
{
GST_UNLOCK (pad);
GST_CAT_DEBUG (GST_CAT_EVENT, "received event on flushing pad");
GST_CAT_DEBUG (GST_CAT_EVENT, "Received event on flushing pad. Discarding");
gst_event_unref (event);
return FALSE;
}

View file

@ -762,8 +762,7 @@ load_feature (xmlTextReaderPtr reader)
if (template) {
GST_LOG ("adding template %s to factory %s",
GST_PAD_TEMPLATE_NAME_TEMPLATE (template),
GST_PLUGIN_FEATURE_NAME (feature));
template->name_template, GST_PLUGIN_FEATURE_NAME (feature));
__gst_element_factory_add_static_pad_template (factory, template);
}
}

View file

@ -514,7 +514,7 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event)
}
break;
case MODE_NORMAL:
if (GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
if (FALSE) { // GST_EVENT_TYPE (event) == GST_EVENT_DISCONTINUOUS) {
start_typefinding (typefind);
gst_event_unref (event);
res = TRUE;