diff options
author | Thomas Vander Stichele <thomas@apestaart.org> | 2002-11-13 17:06:23 +0000 |
---|---|---|
committer | Thomas Vander Stichele <thomas@apestaart.org> | 2002-11-13 17:06:23 +0000 |
commit | 9d804f0b00128ef859823bc76ed7c6f82de25b4e (patch) | |
tree | 7fcb0f19263a5b1e5dd3a8afb49132505e3f863d /testsuite | |
parent | ede132c69c45b419f78ef507c4837e1abbe5682c (diff) | |
download | gstreamer-9d804f0b00128ef859823bc76ed7c6f82de25b4e.tar.gz |
cleanups in code fix tests to run and complete if they can move threadb to failing tests since it doesn't work with b...
Original commit message from CVS:
cleanups in code
fix tests to run and complete if they can
move threadb to failing tests since it doesn't work with basicomega
(crashes in the mmap)
Diffstat (limited to 'testsuite')
-rw-r--r-- | testsuite/threads/Makefile.am | 7 | ||||
-rw-r--r-- | testsuite/threads/thread.c | 12 | ||||
-rw-r--r-- | testsuite/threads/threadb.c | 14 |
3 files changed, 24 insertions, 9 deletions
diff --git a/testsuite/threads/Makefile.am b/testsuite/threads/Makefile.am index e261146ed4..6340f06397 100644 --- a/testsuite/threads/Makefile.am +++ b/testsuite/threads/Makefile.am @@ -1,11 +1,14 @@ -testprogs = thread1 thread2 thread3 thread4 thread5 threadb +testprogs = thread1 thread2 thread3 thread4 thread5 +testsfailing = threadb TESTS = $(testprogs) check_PROGRAMS = $(testprogs) +noinst_PROGRAMS = $(testsfailing) + LDADD = $(GST_LIBS) -AM_CFLAGS = $(GST_CFLAGS) +CFLAGS = $(GST_CFLAGS) thread1_SOURCES = thread.c thread1_CFLAGS = -DTESTNUM=1 diff --git a/testsuite/threads/thread.c b/testsuite/threads/thread.c index 5b9adcc707..b824c50f54 100644 --- a/testsuite/threads/thread.c +++ b/testsuite/threads/thread.c @@ -24,7 +24,7 @@ construct_pipeline (GstElement *pipeline) GstElement *src, *sink, *queue, *identity, *thread; src = gst_element_factory_make ("fakesrc", NULL); - sink = gst_element_factory_make ("fakesink", NULL); + sink = gst_element_factory_make ("fakesink", "sink"); identity = gst_element_factory_make ("identity", NULL); queue = gst_element_factory_make ("queue", NULL); thread = gst_element_factory_make ("thread", NULL); @@ -90,7 +90,7 @@ main (gint argc, gchar *argv[]) } if (TESTNUM == 3) { gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("running2 ...\n"); + g_print ("running ...\n"); while (gst_bin_iterate (GST_BIN (pipeline))); gst_element_set_state (pipeline, GST_STATE_NULL); } @@ -98,7 +98,7 @@ main (gint argc, gchar *argv[]) gint run; gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("running3 ...\n"); + g_print ("running ...\n"); for (run = 0; run < 3; run++) { gst_bin_iterate (GST_BIN (pipeline)); } @@ -108,10 +108,12 @@ main (gint argc, gchar *argv[]) GstElement *sink; sink = gst_bin_get_by_name (GST_BIN (pipeline), "sink"); + g_assert (sink); - g_signal_connect (G_OBJECT (sink), "handoff", G_CALLBACK (change_state), pipeline); + g_signal_connect (G_OBJECT (sink), "handoff", + G_CALLBACK (change_state), pipeline); gst_element_set_state (pipeline, GST_STATE_PLAYING); - g_print ("running3 ...\n"); + g_print ("running ...\n"); while (gst_bin_iterate (GST_BIN (pipeline))); gst_element_set_state (pipeline, GST_STATE_NULL); } diff --git a/testsuite/threads/threadb.c b/testsuite/threads/threadb.c index 9021f6af05..6eced59f86 100644 --- a/testsuite/threads/threadb.c +++ b/testsuite/threads/threadb.c @@ -28,7 +28,15 @@ construct_pipeline (GstElement *pipeline) void state_changed (GstElement *el, gint arg1, gint arg2, gpointer user_data) { - g_print ("element %s has changed state\n", GST_ELEMENT_NAME (el)); + static gboolean running = FALSE; + GstElementState state = gst_element_get_state (el); + + g_print ("element %s has changed state to %s\n", + GST_ELEMENT_NAME (el), + gst_element_state_get_name (state)); + if (state == GST_STATE_PLAYING) running = TRUE; + /* if we move from PLAYING to PAUSED, we're done */ + if (state == GST_STATE_PAUSED && running) gst_main_quit (); } int @@ -42,7 +50,8 @@ main (gint argc, gchar *argv[]) g_assert (thread); /* connect state change signal */ - g_signal_connect (G_OBJECT (thread), "state_change", state_changed, NULL); + g_signal_connect (G_OBJECT (thread), "state_change", + G_CALLBACK (state_changed), NULL); construct_pipeline (thread); g_print ("Setting thread to play\n"); @@ -50,6 +59,7 @@ main (gint argc, gchar *argv[]) g_print ("Going into the main GStreamer loop\n"); gst_main (); + g_print ("Coming out of the main GStreamer loop\n"); return 0; } |