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.
This commit is contained in:
Michael Smith 2006-06-02 16:41:02 +00:00
parent 9c25115125
commit c4b93a9321
3 changed files with 19 additions and 0 deletions

View file

@ -1,3 +1,12 @@
2006-06-02 Michael Smith <msmith@fluendo.com>
* 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 <thomas at apestaart dot org>
* libs/gst/dataprotocol/dataprotocol.c:

View file

@ -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;
}

View file

@ -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);