summaryrefslogtreecommitdiffstats
path: root/video/img_format.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-10-18 18:37:24 +0200
committerwm4 <wm4@nowhere>2015-10-18 18:37:24 +0200
commite3de309804d27d3ed41a45f37ca6a37ba3d4a267 (patch)
treed637aaf30e590404bcad324e92d0a3179948f1a3 /video/img_format.c
parent9ca312b4b1d8ccd2c3e28527b5a02dd27d911186 (diff)
downloadmpv-e3de309804d27d3ed41a45f37ca6a37ba3d4a267.tar.bz2
mpv-e3de309804d27d3ed41a45f37ca6a37ba3d4a267.tar.xz
vo_opengl: support all kinds of GBRP formats
Adds support for AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, AV_PIX_FMT_GBRAP, and AV_PIX_FMT_GBRAP16. (Not that it matters, because nobody uses these anyway.)
Diffstat (limited to 'video/img_format.c')
-rw-r--r--video/img_format.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/video/img_format.c b/video/img_format.c
index 7ed4c722e8..c2bbf6bb01 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -231,15 +231,21 @@ struct mp_imgfmt_desc mp_imgfmt_get_desc(int mpfmt)
if (pd->flags & (AV_PIX_FMT_FLAG_PAL | AV_PIX_FMT_FLAG_PSEUDOPAL))
desc.flags |= MP_IMGFLAG_PAL;
- if ((desc.flags & MP_IMGFLAG_YUV) && (desc.flags & MP_IMGFLAG_BYTE_ALIGNED))
+ if ((desc.flags & (MP_IMGFLAG_YUV | MP_IMGFLAG_RGB))
+ && (desc.flags & MP_IMGFLAG_BYTE_ALIGNED))
{
bool same_depth = true;
for (int p = 0; p < desc.num_planes; p++) {
same_depth &= planedepth[p] == planedepth[0] &&
desc.bpp[p] == desc.bpp[0];
}
- if (same_depth && pd->nb_components == desc.num_planes)
- desc.flags |= MP_IMGFLAG_YUV_P;
+ if (same_depth && pd->nb_components == desc.num_planes) {
+ if (desc.flags & MP_IMGFLAG_YUV) {
+ desc.flags |= MP_IMGFLAG_YUV_P;
+ } else {
+ desc.flags |= MP_IMGFLAG_RGB_P;
+ }
+ }
}
for (int p = 0; p < desc.num_planes; p++) {