changeset 35089:a87c434ecaa3

Allow compiling -vo gl with OSX backend even if X11 and SDL are not available.
author reimar
date Thu, 13 Sep 2012 19:57:24 +0000
parents 8287c476bf53
children bfc7f38d3008
files Makefile configure libvo/gl_common.c libvo/gl_common.h libvo/vo_gl.c
diffstat 5 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Sep 13 19:41:02 2012 +0000
+++ b/Makefile	Thu Sep 13 19:57:24 2012 +0000
@@ -518,6 +518,7 @@
 SRCS_MPLAYER-$(GIF)          += libvo/vo_gif89a.c
 SRCS_MPLAYER-$(GL)           += libvo/gl_common.c libvo/vo_gl.c \
                                 libvo/csputils.c
+SRCS_MPLAYER-$(GL_OSX)       += libvo/osx_common.c libvo/osx_objc_common.m
 SRCS_MPLAYER-$(GL_SDL)       += libvo/sdl_common.c
 SRCS_MPLAYER-$(GL_WIN32)     += libvo/w32_common.c libvo/vo_gl_tiled.c
 SRCS_MPLAYER-$(GL_X11)       += libvo/x11_common.c libvo/vo_gl_tiled.c
--- a/configure	Thu Sep 13 19:41:02 2012 +0000
+++ b/configure	Thu Sep 13 19:57:24 2012 +0000
@@ -5165,7 +5165,7 @@
 # conflicts between -lGL and -framework OpenGL
 echocheck "OpenGL"
 #Note: this test is run even with --enable-gl since we autodetect linker flags
-if (test "$_x11" = yes || test "$_sdl" = yes || win32) && test "$_gl" != no ; then
+if (test "$_x11" = yes || test "$_sdl" = yes || win32 || test "$_corevideo" = yes) && test "$_gl" != no ; then
   cat > $TMPC << EOF
 #ifdef GL_WIN32
 #include <windows.h>
@@ -5240,6 +5240,10 @@
       libs_mplayer="$libs_mplayer -lGL"
     fi
   fi
+  if test "$_corevideo" = yes ; then
+    _gl=yes
+    _gl_osx=yes
+  fi
 else
   _gl=no
 fi
@@ -5262,6 +5266,10 @@
     def_gl_sdl='#define CONFIG_GL_SDL 1'
     res_comment="$res_comment sdl"
   fi
+  if test "$_gl_osx" = yes ; then
+    def_gl_osx='#define CONFIG_GL_OSX 1'
+    res_comment="$res_comment osx"
+  fi
   vomodules="opengl $vomodules"
 else
   def_gl='#undef CONFIG_GL'
@@ -5269,6 +5277,7 @@
   def_gl_x11='#undef CONFIG_GL_X11'
   def_gl_egl_x11='#undef CONFIG_GL_EGL_X11'
   def_gl_sdl='#undef CONFIG_GL_SDL'
+  def_gl_osx='#undef CONFIG_GL_OSX'
   novomodules="opengl $novomodules"
 fi
 echores "$_gl"
@@ -8174,6 +8183,7 @@
 GL_X11 = $_gl_x11
 GL_EGL_X11 = $_gl_egl_x11
 GL_SDL = $_gl_sdl
+GL_OSX = $_gl_osx
 MATRIXVIEW = $matrixview
 GUI = $_gui
 GUI_GTK = $_gui_gtk
@@ -8733,6 +8743,7 @@
 $def_gl_x11
 $def_gl_egl_x11
 $def_gl_sdl
+$def_gl_osx
 $def_matrixview
 $def_ivtv
 $def_jpeg
--- a/libvo/gl_common.c	Thu Sep 13 19:41:02 2012 +0000
+++ b/libvo/gl_common.c	Thu Sep 13 19:57:24 2012 +0000
@@ -2357,7 +2357,7 @@
     ctx->ontop = vo_x11_ontop;
     return vo_init();
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
   case GLTYPE_OSX:
 //    ctx->swapGlBuffers = swapGlBuffers_osx;
     ctx->update_xinerama_info = vo_osx_update_xinerama_info;
@@ -2389,7 +2389,7 @@
     vo_sdl_uninit();
     break;
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
   case GLTYPE_OSX:
     vo_osx_uninit();
     break;
--- a/libvo/gl_common.h	Thu Sep 13 19:41:02 2012 +0000
+++ b/libvo/gl_common.h	Thu Sep 13 19:57:24 2012 +0000
@@ -44,10 +44,12 @@
 #include <EGL/egl.h>
 #include "x11_common.h"
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
 #include "osx_common.h"
+#include <OpenGL/OpenGL.h>
+#else
+#include <GL/gl.h>
 #endif
-#include <GL/gl.h>
 
 // workaround for some gl.h headers
 #ifndef GLAPIENTRY
--- a/libvo/vo_gl.c	Thu Sep 13 19:41:02 2012 +0000
+++ b/libvo/vo_gl.c	Thu Sep 13 19:57:24 2012 +0000
@@ -631,7 +631,7 @@
   if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
     return -1;
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
   if (glctx.type == GLTYPE_OSX && !vo_osx_config(d_width, d_height, flags))
     return -1;
 #endif