Update theme submodule
[platform/upstream/gstreamer.git] / tutorials / basic-tutorial-1.c
1 #include <gst/gst.h>\r
2   \r
3 int main(int argc, char *argv[]) {\r
4   GstElement *pipeline;\r
5   GstBus *bus;\r
6   GstMessage *msg;\r
7   \r
8   /* Initialize GStreamer */\r
9   gst_init (&argc, &argv);\r
10   \r
11   /* Build the pipeline */\r
12   pipeline = gst_parse_launch ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm", NULL);\r
13   \r
14   /* Start playing */\r
15   gst_element_set_state (pipeline, GST_STATE_PLAYING);\r
16   \r
17   /* Wait until error or EOS */\r
18   bus = gst_element_get_bus (pipeline);\r
19   msg = gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE, GST_MESSAGE_ERROR | GST_MESSAGE_EOS);\r
20   \r
21   /* Free resources */\r
22   if (msg != NULL)\r
23     gst_message_unref (msg);\r
24   gst_object_unref (bus);\r
25   gst_element_set_state (pipeline, GST_STATE_NULL);\r
26   gst_object_unref (pipeline);\r
27   return 0;\r
28 }\r