Skip to content

Commit

Permalink
opengl: Silence macOS OpenGL deprecations
Browse files Browse the repository at this point in the history
As of macOS 10.14 the entire OpenGL system is deprecated. No need to
log the general warnings about it. Specific warnings are still enabled.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1123>
  • Loading branch information
dougnazar committed Apr 25, 2021
1 parent 403e002 commit b14c2e6
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gst-libs/gst/gl/cocoa/gstglcaopengllayer.m
Expand Up @@ -22,6 +22,10 @@
#include "config.h"
#endif

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#include <Cocoa/Cocoa.h>

#include "gstglcaopengllayer.h"
Expand Down
4 changes: 4 additions & 0 deletions gst-libs/gst/gl/cocoa/gstglcontext_cocoa.m
Expand Up @@ -22,6 +22,10 @@
#include "config.h"
#endif

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#include <Cocoa/Cocoa.h>

#include "gstglcontext_cocoa.h"
Expand Down
4 changes: 4 additions & 0 deletions gst-libs/gst/gl/cocoa/gstgldisplay_cocoa.m
Expand Up @@ -22,6 +22,10 @@
#include "config.h"
#endif

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#include <Cocoa/Cocoa.h>

#include <gst/gl/cocoa/gstgldisplay_cocoa.h>
Expand Down
4 changes: 4 additions & 0 deletions gst-libs/gst/gl/cocoa/gstglwindow_cocoa.m
Expand Up @@ -23,6 +23,10 @@
#include "config.h"
#endif

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#include <Cocoa/Cocoa.h>
#include <QuartzCore/QuartzCore.h>

Expand Down
3 changes: 3 additions & 0 deletions gst-libs/gst/gl/gstglfuncs.h
Expand Up @@ -55,6 +55,9 @@
/* OpenGL for desktop systems */
#if GST_GL_HAVE_OPENGL
# ifdef __APPLE__
# if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
# endif
# include <OpenGL/OpenGL.h>
# include <OpenGL/gl.h>
# if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
Expand Down
3 changes: 3 additions & 0 deletions gst-libs/gst/gl/meson.build
Expand Up @@ -351,6 +351,9 @@ if need_api_opengl != 'no' or need_platform_glx != 'no'
opengl_includes = ''
if host_system == 'darwin'
opengl_includes += '''
#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif
#include <OpenGL/OpenGL.h>
#include <OpenGL/gl.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1070
Expand Down
4 changes: 4 additions & 0 deletions tests/examples/gl/cocoa/cocoa-videooverlay.m
Expand Up @@ -18,6 +18,10 @@
* Boston, MA 02110-1301, USA.
*/

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#include <Cocoa/Cocoa.h>
#include <gst/gst.h>
#include <gst/video/videooverlay.h>
Expand Down
4 changes: 4 additions & 0 deletions tests/examples/gl/qt/qglwtextureshare/cocoa_utils.mm
Expand Up @@ -19,6 +19,10 @@
* Boston, MA 02110-1301, USA.
*/

#if !defined(MAC_OS_X_VERSION_MAX_ALLOWED) || MAC_OS_X_VERSION_MAX_ALLOWED >= 1014
# define GL_SILENCE_DEPRECATION
#endif

#import <Cocoa/Cocoa.h>
void *qt_current_nsopengl_context()
{
Expand Down

0 comments on commit b14c2e6

Please sign in to comment.