From b8a7ed8a79ed6d9c911bc2be082f86bf2d92c48d Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 16:56:30 +0000 Subject: Factor out the YUV->RGB conversion auto-selection and also enable auto-selection of ATI fragment shaders since they should do accurate conversions now. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31006 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 9385a158b3..e59ec25e47 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -886,7 +886,6 @@ static int preinit(const char *arg) } 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 @@ -895,8 +894,7 @@ static int preinit(const char *arg) goto err_out; if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED) goto err_out; - extensions = mpglGetString(GL_EXTENSIONS); - use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0; + use_yuv = glAutodetectYUVConversion(); } return 0; -- cgit v1.2.3 From 475a831ac88b5e0661608e32522d28781308d1be Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 19:38:47 +0000 Subject: Fix width/height mixup in error message. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31009 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index e59ec25e47..5485df474d 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -201,7 +201,7 @@ static int initTextures(void) if (format != gl_internal_format) { mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", - texture_height, texture_width); + texture_width, texture_height); if (texture_width > texture_height) texture_width /= 2; -- cgit v1.2.3 From 5e8cfc72305795289152b5bb823abd049e728323 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 19:39:54 +0000 Subject: Print width before height, git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31010 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 5485df474d..8c3ee644bc 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -208,7 +208,7 @@ static int initTextures(void) else texture_height /= 2; - mp_msg (MSGT_VO, MSGL_V, "[%dx%d] !\n", texture_height, texture_width); + mp_msg (MSGT_VO, MSGL_V, "[%dx%d] !\n", texture_width, texture_height); if(texture_width < 64 || texture_height < 64) { mp_msg (MSGT_VO, MSGL_FATAL, "[gl2] Give up .. usable texture size not avaiable, or texture config error !\n"); -- cgit v1.2.3 From 1a42a53fd206b0b7d305d8f7d626aba1921403b8 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 19:42:52 +0000 Subject: Avoid duplicating a condition. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31011 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 8c3ee644bc..e1a71c0ce8 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -198,8 +198,9 @@ static int initTextures(void) glGetTexLevelParameteriv (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); - if (format != gl_internal_format) - { + if (format == gl_internal_format) + break; + mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", texture_width, texture_height); @@ -214,9 +215,8 @@ static int initTextures(void) mp_msg (MSGT_VO, MSGL_FATAL, "[gl2] Give up .. usable texture size not avaiable, or texture config error !\n"); return -1; } - } } - while (format != gl_internal_format && texture_width > 1 && texture_height > 1); + while (texture_width > 1 && texture_height > 1); #ifdef TEXTURE_WIDTH texture_width = TEXTURE_WIDTH; #endif -- cgit v1.2.3 From 3107620451ec44231137bd0ee75e9dc17d1f54b6 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 19:44:03 +0000 Subject: Cosmetics/reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31012 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index e1a71c0ce8..22281bb999 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -186,7 +186,7 @@ static int initTextures(void) texture_height=s; if (!is_yuv) - gl_internal_format = getInternalFormat(); + gl_internal_format = getInternalFormat(); /* Test the max texture size */ do { @@ -201,22 +201,21 @@ static int initTextures(void) if (format == gl_internal_format) break; - mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", - texture_width, texture_height); + mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", + texture_width, texture_height); - if (texture_width > texture_height) - texture_width /= 2; - else - texture_height /= 2; + if (texture_width > texture_height) + texture_width /= 2; + else + texture_height /= 2; - mp_msg (MSGT_VO, MSGL_V, "[%dx%d] !\n", texture_width, texture_height); + mp_msg (MSGT_VO, MSGL_V, "[%dx%d] !\n", texture_width, texture_height); - if(texture_width < 64 || texture_height < 64) { - mp_msg (MSGT_VO, MSGL_FATAL, "[gl2] Give up .. usable texture size not avaiable, or texture config error !\n"); - return -1; - } - } - while (texture_width > 1 && texture_height > 1); + if(texture_width < 64 || texture_height < 64) { + mp_msg (MSGT_VO, MSGL_FATAL, "[gl2] Give up .. usable texture size not avaiable, or texture config error !\n"); + return -1; + } + } while (texture_width > 1 && texture_height > 1); #ifdef TEXTURE_WIDTH texture_width = TEXTURE_WIDTH; #endif -- cgit v1.2.3 From e6455d7161ebc8245cec46492b6aca0773170312 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 4 Apr 2010 19:56:26 +0000 Subject: Check texture dimensions instead of internal format in max texture size check to work around OS X ATI driver bugs: - does not keep format but use an equivalent one (1 becomes 0x8040). - does not set to 0 on failure but to 0x8018 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31013 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libvo/vo_gl2.c') diff --git a/libvo/vo_gl2.c b/libvo/vo_gl2.c index 22281bb999..a1d0506a99 100644 --- a/libvo/vo_gl2.c +++ b/libvo/vo_gl2.c @@ -172,7 +172,6 @@ static int initTextures(void) GLfloat texpercx, texpercy; int s; int x=0, y=0; - GLint format=0; // textures smaller than 64x64 might not be supported s=64; @@ -190,15 +189,16 @@ static int initTextures(void) /* Test the max texture size */ do { + GLint w; glTexImage2D (GL_PROXY_TEXTURE_2D, 0, gl_internal_format, texture_width, texture_height, 0, gl_bitmap_format, gl_bitmap_type, NULL); glGetTexLevelParameteriv - (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_INTERNAL_FORMAT, &format); + (GL_PROXY_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &w); - if (format == gl_internal_format) + if (w >= texture_width) break; mp_msg (MSGT_VO, MSGL_V, "[gl2] Needed texture [%dx%d] too big, trying ", -- cgit v1.2.3