5 * { { fakesrc } ! queue ! fakesink }
9 main (int argc, char *argv[])
11 GstElement *fakesrc, *fakesink;
12 GstElement *thread, *thread2;
16 gst_init (&argc, &argv);
18 thread = gst_thread_new ("thread");
19 g_assert (thread != NULL);
21 thread2 = gst_thread_new ("thread");
22 g_assert (thread2 != NULL);
24 queue = gst_element_factory_make ("queue", "the_queue");
25 g_assert (queue != NULL);
28 fakesrc = gst_element_factory_make ("fakesrc", "fake_source");
29 g_assert (fakesrc != NULL);
31 fakesink = gst_element_factory_make ("fakesink", "fake_sink");
32 g_assert (fakesink != NULL);
34 gst_bin_add_many (GST_BIN (thread), thread2, queue, fakesink, NULL);
36 gst_bin_add (GST_BIN (thread2), fakesrc);
37 gst_element_add_ghost_pad (thread2, gst_element_get_pad (fakesrc, "src"),
39 gst_element_link_many (thread2, queue, fakesink, NULL);
41 for (x = 0; x < 10; x++) {
42 g_print ("playing %d\n", x);
43 gst_element_set_state (thread, GST_STATE_PLAYING);
44 g_usleep (G_USEC_PER_SEC);
46 g_print ("nulling %d\n", x);
47 gst_element_set_state (thread, GST_STATE_NULL);
48 g_usleep (G_USEC_PER_SEC);