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 b5fa2b10dc8b5d991ea693040cd72a75cb6c33db..34c75c978f12c7dbb14acc89825ca242731092ac 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 86d357a799958aae8db6bfc7b2fa562bdd884b76..c11b8a5af184a5a04abef853afaaa49a13183e5c 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 40caa8da6679823d36708c25af4c12b8b6e9905b..7427fc123880909eeba3b6aa4913683f9844ad2a 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 7da042eb20aeb421902dfcda206f77d86c8731c9..13d78ea0249636307150701d7fb273f130c628a2 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>