examples: fix build on macOS with gtk+-quartz-3.0
authorZhao Zhili <quinkblack@foxmail.com>
Thu, 21 Jan 2021 08:01:38 +0000 (16:01 +0800)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 4 Apr 2022 16:27:45 +0000 (16:27 +0000)
gdk_quartz_window_get_nsview is not declared in the header file now:
error: implicit declaration of function 'gdk_quartz_window_get_nsview'
is invalid in C99 [-Werror,-Wimplicit-function-declaration]

fixes #979

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2095>

subprojects/gst-docs/examples/tutorials/basic-tutorial-5.c
subprojects/gst-examples/playback/player/gtk/gtk-play.c
subprojects/gst-plugins-base/tests/examples/gl/gtk/gstgtk.c
subprojects/gst-plugins-base/tests/examples/playback/playback-test.c

index b5fa2b1..34c75c9 100644 (file)
 #include <gdk/gdkwin32.h>
 #elif defined (GDK_WINDOWING_QUARTZ)
 #include <gdk/gdkquartz.h>
+#if GTK_CHECK_VERSION(3, 24, 10)
+#include <AppKit/AppKit.h>
+NSView *gdk_quartz_window_get_nsview (GdkWindow * window);
+#endif
 #endif
 
 /* Structure to contain all our information, so we can pass it around */
index 86d357a..c11b8a5 100644 (file)
 #include <gdk/gdkwin32.h>
 #elif defined (GDK_WINDOWING_QUARTZ)
 #include <gdk/gdkquartz.h>
+#if GTK_CHECK_VERSION(3, 24, 10)
+#include <AppKit/AppKit.h>
+NSView *gdk_quartz_window_get_nsview (GdkWindow * window);
+#endif
 #endif
 
 #include <gtk/gtk.h>
index 40caa8d..7427fc1 100644 (file)
 #endif
 #if GST_GL_HAVE_WINDOW_COCOA && defined(GDK_WINDOWING_QUARTZ)
 #include <gdk/gdkquartz.h>
+#if GTK_CHECK_VERSION(3, 24, 10)
+#include <AppKit/AppKit.h>
+NSView *gdk_quartz_window_get_nsview (GdkWindow * window);
+#endif
 #endif
 
 gboolean
index 7da042e..13d78ea 100644 (file)
 #include <gdk/gdkwin32.h>
 #elif defined (GDK_WINDOWING_QUARTZ)
 #include <gdk/gdkquartz.h>
+#if GTK_CHECK_VERSION(3, 24, 10)
+#include <AppKit/AppKit.h>
+NSView *gdk_quartz_window_get_nsview (GdkWindow * window);
+#endif
 #endif
 
 #include <gst/video/videooverlay.h>