diff --git a/ChangeLog b/ChangeLog index 76d40cc78d..d795ca3afb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2004-07-09 Thomas Vander Stichele + + * docs/gst/tmpl/gstelement.sgml: + * docs/gst/tmpl/gstplugin.sgml: + * docs/gst/tmpl/gsttypes.sgml: + * docs/pwg/building-state.xml: + * gst/elements/gstfakesrc.c: (gst_fakesrc_change_state): + * gst/gstelement.c: (gst_element_change_state): + * gst/gstthread.c: (gst_thread_change_state): + catch wrong state changes in element base class. + 2004-07-09 Thomas Vander Stichele * gst/gstinfo.h: diff --git a/docs/gst/tmpl/gstelement.sgml b/docs/gst/tmpl/gstelement.sgml index d6e0772f22..6263b4e824 100644 --- a/docs/gst/tmpl/gstelement.sgml +++ b/docs/gst/tmpl/gstelement.sgml @@ -76,6 +76,8 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: + @gstelement: the object which received the signal. @@ -83,6 +85,11 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: +@: +@: +@: + @gstelement: the object which received the signal. @arg1: @arg2: @@ -93,6 +100,10 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: +@: +@: + @gstelement: the object which received the signal. @arg1: @arg2: @@ -102,6 +113,9 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: +@: + @gstelement: the object which received the signal. @arg1: @@ -110,6 +124,8 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: + @gstelement: the object which received the signal. @@ -117,6 +133,9 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: +@: + @gstelement: the object which received the signal. @arg1: @@ -125,6 +144,10 @@ and gst_element_set_clock(). You can wait for the clock to reach a given +@: +@: +@: + @gstelement: the object which received the signal. @arg1: @arg2: @@ -362,14 +385,6 @@ Get the parent object of this element. @obj: a #GstElement to query - - -Get the manager of this element. - - -@obj: a #GstElement to query - - Get the scheduler of this element. diff --git a/docs/gst/tmpl/gstplugin.sgml b/docs/gst/tmpl/gstplugin.sgml index 4b014d425a..ce74670217 100644 --- a/docs/gst/tmpl/gstplugin.sgml +++ b/docs/gst/tmpl/gstplugin.sgml @@ -307,6 +307,16 @@ It will be called by the loader at statup. @Returns: + + + + + +@filename: +@error: +@Returns: + + diff --git a/docs/gst/tmpl/gsttypes.sgml b/docs/gst/tmpl/gsttypes.sgml index b78624314b..dcf6af2d83 100644 --- a/docs/gst/tmpl/gsttypes.sgml +++ b/docs/gst/tmpl/gsttypes.sgml @@ -127,58 +127,58 @@ template. -@: +@gstelement: the object which received the signal. -@: -@: -@: -@: +@gstelement: the object which received the signal. +@arg1: +@arg2: +@arg3: -@: -@: -@: +@gstelement: the object which received the signal. +@arg1: +@arg2: -@: -@: +@gstelement: the object which received the signal. +@arg1: -@: +@gstelement: the object which received the signal. -@: -@: +@gstelement: the object which received the signal. +@arg1: -@: -@: -@: +@gstelement: the object which received the signal. +@arg1: +@arg2: diff --git a/docs/pwg/building-state.xml b/docs/pwg/building-state.xml index df6d564d50..4815015ef1 100644 --- a/docs/pwg/building-state.xml +++ b/docs/pwg/building-state.xml @@ -64,6 +64,10 @@ specific data needed by the element, and it can optionally fail to go from one state to another. + + Do not g_assert for unhandled state changes; this is taken care of by + the GstElement base class. + static GstElementStateReturn gst_my_filter_change_state (GstElement *element); diff --git a/gst/elements/gstfakesrc.c b/gst/elements/gstfakesrc.c index fcb0036676..78d4dab747 100644 --- a/gst/elements/gstfakesrc.c +++ b/gst/elements/gstfakesrc.c @@ -873,7 +873,6 @@ gst_fakesrc_change_state (GstElement * element) case GST_STATE_READY_TO_NULL: break; default: - g_assert_not_reached (); break; } diff --git a/gst/gstelement.c b/gst/gstelement.c index e5f463d333..d2024848ac 100644 --- a/gst/gstelement.c +++ b/gst/gstelement.c @@ -2914,6 +2914,7 @@ gst_element_change_state (GstElement * element) old_pending = GST_STATE_PENDING (element); old_transition = GST_STATE_TRANSITION (element); + /* if the element already is in the given state, we just return success */ if (old_pending == GST_STATE_VOID_PENDING || old_state == GST_STATE_PENDING (element)) { GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element, @@ -2968,7 +2969,16 @@ gst_element_change_state (GstElement * element) element->base_time = 0; gst_element_clear_pad_caps (element); break; + case GST_STATE_NULL_TO_READY: + case GST_STATE_READY_TO_NULL: + break; default: + /* this will catch real but unhandled state changes; + * can only be caused by: + * - a new state was added + * - somehow the element was asked to jump across an intermediate state + */ + g_assert_not_reached (); break; } diff --git a/gst/gstthread.c b/gst/gstthread.c index fe7aa24d66..c4357a6cf2 100644 --- a/gst/gstthread.c +++ b/gst/gstthread.c @@ -501,14 +501,6 @@ gst_thread_change_state (GstElement * element) /* it should be dead now */ break; default: - GST_ERROR_OBJECT (element, "unhandled state change! %x", - GST_STATE_TRANSITION (element)); - g_warning ("thread %s: UNHANDLED STATE CHANGE! %x", - GST_STR_NULL (GST_OBJECT_NAME (element)), - GST_STATE_TRANSITION (element)); - /* FIXME: not doable with current threading mess: - g_assert_not_reached (); - */ break; } diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index fcb0036676..78d4dab747 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -873,7 +873,6 @@ gst_fakesrc_change_state (GstElement * element) case GST_STATE_READY_TO_NULL: break; default: - g_assert_not_reached (); break; }