5 * { { fakesrc } ! queue ! fakesink }
8 int main(int argc,char *argv[])
10 GstElement *fakesrc, *fakesink;
11 GstElement *thread, *thread2;
15 gst_init(&argc,&argv);
17 thread = gst_thread_new("thread");
18 g_assert(thread != NULL);
20 thread2 = gst_thread_new("thread");
21 g_assert(thread2 != NULL);
23 queue = gst_element_factory_make("queue", "the_queue");
24 g_assert(queue != NULL);
27 fakesrc = gst_element_factory_make("fakesrc", "fake_source");
28 g_assert(fakesrc != NULL);
30 fakesink = gst_element_factory_make("fakesink", "fake_sink");
31 g_assert(fakesink != NULL);
33 gst_bin_add_many (GST_BIN(thread), thread2, queue, fakesink, NULL);
35 gst_bin_add(GST_BIN(thread2), fakesrc);
36 gst_element_add_ghost_pad (thread2, gst_element_get_pad (fakesrc, "src"), "src");
37 gst_element_link_many (thread2, queue, fakesink, NULL);
39 for (x = 0 ; x < 10 ; x++){
40 g_print("playing %d\n", x);
41 gst_element_set_state(thread, GST_STATE_PLAYING);
42 g_usleep (G_USEC_PER_SEC);
44 g_print("nulling %d\n", x);
45 gst_element_set_state(thread, GST_STATE_NULL);
46 g_usleep (G_USEC_PER_SEC);