2005-11-19 Andy Wingo <wingo@pobox.com>
+ * gst/gstutils.h:
+ * gst/gstutils.c (g_static_rec_cond_wait)
+ (g_static_rec_cond_timed_wait): Removed, no longer needed.
+
+ * gst/gstbin.c: Remove terrible continue_state prototype.
+
+ * gst/gstelement.h (gst_element_continue_state): Make public.
+
+ * gst/gstelement.h:
+ * gst/gstelement.c (gst_element_commit_state): Removed, replaced
+ by continue_state. Fixes #319389.
+
* gst/gstindex.h (GstIndexFilter): Actually pass on the user_data.
Really fixes #168438. However I don't see anywhere where the
filter function is called... stupid GStreamer...
}
/**
- * gst_element_commit_state:
- * @element: a #GstElement to commit the state of.
- *
- * Commit the state change of the element. This function is used
- * by elements that do asynchronous state changes.
- * The core will normally call this method automatically when an
- * element returned SUCCESS from the state change function.
- * Elements that return ASYNC from the change_state function should
- * eventually call this method from the streaming thread to signal
- * successfull state change completion.
- *
- * If after calling this method the element still has not reached
- * the pending state, the next state change is performed.
- *
- * This function can only be called with the STATE_LOCK held.
- *
- * Returns: The result of the commit state change.
- *
- * MT safe.
- */
-GstStateChangeReturn
-gst_element_commit_state (GstElement * element)
-{
- g_return_val_if_fail (GST_IS_ELEMENT (element), GST_STATE_CHANGE_FAILURE);
-
- return gst_element_continue_state (element, GST_STATE_CHANGE_SUCCESS);
-}
-
-/**
* gst_element_lost_state:
* @element: a #GstElement the state is lost of
*
g_free (name);
}
-#ifdef GST_COMPILE_STATIC_REC_COND_WAIT
-
-#if GLIB_SIZEOF_SYSTEM_THREAD == SIZEOF_VOID_P
-# define g_system_thread_equal_simple(thread1, thread2) \
- ((thread1).dummy_pointer == (thread2).dummy_pointer)
-# define g_system_thread_assign(dest, src) \
- ((dest).dummy_pointer = (src).dummy_pointer)
-#else /* GLIB_SIZEOF_SYSTEM_THREAD != SIZEOF_VOID_P */
-# define g_system_thread_equal_simple(thread1, thread2) \
- (memcmp (&(thread1), &(thread2), GLIB_SIZEOF_SYSTEM_THREAD) == 0)
-# define g_system_thread_assign(dest, src) \
- (memcpy (&(dest), &(src), GLIB_SIZEOF_SYSTEM_THREAD))
-#endif /* GLIB_SIZEOF_SYSTEM_THREAD == SIZEOF_VOID_P */
-
-#define g_system_thread_equal(thread1, thread2) \
- (g_thread_functions_for_glib_use.thread_equal ? \
- g_thread_functions_for_glib_use.thread_equal (&(thread1), &(thread2)) :\
- g_system_thread_equal_simple((thread1), (thread2)))
-
-static GSystemThread zero_thread;
-
-/**
- * g_static_rec_cond_timed_wait:
- * @cond: the GCond to wait for
- * @mutex: a currently locked mutex
- * @end_time: timeout value.
- *
- * Waits until this thread is woken up on cond, but not longer than until the
- * time, that is specified by abs_time. The mutex is fully unlocked before falling
- * asleep and fully locked again before resuming.
- *
- * If abs_time is NULL, g_static_rec_cond_timed_wait() acts like g_static_rec_cond_wait().
- *
- * This function can also be used, if g_thread_init() has not yet been called and will
- * immediately return TRUE then.
- *
- * To easily calculate abs_time a combination of g_get_current_time() and g_time_val_add()
- * can be used.
- *
- * Returns: TRUE, if the thread is woken up in time.
- */
-gboolean
-g_static_rec_cond_timed_wait (GCond * cond,
- GStaticRecMutex * mutex, GTimeVal * end_time)
-{
- GMutex *smutex;
- guint depth;
- GSystemThread self;
- gboolean res;
-
- if (!g_thread_supported ())
- return FALSE;
-
- G_THREAD_UF (thread_self, (&self));
-
- g_return_val_if_fail (g_system_thread_equal (self, mutex->owner), FALSE);
-
- depth = mutex->depth;
-
- g_system_thread_assign (mutex->owner, zero_thread);
- mutex->depth = 0;
- smutex = g_static_mutex_get_mutex (&mutex->mutex);
-
- res = g_cond_timed_wait (cond, smutex, end_time);
-
- g_system_thread_assign (mutex->owner, self);
- mutex->depth = depth;
-
- return res;
-}
-
-/**
- * g_static_rec_cond_wait:
- * @cond: the GCond to wait for
- * @mutex: a currently locked mutex
- *
- * Waits until this thread is woken up on cond.
- * The mutex is fully unlocked before falling
- * asleep and fully locked again before resuming.
- *
- * This function can also be used, if g_thread_init() has not yet been called and will
- * immediately return then.
- */
-void
-g_static_rec_cond_wait (GCond * cond, GStaticRecMutex * mutex)
-{
- g_static_rec_cond_timed_wait (cond, mutex, NULL);
-}
-
-#endif /* GST_COMPILE_STATIC_REC_COND_WAIT */
-
/**
* gst_bin_add_many:
* @bin: a #GstBin
void gst_object_default_error (GstObject * source,
GError * error, gchar * debug);
-/* rec mutex */
-#ifndef g_static_rec_cond_wait
-#define GST_COMPILE_STATIC_REC_COND_WAIT
-void g_static_rec_cond_wait (GCond *cond,
- GStaticRecMutex *mutex);
-gboolean g_static_rec_cond_timed_wait (GCond *cond,
- GStaticRecMutex *mutex,
- GTimeVal *end_time);
-#endif
-
/* element functions */
void gst_element_create_all_pads (GstElement *element);
GstPad* gst_element_get_compatible_pad (GstElement *element, GstPad *pad,