[MPlayer-cvslog] r31006 - in trunk/libvo: gl_common.c gl_common.h vo_gl.c vo_gl2.c
reimar
subversion at mplayerhq.hu
Sun Apr 4 18:56:30 CEST 2010
Author: reimar
Date: Sun Apr 4 18:56:30 2010
New Revision: 31006
Log:
Factor out the YUV->RGB conversion auto-selection and also
enable auto-selection of ATI fragment shaders since they
should do accurate conversions now.
Modified:
trunk/libvo/gl_common.c
trunk/libvo/gl_common.h
trunk/libvo/vo_gl.c
trunk/libvo/vo_gl2.c
Modified: trunk/libvo/gl_common.c
==============================================================================
--- trunk/libvo/gl_common.c Sun Apr 4 18:48:46 2010 (r31005)
+++ trunk/libvo/gl_common.c Sun Apr 4 18:56:30 2010 (r31006)
@@ -1380,6 +1380,20 @@ static void glSetupYUVFragprog(gl_conver
}
/**
+ * \brief detect the best YUV->RGB conversion method available
+ */
+int glAutodetectYUVConversion(void) {
+ const char *extensions = mpglGetString(GL_EXTENSIONS);
+ if (strstr(extensions, "GL_ARB_fragment_program"))
+ return YUV_CONVERSION_FRAGMENT;
+ if (strstr(extensions, "GL_ATI_text_fragment_shader"))
+ return YUV_CONVERSION_TEXT_FRAGMENT;
+ if (strstr(extensions, "GL_ATI_fragment_shader"))
+ return YUV_CONVERSION_COMBINERS_ATI;
+ return YUV_CONVERSION_NONE;
+}
+
+/**
* \brief setup YUV->RGB conversion
* \param parms struct containing parameters like conversion and scaler type,
* brightness, ...
Modified: trunk/libvo/gl_common.h
==============================================================================
--- trunk/libvo/gl_common.h Sun Apr 4 18:48:46 2010 (r31005)
+++ trunk/libvo/gl_common.h Sun Apr 4 18:56:30 2010 (r31006)
@@ -345,6 +345,7 @@ typedef struct {
float filter_strength;
} gl_conversion_params_t;
+int glAutodetectYUVConversion(void);
void glSetupYUVConversion(gl_conversion_params_t *params);
void glEnableYUVConversion(GLenum target, int type);
void glDisableYUVConversion(GLenum target, int type);
Modified: trunk/libvo/vo_gl.c
==============================================================================
--- trunk/libvo/vo_gl.c Sun Apr 4 18:48:46 2010 (r31005)
+++ trunk/libvo/vo_gl.c Sun Apr 4 18:56:30 2010 (r31006)
@@ -480,7 +480,8 @@ static void autodetectGlExtensions(void)
if (ati_hack == -1) ati_hack = ati_broken_pbo;
if (force_pbo == -1) force_pbo = strstr(extensions, "_pixel_buffer_object") ? is_ati : 0;
if (use_rectangle == -1) use_rectangle = strstr(extensions, "_texture_non_power_of_two") ? 0 : 0;
- if (use_yuv == -1) use_yuv = strstr(extensions, "GL_ARB_fragment_program") ? 2 : 0;
+ if (use_yuv == -1)
+ use_yuv = glAutodetectYUVConversion();
if (is_ati && (lscale == 1 || lscale == 2 || cscale == 1 || cscale == 2))
mp_msg(MSGT_VO, MSGL_WARN, "[gl] Selected scaling mode may be broken on ATI cards.\n"
"Tell _them_ to fix GL_REPEAT if you have issues.\n");
Modified: trunk/libvo/vo_gl2.c
==============================================================================
--- trunk/libvo/vo_gl2.c Sun Apr 4 18:48:46 2010 (r31005)
+++ trunk/libvo/vo_gl2.c Sun Apr 4 18:56:30 2010 (r31006)
@@ -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;
More information about the MPlayer-cvslog
mailing list