[MPlayer-cvslog] r30063 - in trunk: configure libvo/gl_common.c libvo/gl_common.h libvo/vo_gl.c libvo/vo_gl2.c
reimar
subversion at mplayerhq.hu
Sat Dec 19 11:52:32 CET 2009
Author: reimar
Date: Sat Dec 19 11:52:32 2009
New Revision: 30063
Log:
Make the check for X11 and WIN32 backends for OpenGL separate.
This fixes compilation on Windows with X11 but no GLX available.
Modified:
trunk/configure
trunk/libvo/gl_common.c
trunk/libvo/gl_common.h
trunk/libvo/vo_gl.c
trunk/libvo/vo_gl2.c
Modified: trunk/configure
==============================================================================
--- trunk/configure Fri Dec 18 21:27:35 2009 (r30062)
+++ trunk/configure Sat Dec 19 11:52:32 2009 (r30063)
@@ -4922,11 +4922,14 @@ EOF
_gl=no
if cc_check -lGL $_ld_lm ; then
_gl=yes
+ _gl_x11=yes
libs_mplayer="$libs_mplayer -lGL $_ld_dl"
elif cc_check -lGL $_ld_lm $_ld_pthread ; then
_gl=yes
+ _gl_x11=yes
libs_mplayer="$libs_mplayer -lGL $_ld_pthread $_ld_dl"
- elif cc_check -DGL_WIN32 -lopengl32 ; then
+ fi
+ if cc_check -DGL_WIN32 -lopengl32 ; then
_gl=yes
_gl_win32=yes
libs_mplayer="$libs_mplayer -lopengl32 -lgdi32"
@@ -4936,14 +4939,20 @@ else
fi
if test "$_gl" = yes ; then
def_gl='#define CONFIG_GL 1'
+ _res_comment="backends:"
if test "$_gl_win32" = yes ; then
def_gl_win32='#define GL_WIN32 1'
- _res_comment="win32 version"
+ _res_comment="$_res_comment win32"
+ fi
+ if test "$_gl_x11" = yes ; then
+ def_gl_x11='#define GL_X11 1'
+ _res_comment="$_res_comment x11"
fi
_vomodules="opengl $_vomodules"
else
def_gl='#undef CONFIG_GL'
def_gl_win32='#undef GL_WIN32'
+ def_gl_x11='#undef GL_X11'
_novomodules="opengl $_novomodules"
fi
echores "$_gl"
@@ -8280,6 +8289,7 @@ GIF = $_gif
GGI = $_ggi
GL = $_gl
GL_WIN32 = $_gl_win32
+GL_X11 = $_gl_x11
GUI = $_gui
GUI_GTK = $_gui_gtk
GUI_WIN32 = $_gui_win32
@@ -8802,6 +8812,7 @@ $def_gif_4
$def_gif_tvt_hack
$def_gl
$def_gl_win32
+$def_gl_x11
$def_ivtv
$def_jpeg
$def_kva
Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c Fri Dec 18 21:27:35 2009 (r30062)
+++ trunk/libvo/gl_common.c Sat Dec 19 11:52:32 2009 (r30063)
@@ -1634,7 +1634,7 @@ static void swapGlBuffers_w32(MPGLContex
vo_w32_release_dc(vo_w32_window, vo_hdc);
}
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
#ifdef HAVE_LIBDL
#include <dlfcn.h>
#endif
@@ -1819,7 +1819,7 @@ int init_mpglcontext(MPGLContext *ctx, e
ctx->ontop = vo_w32_ontop;
return vo_w32_init();
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
case GLTYPE_X11:
ctx->setGlWindow = setGlWindow_x11;
ctx->releaseGlContext = releaseGlContext_x11;
@@ -1844,7 +1844,7 @@ void uninit_mpglcontext(MPGLContext *ctx
vo_w32_uninit();
break;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
case GLTYPE_X11:
vo_x11_uninit();
break;
Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h Fri Dec 18 21:27:35 2009 (r30062)
+++ trunk/libvo/gl_common.h Sat Dec 19 11:52:32 2009 (r30063)
@@ -32,7 +32,7 @@
#include <GL/gl.h>
#include "w32_common.h"
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
#include <GL/gl.h>
#include <X11/Xlib.h>
#include <GL/glx.h>
@@ -362,7 +362,7 @@ typedef struct MPGLContext {
enum MPGLType type;
union {
int w32;
-#ifdef CONFIG_X11
+#ifdef GL_X11
XVisualInfo *x11;
#endif
} vinfo;
@@ -370,7 +370,7 @@ typedef struct MPGLContext {
#ifdef GL_WIN32
HGLRC w32;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
GLXContext x11;
#endif
} context;
Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c Fri Dec 18 21:27:35 2009 (r30062)
+++ trunk/libvo/vo_gl.c Sat Dec 19 11:52:32 2009 (r30063)
@@ -48,7 +48,7 @@ static const vo_info_t info =
const LIBVO_EXTERN(gl)
-#ifdef CONFIG_X11
+#ifdef GL_X11
static int wsGLXAttrib[] = { GLX_RGBA,
GLX_RED_SIZE,1,
GLX_GREEN_SIZE,1,
@@ -428,7 +428,7 @@ static void uninitGl(void) {
DeleteBuffers(2, gl_buffer_uv);
gl_buffer_uv[0] = gl_buffer_uv[1] = 0; gl_buffersize_uv = 0;
gl_bufferptr_uv[0] = gl_bufferptr_uv[1] = 0;
-#ifdef CONFIG_X11
+#ifdef GL_X11
if (mesa_bufferptr)
FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
#endif
@@ -545,7 +545,7 @@ config(uint32_t width, uint32_t height,
if (glctx.type == GLTYPE_W32 && !vo_w32_config(d_width, d_height, flags))
return -1;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
if (glctx.type == GLTYPE_X11) {
XVisualInfo *vinfo=glXChooseVisual( mDisplay,mScreen,wsGLXAttrib );
if (vinfo == NULL)
@@ -774,7 +774,7 @@ static uint32_t get_image(mp_image_t *mp
mpi->stride[0] = mpi->width * mpi->bpp / 8;
needed_size = mpi->stride[0] * mpi->height;
if (mesa_buffer) {
-#ifdef CONFIG_X11
+#ifdef GL_X11
if (mesa_bufferptr && needed_size > mesa_buffersize) {
FreeMemoryMESA(mDisplay, mScreen, mesa_bufferptr);
mesa_bufferptr = NULL;
Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c Fri Dec 18 21:27:35 2009 (r30062)
+++ trunk/libvo/vo_gl2.c Sat Dec 19 11:52:32 2009 (r30063)
@@ -125,7 +125,7 @@ static GLint getInternalFormat(void)
}
break;
#endif
-#ifdef CONFIG_X11
+#ifdef GL_X11
case GLTYPE_X11:
if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_RED_SIZE, &r_sz) != 0) r_sz = 0;
if (glXGetConfig(mDisplay, glctx.vinfo.x11, GLX_GREEN_SIZE, &g_sz) != 0) g_sz = 0;
More information about the MPlayer-cvslog
mailing list