cleanups in code fix tests to run and complete if they can move threadb to...

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)
parent ede132c6
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
......
......@@ -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);
}
......
......@@ -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;
}
......
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
......
......@@ -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);
}
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment