[MPlayer-cvslog] r34438 - in trunk: DOCS/man/en/mplayer.1 libvo/gl_common.h libvo/vo_gl.c

reimar subversion at mplayerhq.hu
Sun Dec 11 18:52:20 CET 2011


Author: reimar
Date: Sun Dec 11 18:52:20 2011
New Revision: 34438

Log:
Add a suboption to allow forcing use of e.g. OpenGL ES to -vo gl.

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

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/en/mplayer.1

Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h	Sun Dec 11 18:51:24 2011	(r34437)
+++ trunk/libvo/gl_common.h	Sun Dec 11 18:52:20 2011	(r34438)
@@ -405,11 +405,12 @@ void glDisable3D(int type);
 /** \} */
 
 enum MPGLType {
-  GLTYPE_AUTO,
+  GLTYPE_AUTO = -1,
   GLTYPE_W32,
   GLTYPE_X11,
   GLTYPE_SDL,
   GLTYPE_EGL_X11,
+  GLTYPE_COUNT
 };
 
 typedef struct MPGLContext {

Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c	Sun Dec 11 18:51:24 2011	(r34437)
+++ trunk/libvo/vo_gl.c	Sun Dec 11 18:52:20 2011	(r34438)
@@ -151,6 +151,7 @@ static int custom_tlin;
 static int custom_trect;
 static int mipmap_gen;
 static int stereo_mode;
+static enum MPGLType backend;
 
 static int int_pause;
 static int eq_bri = 0;
@@ -1137,6 +1138,12 @@ uninit(void)
   uninit_mpglcontext(&glctx);
 }
 
+static int valid_backend(void *p)
+{
+  int *backend = p;
+  return *backend >= GLTYPE_AUTO && *backend < GLTYPE_COUNT;
+}
+
 static int valid_csp(void *p)
 {
   int *csp = p;
@@ -1176,13 +1183,14 @@ static const opt_t subopts[] = {
   {"mipmapgen",    OPT_ARG_BOOL, &mipmap_gen,   NULL},
   {"osdcolor",     OPT_ARG_INT,  &osd_color,    NULL},
   {"stereo",       OPT_ARG_INT,  &stereo_mode,  NULL},
+  {"backend",      OPT_ARG_INT,  &backend,      valid_backend},
   {NULL}
 };
 
 static int preinit_internal(const char *arg, int allow_sw)
 {
     // set defaults
-    enum MPGLType gltype = GLTYPE_AUTO;
+    backend = GLTYPE_AUTO;
     many_fmts = 1;
     use_osd = -1;
     scaled_osd = 0;
@@ -1289,10 +1297,16 @@ static int preinit_internal(const char *
               "    1: side-by-side to red-cyan stereo\n"
               "    2: side-by-side to green-magenta stereo\n"
               "    3: side-by-side to quadbuffer stereo\n"
+              "  backend=<n>\n"
+              "   -1: auto-select\n"
+              "    0: Win32/WGL\n"
+              "    1: X11/GLX\n"
+              "    2: SDL\n"
+              "    3: X11/EGL (experimental)\n"
               "\n" );
       return -1;
     }
-    if (!init_mpglcontext(&glctx, gltype))
+    if (!init_mpglcontext(&glctx, backend))
       goto err_out;
     if (use_yuv == -1 || !allow_sw) {
       if (create_window(320, 200, VOFLAG_HIDDEN, NULL) < 0)


More information about the MPlayer-cvslog mailing list