[MPlayer-cvslog] r35183 - in trunk: Makefile configure libvo/gl_common.c libvo/gl_common.h libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Thu Sep 13 21:57:24 CEST 2012


Author: reimar
Date: Thu Sep 13 21:57:24 2012
New Revision: 35183

Log:
Allow compiling -vo gl with OSX backend even if X11 and SDL are not available.

Modified:
   trunk/Makefile
   trunk/configure
   trunk/libvo/gl_common.c
   trunk/libvo/gl_common.h
   trunk/libvo/vo_gl.c

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Thu Sep 13 21:41:02 2012	(r35182)
+++ trunk/Makefile	Thu Sep 13 21:57:24 2012	(r35183)
@@ -518,6 +518,7 @@ SRCS_MPLAYER-$(GGI)          += libvo/vo
 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

Modified: trunk/configure
==============================================================================
--- trunk/configure	Thu Sep 13 21:41:02 2012	(r35182)
+++ trunk/configure	Thu Sep 13 21:57:24 2012	(r35183)
@@ -5165,7 +5165,7 @@ echores "$_sdl"
 # 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 @@ EOF
       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 @@ if test "$_gl" = yes ; then
     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 @@ else
   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_WIN32 = $_gl_win32
 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_win32
 $def_gl_x11
 $def_gl_egl_x11
 $def_gl_sdl
+$def_gl_osx
 $def_matrixview
 $def_ivtv
 $def_jpeg

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Thu Sep 13 21:41:02 2012	(r35182)
+++ trunk/libvo/gl_common.c	Thu Sep 13 21:57:24 2012	(r35183)
@@ -2357,7 +2357,7 @@ int init_mpglcontext(MPGLContext *ctx, e
     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 @@ void uninit_mpglcontext(MPGLContext *ctx
     vo_sdl_uninit();
     break;
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
   case GLTYPE_OSX:
     vo_osx_uninit();
     break;

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Thu Sep 13 21:41:02 2012	(r35182)
+++ trunk/libvo/gl_common.h	Thu Sep 13 21:57:24 2012	(r35183)
@@ -44,10 +44,12 @@
 #include <EGL/egl.h>
 #include "x11_common.h"
 #endif
-#ifdef CONFIG_COREVIDEO
+#ifdef CONFIG_GL_OSX
 #include "osx_common.h"
-#endif
+#include <OpenGL/OpenGL.h>
+#else
 #include <GL/gl.h>
+#endif
 
 // workaround for some gl.h headers
 #ifndef GLAPIENTRY

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Thu Sep 13 21:41:02 2012	(r35182)
+++ trunk/libvo/vo_gl.c	Thu Sep 13 21:57:24 2012	(r35183)
@@ -631,7 +631,7 @@ static int create_window(uint32_t d_widt
   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


More information about the MPlayer-cvslog mailing list