summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-09-12 12:54:07 +0200
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>2012-09-12 13:09:27 +0200
commit536276eee1d4a6903c80be0c39c6364d6264179b (patch)
tree028e276b1ec6f533585db91ccf1338c1f28e2f33 /tests
parent35441abcde5df3dfc9aa71bbb86e8f22eabd5bfd (diff)
tests: port to the new GLib thread API
Diffstat (limited to 'tests')
-rw-r--r--tests/check/elements/audiotestsrc.c6
-rw-r--r--tests/check/elements/textoverlay.c15
-rw-r--r--tests/check/elements/videotestsrc.c6
3 files changed, 15 insertions, 12 deletions
diff --git a/tests/check/elements/audiotestsrc.c b/tests/check/elements/audiotestsrc.c
index f938175b6..499bae3bc 100644
--- a/tests/check/elements/audiotestsrc.c
+++ b/tests/check/elements/audiotestsrc.c
@@ -93,10 +93,10 @@ GST_START_TEST (test_all_waves)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
- g_mutex_lock (check_mutex);
+ g_mutex_lock (&check_mutex);
while (g_list_length (buffers) < 10)
- g_cond_wait (check_cond, check_mutex);
- g_mutex_unlock (check_mutex);
+ g_cond_wait (&check_cond, &check_mutex);
+ g_mutex_unlock (&check_mutex);
gst_element_set_state (audiotestsrc, GST_STATE_READY);
diff --git a/tests/check/elements/textoverlay.c b/tests/check/elements/textoverlay.c
index 446a9baea..fe06b4295 100644
--- a/tests/check/elements/textoverlay.c
+++ b/tests/check/elements/textoverlay.c
@@ -585,9 +585,10 @@ GST_START_TEST (test_video_waits_for_text)
* newsegment event to arrive); we spawn a background thread to send such
* a newsegment event after a second or so so we get back control */
thread =
- g_thread_create (test_video_waits_for_text_send_text_newsegment_thread,
- NULL, FALSE, NULL);
+ g_thread_try_new ("gst-check",
+ test_video_waits_for_text_send_text_newsegment_thread, NULL, NULL);
fail_unless (thread != NULL);
+ g_thread_unref (thread);
GST_LOG ("pushing video buffer 3");
fail_unless (gst_pad_push (myvideosrcpad, inbuffer) == GST_FLOW_OK);
@@ -614,9 +615,10 @@ GST_START_TEST (test_video_waits_for_text)
* text buffer (or a newsegment event) to arrive; we spawn a background
* thread to shut down the element while it's waiting to make sure that
* works ok */
- thread = g_thread_create (test_video_waits_for_text_shutdown_element,
- textoverlay, FALSE, NULL);
+ thread = g_thread_try_new ("gst-check",
+ test_video_waits_for_text_shutdown_element, textoverlay, NULL);
fail_unless (thread != NULL);
+ g_thread_unref (thread);
GST_LOG ("pushing video buffer 4");
fail_unless (gst_pad_push (myvideosrcpad, inbuffer) == GST_FLOW_FLUSHING);
@@ -681,9 +683,10 @@ GST_START_TEST (test_render_continuity)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
- thread = g_thread_create (test_render_continuity_push_video_buffers_thread,
- NULL, FALSE, NULL);
+ thread = g_thread_try_new ("gst-check",
+ test_render_continuity_push_video_buffers_thread, NULL, NULL);
fail_unless (thread != NULL);
+ g_thread_unref (thread);
caps = gst_caps_new_simple ("text/x-raw", "format", G_TYPE_STRING, "utf8",
NULL);
diff --git a/tests/check/elements/videotestsrc.c b/tests/check/elements/videotestsrc.c
index 4cfe9a760..40fd3693d 100644
--- a/tests/check/elements/videotestsrc.c
+++ b/tests/check/elements/videotestsrc.c
@@ -100,12 +100,12 @@ GST_START_TEST (test_all_patterns)
GST_STATE_PLAYING) == GST_STATE_CHANGE_SUCCESS,
"could not set to playing");
- g_mutex_lock (check_mutex);
+ g_mutex_lock (&check_mutex);
while (g_list_length (buffers) < 10) {
GST_DEBUG_OBJECT (videotestsrc, "Waiting for more buffers");
- g_cond_wait (check_cond, check_mutex);
+ g_cond_wait (&check_cond, &check_mutex);
}
- g_mutex_unlock (check_mutex);
+ g_mutex_unlock (&check_mutex);
gst_element_set_state (videotestsrc, GST_STATE_READY);