GNOME=
endif
-EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue xml-mp3
+EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
-dynamic.c gnome.c helloworld.c helloworld2.c queue.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
+dynamic.c gnome.c helloworld.c helloworld2.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml
cothread->cothreadnum);
/* we simply flag the cothread for destruction here */
- cothread->flags |= COTHREAD_DESTROYED;
+ if (cothread)
+ cothread->flags |= COTHREAD_DESTROYED;
+ else
+ g_warning ("somebody set up us the bomb");
}
static void
GNOME=
endif
-EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue xml-mp3
+EXAMPLES = dynamic $(GNOME) helloworld helloworld2 queue threads xml-mp3
noinst_PROGRAMS = $(EXAMPLES)
LDADD = $(GST_LIBS)
# also, it's a bit irritating that right now a change in any xml file
# triggers a rebuild of all examples
#%.c:
-dynamic.c gnome.c helloworld.c helloworld2.c queue.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
+dynamic.c gnome.c helloworld.c helloworld2.c queue.c threads.c xml-mp3.c: $(top_srcdir)/docs/manual/*.xml
$(srcdir)/extract.pl $@ $(top_srcdir)/docs/manual/*.xml
GstElement *bin;
GstElement *fakesink;
- fprintf (stderr, "+");
+ g_print ("+");
bin = gst_bin_new ("bin");
gst_element_set_state (pipeline, GST_STATE_NULL);
- fprintf (stderr, "-");
+ g_print ("-");
gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
}
- fprintf (stderr, "\n");
+ g_print ("\n");
g_mem_chunk_info ();
return 0;
gboolean can_quit = FALSE;
static void
-construct_pipeline (GstElement *pipeline, gint identities)
+construct_pipeline (GstElement *pipeline, gint identities)
{
GstElement *src, *sink, *identity;
GstElement *from;
}
gst_element_connect (identity, sink);
- g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL);
+ g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL);
}
void
int
main (gint argc, gchar *argv[])
{
- int runs = 130;
+ int runs = 290;
int i;
gulong id;
GstElement *thread;
g_assert (thread);
/* connect state change signal */
- id = g_signal_connect (G_OBJECT (thread), "state_change",
+ id = g_signal_connect (G_OBJECT (thread), "state_change",
G_CALLBACK (state_changed), NULL);
construct_pipeline (thread, i / 10 + 1);
g_print ("Setting thread to play with %d identities\n", i / 10 + 1);
- gst_element_set_state (thread, GST_STATE_PLAYING);
+ if (gst_element_set_state (thread, GST_STATE_PLAYING) == GST_STATE_FAILURE)
+ g_error ("Failed setting thread to play\n");
g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */
int i;
GstElement *pipeline;
- for (i = 0; i < runs; ++i)
+ for (i = 50; i < runs; ++i)
{
pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline);
GstElement *bin;
GstElement *fakesink;
- fprintf (stderr, "+");
+ g_print ("+");
bin = gst_bin_new ("bin");
gst_element_set_state (pipeline, GST_STATE_NULL);
- fprintf (stderr, "-");
+ g_print ("-");
gst_bin_remove (GST_BIN (pipeline), GST_ELEMENT (bin));
}
- fprintf (stderr, "\n");
+ g_print ("\n");
g_mem_chunk_info ();
return 0;
gboolean can_quit = FALSE;
static void
-construct_pipeline (GstElement *pipeline, gint identities)
+construct_pipeline (GstElement *pipeline, gint identities)
{
GstElement *src, *sink, *identity;
GstElement *from;
}
gst_element_connect (identity, sink);
- g_object_set (G_OBJECT (src), "num_buffers", 10, "sizetype", 3, NULL);
+ g_object_set (G_OBJECT (src), "num_buffers", 2, "sizetype", 3, NULL);
}
void
int
main (gint argc, gchar *argv[])
{
- int runs = 130;
+ int runs = 290;
int i;
gulong id;
GstElement *thread;
g_assert (thread);
/* connect state change signal */
- id = g_signal_connect (G_OBJECT (thread), "state_change",
+ id = g_signal_connect (G_OBJECT (thread), "state_change",
G_CALLBACK (state_changed), NULL);
construct_pipeline (thread, i / 10 + 1);
g_print ("Setting thread to play with %d identities\n", i / 10 + 1);
- gst_element_set_state (thread, GST_STATE_PLAYING);
+ if (gst_element_set_state (thread, GST_STATE_PLAYING) == GST_STATE_FAILURE)
+ g_error ("Failed setting thread to play\n");
g_print ("Going into the main GStreamer loop\n");
can_quit = TRUE; /* we don't want gst_main_quit called before gst_main */
int i;
GstElement *pipeline;
- for (i = 0; i < runs; ++i)
+ for (i = 50; i < runs; ++i)
{
pipeline = gst_pipeline_new ("main_pipeline");
g_assert (pipeline);