diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-25 10:53:01 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2010-04-25 10:53:01 +0000 |
commit | a9ff7793e3491b5e78f4baed207b31eeeed61896 (patch) | |
tree | 7fb4acfb097515adcfc09b2b1798b53404fcea91 /libvo | |
parent | 3a34dbc927a4980606abb4331e7ba8ca6fc1a90d (diff) | |
download | mpv-a9ff7793e3491b5e78f4baed207b31eeeed61896.tar.bz2 mpv-a9ff7793e3491b5e78f4baed207b31eeeed61896.tar.xz |
Support for auto-selecting the OpenGL backend.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31086 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/gl_common.c | 8 | ||||
-rw-r--r-- | libvo/gl_common.h | 1 | ||||
-rw-r--r-- | libvo/vo_gl.c | 8 |
3 files changed, 10 insertions, 7 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index c8e3884f87..2e2b04c920 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -1901,6 +1901,14 @@ static void dummy_update_xinerama_info(void) { } int init_mpglcontext(MPGLContext *ctx, enum MPGLType type) { + if (type == GLTYPE_AUTO) { + int res = init_mpglcontext(ctx, GLTYPE_W32); + if (res) return res; + res = init_mpglcontext(ctx, GLTYPE_X11); + if (res) return res; + res = init_mpglcontext(ctx, GLTYPE_SDL); + return res; + } memset(ctx, 0, sizeof(*ctx)); ctx->setGlWindow = setGlWindow_dummy; ctx->releaseGlContext = releaseGlContext_dummy; diff --git a/libvo/gl_common.h b/libvo/gl_common.h index f40cadda89..d09f3492fb 100644 --- a/libvo/gl_common.h +++ b/libvo/gl_common.h @@ -373,6 +373,7 @@ void glDisableYUVConversion(GLenum target, int type); /** \} */ enum MPGLType { + GLTYPE_AUTO, GLTYPE_W32, GLTYPE_X11, GLTYPE_SDL, diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index 3730059ffa..c44e21a3e8 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -1099,14 +1099,8 @@ static const opt_t subopts[] = { static int preinit_internal(const char *arg, int allow_sw) { - enum MPGLType gltype = GLTYPE_SDL; // set defaults -#ifdef CONFIG_GL_X11 - gltype = GLTYPE_X11; -#endif -#ifdef CONFIG_GL_WIN32 - gltype = GLTYPE_W32; -#endif + enum MPGLType gltype = GLTYPE_AUTO; many_fmts = 1; use_osd = -1; scaled_osd = 0; |