summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-26 21:41:42 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-02-26 21:41:42 +0000
commit09cf021307f6f8114af6dbaa81eb0a087275967c (patch)
tree166ff6406fb86fc2596d3c5ed2255fbf9b206036 /libvo
parent89777b1f5703b37f78884644692f3e1ce09076d1 (diff)
downloadmpv-09cf021307f6f8114af6dbaa81eb0a087275967c.tar.bz2
mpv-09cf021307f6f8114af6dbaa81eb0a087275967c.tar.xz
Port yuv=... auto-detection from gl to gl2.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30753 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl2.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c
index 9d1bd533d1..1607649a5f 100644
--- a/libvo/vo_gl2.c
+++ b/libvo/vo_gl2.c
@@ -865,7 +865,7 @@ static int preinit(const char *arg)
#ifdef CONFIG_GL_WIN32
gltype = GLTYPE_W32;
#endif
- use_yuv = 0;
+ use_yuv = -1;
use_glFinish = 1;
if (subopt_parse(arg, subopts) != 0) {
mp_msg(MSGT_VO, MSGL_FATAL,
@@ -884,8 +884,25 @@ static int preinit(const char *arg)
"\n" );
return -1;
}
- if(!init_mpglcontext(&glctx, gltype)) return -1;
+ if(!init_mpglcontext(&glctx, gltype)) goto err_out;
+ if (use_yuv == -1) {
+ const char *extensions;
+#ifdef CONFIG_GL_WIN32
+ if (config_w32(320, 200, 320, 200, VOFLAG_HIDDEN, "", 0) == -1)
+#else
+ if (config_glx(320, 200, 320, 200, VOFLAG_HIDDEN, "", 0) == -1)
+#endif
+ goto err_out;
+ if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
+ goto err_out;
+ extensions = GetString(GL_EXTENSIONS);
+ use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0;
+ }
return 0;
+
+err_out:
+ uninit();
+ return -1;
}
static int control(uint32_t request, void *data, ...)