summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-13 15:56:32 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-09-13 15:56:32 +0000
commit587c45e08e82ed6995781e28c95c77311587a6d6 (patch)
treec3e031375407cd376bba01c6a2442417fafe7ea1 /libvo
parent7a7bfba6ed98299c66755e52e7efb677848aae73 (diff)
downloadmpv-587c45e08e82ed6995781e28c95c77311587a6d6.tar.bz2
mpv-587c45e08e82ed6995781e28c95c77311587a6d6.tar.xz
Improved glFindFormat
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16475 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/gl_common.c9
-rw-r--r--libvo/vo_gl.c3
2 files changed, 7 insertions, 5 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c
index 33e478bcc5..752c80ef78 100644
--- a/libvo/gl_common.c
+++ b/libvo/gl_common.c
@@ -94,9 +94,9 @@ const char *glValName(GLint value)
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 @@ const char *glValName(GLint value)
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 @@ int glFindFormat(uint32_t fmt, uint32_t *bpp, GLint *gl_texfmt,
*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 @@ int glFindFormat(uint32_t fmt, uint32_t *bpp, GLint *gl_texfmt,
*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 --git a/libvo/vo_gl.c b/libvo/vo_gl.c
index 35bf9a4d42..90e1e58635 100644
--- a/libvo/vo_gl.c
+++ b/libvo/vo_gl.c
@@ -187,10 +187,9 @@ static int initGl(uint32_t d_width, uint32_t d_height) {
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;