4 #include <TargetConditionals.h>
8 tutorial_main (int argc, char *argv[])
14 /* Initialize GStreamer */
15 gst_init (&argc, &argv);
17 /* Build the pipeline */
20 ("playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",
24 gst_element_set_state (pipeline, GST_STATE_PLAYING);
26 /* Wait until error or EOS */
27 bus = gst_element_get_bus (pipeline);
29 gst_bus_timed_pop_filtered (bus, GST_CLOCK_TIME_NONE,
30 GST_MESSAGE_ERROR | GST_MESSAGE_EOS);
32 /* See next tutorial for proper error message handling/parsing */
33 if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
34 g_error ("An error occurred! Re-run with the GST_DEBUG=*:WARN environment "
35 "variable set for more details.");
39 gst_message_unref (msg);
40 gst_object_unref (bus);
41 gst_element_set_state (pipeline, GST_STATE_NULL);
42 gst_object_unref (pipeline);
47 main (int argc, char *argv[])
49 #if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
50 return gst_macos_main (tutorial_main, argc, argv, NULL);
52 return tutorial_main (argc, argv);