# HG changeset patch # User reimar # Date 1126626992 0 # Node ID 01d27e023ae47ff775a9810e9eb3a37485a76217 # Parent d9697b778be2ad45e3d3b9368b44c7c56e775d2a Improved glFindFormat diff -r d9697b778be2 -r 01d27e023ae4 libvo/gl_common.c --- a/libvo/gl_common.c Tue Sep 13 11:38:39 2005 +0000 +++ b/libvo/gl_common.c Tue Sep 13 15:56:32 2005 +0000 @@ -94,9 +94,9 @@ return "Unknown format!"; } -#undef TEXTUREFORMAT_ALWAYS //! always return this format as internal texture format in glFindFormat #define TEXTUREFORMAT_ALWAYS GL_RGB8 +#undef TEXTUREFORMAT_ALWAYS /** * \brief find the OpenGL settings coresponding to format. @@ -113,6 +113,7 @@ int glFindFormat(uint32_t fmt, uint32_t *bpp, GLint *gl_texfmt, GLenum *gl_format, GLenum *gl_type) { + int supported = 1; int dummy1; GLenum dummy2; GLint dummy3; @@ -133,6 +134,8 @@ *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_BYTE; break; + case IMGFMT_YV12: + supported = 0; // no native YV12 support case IMGFMT_Y800: case IMGFMT_Y8: *gl_texfmt = 1; @@ -187,12 +190,12 @@ *gl_texfmt = 4; *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_BYTE; - return 0; + supported = 0; } #ifdef TEXTUREFORMAT_ALWAYS *gl_texfmt = TEXTUREFORMAT_ALWAYS; #endif - return 1; + return supported; } static void *setNull(const GLubyte *s) { diff -r d9697b778be2 -r 01d27e023ae4 libvo/vo_gl.c --- a/libvo/vo_gl.c Tue Sep 13 11:38:39 2005 +0000 +++ b/libvo/vo_gl.c Tue Sep 13 15:56:32 2005 +0000 @@ -187,10 +187,9 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format) { - int tmp; image_height = height; image_width = width; - glFindFormat(format, &tmp, &gl_texfmt, &gl_format, &gl_type); + glFindFormat(format, NULL, &gl_texfmt, &gl_format, &gl_type); int_pause = 0;