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