macos: Add wrapper API to run a NSApplication in the main thread
[platform/upstream/gstreamer.git] / subprojects / gst-docs / examples / tutorials / playback-tutorial-7.c
index cd5e061..58a7b82 100644 (file)
@@ -1,7 +1,11 @@
 #include <gst/gst.h>
 
+#ifdef __APPLE__
+#include <TargetConditionals.h>
+#endif
+
 int
-main (int argc, char *argv[])
+tutorial_main (int argc, char *argv[])
 {
   GstElement *pipeline, *bin, *equalizer, *convert, *sink;
   GstPad *pad, *ghost_pad;
@@ -60,3 +64,13 @@ main (int argc, char *argv[])
   gst_object_unref (pipeline);
   return 0;
 }
+
+int
+main (int argc, char *argv[])
+{
+#if defined(__APPLE__) && TARGET_OS_MAC && !TARGET_OS_IPHONE
+  return gst_macos_main (tutorial_main, argc, argv, NULL);
+#else
+  return tutorial_main (argc, argv);
+#endif
+}