code cleanups and further deprecation fixes
[platform/upstream/gstreamer.git] / tests / threadstate / threadstate1.c
1 #include <gst/gst.h>
2
3 /* this pipeline is:
4  * { fakesrc ! fakesink }
5  */
6
7
8 int main(int argc,char *argv[])
9 {
10   GstElement *fakesrc, *fakesink;
11   GstElement *thread;
12   gint x;
13
14   gst_init(&argc,&argv);
15
16   thread = gst_thread_new("thread");
17   g_assert(thread != NULL);
18
19   fakesrc = gst_element_factory_make("fakesrc", "fake_source");
20   g_assert(fakesrc != NULL);
21
22   fakesink = gst_element_factory_make("fakesink", "fake_sink");
23   g_assert(fakesink != NULL);
24
25   gst_bin_add_many (GST_BIN(thread), fakesrc, fakesink, NULL);
26   gst_element_link (fakesrc, fakesink);
27
28   for (x = 0 ; x < 10 ; x++){
29     g_print("playing %d\n", x);
30     gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PLAYING);
31     sleep(1);
32
33     g_print("pausing %d\n", x);
34     gst_element_set_state(GST_ELEMENT(thread), GST_STATE_PAUSED);
35     sleep(1);
36   }
37
38   exit(0);
39 }
40