From: Michael Smith Date: Fri, 2 Jun 2006 16:41:02 +0000 (+0000) Subject: libs/gst/check/gstcheck.*: Add a cond/mutex to the check support lib, signal this... X-Git-Tag: RELEASE-0_10_7~23 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c4b93a932101cb05c27aa430e94868fc2ebcebed;p=platform%2Fupstream%2Fgstreamer.git libs/gst/check/gstcheck.*: Add a cond/mutex to the check support lib, signal this whenever we add to the buffers list... Original commit message from CVS: * libs/gst/check/gstcheck.c: (gst_check_init), (gst_check_chain_func): * libs/gst/check/gstcheck.h: Add a cond/mutex to the check support lib, signal this whenever we add to the buffers list. This will allow tests to not busy-wait on the buffer-list. --- diff --git a/ChangeLog b/ChangeLog index 721f649..346437d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2006-06-02 Michael Smith + + * libs/gst/check/gstcheck.c: (gst_check_init), + (gst_check_chain_func): + * libs/gst/check/gstcheck.h: + Add a cond/mutex to the check support lib, signal this whenever we + add to the buffers list. This will allow tests to not busy-wait on + the buffer-list. + 2006-06-02 Thomas Vander Stichele * libs/gst/dataprotocol/dataprotocol.c: diff --git a/libs/gst/check/gstcheck.c b/libs/gst/check/gstcheck.c index 5bf728d..0d39567 100644 --- a/libs/gst/check/gstcheck.c +++ b/libs/gst/check/gstcheck.c @@ -95,6 +95,9 @@ gst_check_init (int *argc, char **argv[]) gst_check_log_critical_func, NULL); g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING, gst_check_log_critical_func, NULL); + + check_cond = g_cond_new (); + check_mutex = g_mutex_new (); } /* message checking */ @@ -120,6 +123,10 @@ gst_check_chain_func (GstPad * pad, GstBuffer * buffer) GST_DEBUG ("chain_func: received buffer %p", buffer); buffers = g_list_append (buffers, buffer); + g_mutex_lock (check_mutex); + g_cond_signal (check_cond); + g_mutex_unlock (check_mutex); + return GST_FLOW_OK; } diff --git a/libs/gst/check/gstcheck.h b/libs/gst/check/gstcheck.h index 749ccc8..75dbae3 100644 --- a/libs/gst/check/gstcheck.h +++ b/libs/gst/check/gstcheck.h @@ -47,6 +47,9 @@ extern gboolean _gst_check_expecting_log; /* global variables used in test methods */ GList * buffers; +GMutex *check_mutex; +GCond *check_cond; + void gst_check_init (int *argc, char **argv[]); GstFlowReturn gst_check_chain_func (GstPad *pad, GstBuffer *buffer);