gl: fix the use of always-defined macros
authorРуслан Ижбулатов <lrn1986@gmail.com>
Tue, 18 Mar 2014 00:08:50 +0000 (00:08 +0000)
committerjulien isorce <patch@MacBook-Air-de-julien-isorce.local>
Tue, 18 Mar 2014 06:17:03 +0000 (06:17 +0000)
After 2a0f0399ae226089c2ba07b1b904741b856f37af GST_GL_* macros are always
defined to 0 or 1. Don't use #ifdef ... or #if defined() on them.

https://bugzilla.gnome.org/show_bug.cgi?id=726591

gst-libs/gst/gl/egl/gstglcontext_egl.c
gst-libs/gst/gl/glprototypes/gstgl_compat.h
tests/examples/gtk/gstgtk.c

index a7b8e09..c7283ed 100644 (file)
@@ -173,7 +173,7 @@ gst_gl_context_egl_choose_config (GstGLContextEGL * egl,
     config_attrib[i++] = EGL_OPENGL_ES2_BIT;
   else
     config_attrib[i++] = EGL_OPENGL_BIT;
-#if defined(USE_EGL_RPI) && defined(GST_GL_HAVE_WINDOW_WAYLAND)
+#if defined(USE_EGL_RPI) && GST_GL_HAVE_WINDOW_WAYLAND
   /* The configurations r=5 g=6 b=5 seems to be buggy whereas
    * it works when using dispmanx directly */
   config_attrib[i++] = EGL_BUFFER_SIZE;
@@ -485,7 +485,7 @@ gst_gl_context_egl_get_proc_address (GstGLContext * context, const gchar * name)
   gpointer result = NULL;
 
   /* FIXME: On Android this returns wrong addresses for non-EGL functions */
-#ifdef GST_GL_HAVE_WINDOW_ANDROID
+#if GST_GL_HAVE_WINDOW_ANDROID
   if (!(result = gst_gl_context_default_get_proc_address (context, name))) {
     if (g_str_has_prefix (name, "egl"))
       result = eglGetProcAddress (name);
index 21b9f71..5e1f8bb 100644 (file)
 #include <gst/gl/gstglconfig.h>
 
 /* undefined typedefs */
-#ifndef GST_GL_HAVE_GLEGLIMAGEOES
+#if !GST_GL_HAVE_GLEGLIMAGEOES
 typedef gpointer GLeglImageOES;
 #endif
-#ifndef GST_GL_HAVE_GLCHAR
+#if !GST_GL_HAVE_GLCHAR
 typedef gchar GLchar;
 #endif
-#ifndef GST_GL_HAVE_GLSIZEIPTR
+#if !GST_GL_HAVE_GLSIZEIPTR
 typedef ptrdiff_t GLsizeiptr;
 #endif
-#ifndef GST_GL_HAVE_GLINTPTR
+#if !GST_GL_HAVE_GLINTPTR
 typedef ptrdiff_t GLintptr;
 #endif
 
index eb62725..3d0d15a 100644 (file)
 #include <gst/gl/gl.h>
 #include "gstgtk.h"
 
-#if defined(GST_GL_HAVE_WINDOW_WIN32) && defined(GDK_WINDOWING_WIN32)
+#if GST_GL_HAVE_WINDOW_WIN32 && GDK_WINDOWING_WIN32
 #include <gdk/gdkwin32.h>
 #endif
-#if defined(GST_GL_HAVE_WINDOW_X11) && defined(GDK_WINDOWING_X11)
+#if GST_GL_HAVE_WINDOW_X11 && GDK_WINDOWING_X11
 #include <gdk/gdkx.h>
 #endif
-#if defined(GST_GL_HAVE_WINDOW_COCOA) && defined(GDK_WINDOWING_QUARTZ)
+#if GST_GL_HAVE_WINDOW_COCOA && GDK_WINDOWING_QUARTZ
 #include <gdk/gdkquartz.h>
 #endif
 
@@ -46,21 +46,21 @@ gst_video_overlay_set_gtk_window (GstVideoOverlay * videooverlay,
   window = gtk_widget_get_window (widget);
   display = gdk_window_get_display (window);
 
-#if defined(GST_GL_HAVE_WINDOW_WIN32) && defined(GDK_WINDOWING_WIN32)
+#if GST_GL_HAVE_WINDOW_WIN32 && GDK_WINDOWING_WIN32
   if (GDK_IS_WIN32_DISPLAY (display) && (!user_choice
           || g_strcmp0 (user_choice, "win32") == 0)) {
     gst_video_overlay_set_window_handle (videooverlay,
         (guintptr) GDK_WINDOW_HWND (window));
   } else
 #endif
-#if defined(GST_GL_HAVE_WINDOW_COCOA) && defined(GDK_WINDOWING_QUARTZ)
+#if GST_GL_HAVE_WINDOW_COCOA && GDK_WINDOWING_QUARTZ
   if (GDK_IS_QUARTZ_DISPLAY (display) && (!user_choice
           || g_strcmp0 (user_choice, "cocoa") == 0)) {
     gst_video_overlay_set_window_handle (videooverlay, (guintptr)
         gdk_quartz_window_get_nswindow (window));
   } else
 #endif
-#if defined(GST_GL_HAVE_WINDOW_X11) && defined(GDK_WINDOWING_X11)
+#if GST_GL_HAVE_WINDOW_X11 && GDK_WINDOWING_X11
   if (GDK_IS_X11_DISPLAY (display) && (!user_choice
           || g_strcmp0 (user_choice, "x11") == 0)) {
     gst_video_overlay_set_window_handle (videooverlay, GDK_WINDOW_XID (window));