gst/: Pending ABI changes.

Original commit message from CVS:
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_class_init),
(gst_element_set_state), (gst_element_set_state_func):
* gst/gstelement.h:
Pending ABI changes.
GThreadPool in GstBinClass to monitor async state changes.
state_cookie in GstElement to detect concurrent gst/set state.
set_state is now virtual too in case a very complicated element
has to be constructed.
This commit is contained in:
Wim Taymans 2005-10-18 14:29:21 +00:00
parent 20aff65b34
commit 74c74e189e
4 changed files with 39 additions and 3 deletions

View file

@ -1,3 +1,15 @@
2005-10-18 Wim Taymans <wim@fluendo.com>
* gst/gstbin.h:
* gst/gstelement.c: (gst_element_class_init),
(gst_element_set_state), (gst_element_set_state_func):
* gst/gstelement.h:
Pending ABI changes.
GThreadPool in GstBinClass to monitor async state changes.
state_cookie in GstElement to detect concurrent gst/set state.
set_state is now virtual too in case a very complicated element
has to be constructed.
2005-10-18 Wim Taymans <wim@fluendo.com>
* check/gst/gstbin.c: (GST_START_TEST):

View file

@ -104,6 +104,8 @@ struct _GstBinClass {
GstElementClass parent_class;
/*< private >*/
GThreadPool *pool;
/* signals */
void (*element_added) (GstBin *bin, GstElement *child);
void (*element_removed) (GstBin *bin, GstElement *child);

View file

@ -119,10 +119,10 @@ static GstStateChangeReturn gst_element_change_state (GstElement * element,
GstStateChange transition);
static GstStateChangeReturn gst_element_change_state_func (GstElement * element,
GstStateChange transition);
static GstStateChangeReturn gst_element_change_state_func (GstElement * element,
GstStateChange transition);
static GstStateChangeReturn gst_element_get_state_func (GstElement * element,
GstState * state, GstState * pending, GstClockTime timeout);
static GstStateChangeReturn gst_element_set_state_func (GstElement * element,
GstState state);
static void gst_element_set_bus_func (GstElement * element, GstBus * bus);
#ifndef GST_DISABLE_LOADSAVE
@ -213,6 +213,7 @@ gst_element_class_init (GstElementClass * klass)
#endif
klass->change_state = GST_DEBUG_FUNCPTR (gst_element_change_state_func);
klass->set_state = GST_DEBUG_FUNCPTR (gst_element_set_state_func);
klass->get_state = GST_DEBUG_FUNCPTR (gst_element_get_state_func);
klass->set_bus = GST_DEBUG_FUNCPTR (gst_element_set_bus_func);
klass->numpadtemplates = 0;
@ -1929,6 +1930,26 @@ gst_element_lost_state (GstElement * element)
*/
GstStateChangeReturn
gst_element_set_state (GstElement * element, GstState state)
{
GstElementClass *oclass;
GstStateChangeReturn result = GST_STATE_CHANGE_FAILURE;
g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_CHANGE_FAILURE);
oclass = GST_ELEMENT_GET_CLASS (element);
if (oclass->set_state)
result = (oclass->set_state) (element, state);
return result;
}
/**
* default set state function, calculates the next state based
* on current state and calls the change_state function
*/
static GstStateChangeReturn
gst_element_set_state_func (GstElement * element, GstState state)
{
GstState current, next, old_pending;
GstStateChangeReturn ret;
@ -2017,7 +2038,6 @@ was_busy:
return GST_STATE_CHANGE_ASYNC;
}
}
/* with STATE_LOCK */

View file

@ -296,6 +296,7 @@ struct _GstElement
/* element state */
GStaticRecMutex *state_lock;
GCond *state_cond;
guint32 state_cookie;
GstState current_state;
GstState next_state;
GstState pending_state;
@ -355,6 +356,7 @@ struct _GstElementClass
/* state changes */
GstStateChangeReturn (*get_state) (GstElement * element, GstState * state,
GstState * pending, GstClockTime timeout);
GstStateChangeReturn (*set_state) (GstElement *element, GstState state);
GstStateChangeReturn (*change_state) (GstElement *element, GstStateChange transition);
/* bus */