cleaned up the examples, added Makefiles, etc
[platform/upstream/gstreamer.git] / examples / xml / runxml.c
1 #include <stdlib.h>
2 #include <gst/gst.h>
3
4 gboolean playing;
5
6 /* eos will be called when the src element has an end of stream */
7 void eos(GstElement *element, gpointer data)
8 {
9   g_print("have eos, quitting\n");
10
11   playing = FALSE;
12 }
13
14 int main(int argc,char *argv[]) 
15 {
16   GstXML *xml;
17   GstElement *bin;
18   GstElement *disk;
19
20   gst_init(&argc,&argv);
21
22   xml = gst_xml_new("xmlTest.gst", NULL);
23
24   bin = gst_xml_get_element(xml, "bin");
25   
26   gst_element_set_state(bin, GST_STATE_READY);
27   gst_element_set_state(bin, GST_STATE_PLAYING);
28
29   playing = TRUE;
30
31   while (playing) {
32     gst_bin_iterate(GST_BIN(bin));
33   }
34
35   gst_element_set_state(bin, GST_STATE_NULL);
36
37   exit(0);
38 }
39