[MPlayer-cvslog] r31086 - in trunk/libvo: gl_common.c gl_common.h vo_gl.c

reimar subversion at mplayerhq.hu
Sun Apr 25 12:53:01 CEST 2010


Author: reimar
Date: Sun Apr 25 12:53:01 2010
New Revision: 31086

Log:
Support for auto-selecting the OpenGL backend.

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

Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c	Sun Apr 25 12:44:53 2010	(r31085)
+++ trunk/libvo/gl_common.c	Sun Apr 25 12:53:01 2010	(r31086)
@@ -1901,6 +1901,14 @@ static void dummy_update_xinerama_info(v
 }
 
 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;

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Sun Apr 25 12:44:53 2010	(r31085)
+++ trunk/libvo/gl_common.h	Sun Apr 25 12:53:01 2010	(r31086)
@@ -373,6 +373,7 @@ void glDisableYUVConversion(GLenum targe
 /** \} */
 
 enum MPGLType {
+  GLTYPE_AUTO,
   GLTYPE_W32,
   GLTYPE_X11,
   GLTYPE_SDL,

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Sun Apr 25 12:44:53 2010	(r31085)
+++ trunk/libvo/vo_gl.c	Sun Apr 25 12:53:01 2010	(r31086)
@@ -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;


More information about the MPlayer-cvslog mailing list