# HG changeset patch # User reimar # Date 1347566244 0 # Node ID a87c434ecaa305d1b846de9edc90e94265c96ec3 # Parent 8287c476bf53e6d364e7c71e45c17ede9e7fd8a4 Allow compiling -vo gl with OSX backend even if X11 and SDL are not available. diff -r 8287c476bf53 -r a87c434ecaa3 Makefile --- 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 diff -r 8287c476bf53 -r a87c434ecaa3 configure --- 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 @@ -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 diff -r 8287c476bf53 -r a87c434ecaa3 libvo/gl_common.c --- 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; diff -r 8287c476bf53 -r a87c434ecaa3 libvo/gl_common.h --- 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 #include "x11_common.h" #endif -#ifdef CONFIG_COREVIDEO +#ifdef CONFIG_GL_OSX #include "osx_common.h" +#include +#else +#include #endif -#include // workaround for some gl.h headers #ifndef GLAPIENTRY diff -r 8287c476bf53 -r a87c434ecaa3 libvo/vo_gl.c --- 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