From: <tho...@fr...> - 2005-10-05 22:35:31
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: thomasvs Date: Wed Oct 05 2005 15:35:26 PDT Log message: doc updates Modified files: gst : gstelement.c gstelement.h gstpad.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.c.diff?r1=1.371&r2=1.372 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstelement.h.diff?r1=1.212&r2=1.213 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstpad.c.diff?r1=1.447&r2=1.448 ====Begin Diffs==== Index: gstelement.c =================================================================== RCS file: /cvs/gstreamer/gstreamer/gst/gstelement.c,v retrieving revision 1.371 retrieving revision 1.372 diff -u -d -r1.371 -r1.372 --- gstelement.c 30 Sep 2005 08:29:02 -0000 1.371 +++ gstelement.c 5 Oct 2005 22:35:14 -0000 1.372 @@ -1701,7 +1701,7 @@ * @element: a #GstElement to abort the state of. * * Abort the state change of the element. This function is used - * by elements that do asynchronous state changes and find out + * by elements that do asynchronous state changes and find out * something is wrong. * This function should be called with the STATE_LOCK held. @@ -1845,7 +1845,6 @@ GST_TIME_TO_TIMEVAL (0, tv); ret = gst_element_get_state (element, ¤t, &pending, &tv); - /* get the element state lock */ GST_STATE_LOCK (element); /* this is the state we should go to */ GST_STATE_FINAL (element) = state; @@ -1868,7 +1867,7 @@ oclass = GST_ELEMENT_GET_CLASS (element); - /* We always perform at least one state change, even if the + /* We always perform at least one state change, even if the * current state is equal to the required state. This is needed * for bins that sync their children. */ do { Index: gstelement.h RCS file: /cvs/gstreamer/gstreamer/gst/gstelement.h,v retrieving revision 1.212 retrieving revision 1.213 diff -u -d -r1.212 -r1.213 --- gstelement.h 28 Sep 2005 13:41:27 -0000 1.212 +++ gstelement.h 5 Oct 2005 22:35:14 -0000 1.213 @@ -263,6 +263,15 @@ /* the state change mutexes and conds */ #define GST_STATE_GET_LOCK(elem) (GST_ELEMENT_CAST(elem)->state_lock) + +/** + * GST_STATE_LOCK: + * @elem: the #GstElement to take the state lock on + * + * Takes the state lock on the element. + * This function is used by the core. It is taken while getting or setting + * the state, during state changes, and while finalizing. + */ #define GST_STATE_LOCK(elem) g_mutex_lock(GST_STATE_GET_LOCK(elem)) #define GST_STATE_TRYLOCK(elem) g_mutex_trylock(GST_STATE_GET_LOCK(elem)) #define GST_STATE_UNLOCK(elem) g_mutex_unlock(GST_STATE_GET_LOCK(elem)) @@ -284,9 +293,12 @@ guint8 current_state; guint8 pending_state; guint8 final_state; - gboolean state_error; /* flag is set when the element has an error in the last state - change. it is cleared when doing another state change. */ - gboolean no_preroll; /* flag is set when the element cannot preroll */ + gboolean state_error; /* Flag is set when the element has an + * error in the last state change. + * It is cleared when doing another + * state change. */ + gboolean no_preroll; /* Flag is set when the element cannot + * preroll */ /*< public >*/ /* with LOCK */ GstBus *bus; Index: gstpad.c RCS file: /cvs/gstreamer/gstreamer/gst/gstpad.c,v retrieving revision 1.447 retrieving revision 1.448 diff -u -d -r1.447 -r1.448 --- gstpad.c 5 Oct 2005 16:16:58 -0000 1.447 +++ gstpad.c 5 Oct 2005 22:35:14 -0000 1.448 @@ -501,7 +501,8 @@ * @pad: the #GstPad to activate or deactivate. * @active: whether or not the pad should be active. - * Activates or deactivates the given pad. Must be called with the %GST_STATE_LOCK. + * Activates or deactivates the given pad. + * Must be called with the parent element's #GST_STATE_LOCK held. * Normally called from within core state change functions. * If @active, makes sure the pad is active. If it is already active, either in @@ -512,9 +513,9 @@ * gst_pad_activate_push() or gst_pad_activate_pull(), as appropriate, with a * FALSE argument. - * Returns: TRUE if the operation was successfull. + * Returns: #TRUE if the operation was successful. - * MT safe. Must be called with %GST_STATE_LOCK. + * MT safe. Must be called with parent element's #GST_STATE_LOCK held. */ gboolean gst_pad_set_active (GstPad * pad, gboolean active) |