diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-12-31 22:53:25 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-12-31 22:53:25 +0000 |
commit | a326622304cedacce34b31f47dafe7069e076e01 (patch) | |
tree | d4046032aae4527ec51bec2dd502b0c55991fc7e /libvo/gl_common.c | |
parent | 498ad7ba573b80ac8740886b46f9f8e660647858 (diff) | |
download | mpv-a326622304cedacce34b31f47dafe7069e076e01.tar.bz2 mpv-a326622304cedacce34b31f47dafe7069e076e01.tar.xz |
Add support for 16-bit per component YUV formats.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30152 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/gl_common.c')
-rw-r--r-- | libvo/gl_common.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libvo/gl_common.c b/libvo/gl_common.c index 2571959640..ffca3ac35f 100644 --- a/libvo/gl_common.c +++ b/libvo/gl_common.c @@ -234,9 +234,15 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, if (!gl_format) gl_format = &dummy2; if (!gl_type) gl_type = &dummy2; - // these are all the same for our purpose - if (mp_get_chroma_shift(fmt, NULL, NULL)) - fmt = IMGFMT_YV12; + if (mp_get_chroma_shift(fmt, NULL, NULL)) { + // reduce the possible cases a bit + if (IMGFMT_IS_YUVP16_LE(fmt)) + fmt = IMGFMT_420P16_LE; + else if (IMGFMT_IS_YUVP16_BE(fmt)) + fmt = IMGFMT_420P16_BE; + else + fmt = IMGFMT_YV12; + } *bpp = IMGFMT_IS_BGR(fmt)?IMGFMT_BGR_DEPTH(fmt):IMGFMT_RGB_DEPTH(fmt); *gl_texfmt = 3; @@ -254,6 +260,13 @@ int glFindFormat(uint32_t fmt, int *bpp, GLint *gl_texfmt, *gl_format = GL_RGBA; *gl_type = GL_UNSIGNED_BYTE; break; + case IMGFMT_420P16: + supported = 0; // no native YUV support + *gl_texfmt = 1; + *bpp = 16; + *gl_format = GL_LUMINANCE; + *gl_type = GL_UNSIGNED_SHORT; + break; case IMGFMT_YV12: supported = 0; // no native YV12 support case IMGFMT_Y800: |