summaryrefslogtreecommitdiffstats
path: root/video/img_format.c
diff options
context:
space:
mode:
Diffstat (limited to 'video/img_format.c')
-rw-r--r--video/img_format.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/video/img_format.c b/video/img_format.c
index dfb82d2081..c0bbce90ee 100644
--- a/video/img_format.c
+++ b/video/img_format.c
@@ -111,6 +111,7 @@ struct mp_imgfmt_entry mp_imgfmt_list[] = {
FMT_ENDIAN("gbrp12", IMGFMT_GBRP12)
FMT_ENDIAN("gbrp14", IMGFMT_GBRP14)
FMT_ENDIAN("gbrp16", IMGFMT_GBRP16)
+ FMT_ENDIAN("xyz12", IMGFMT_XYZ12)
FMT("vdpau_mpeg1", IMGFMT_VDPAU_MPEG1)
FMT("vdpau_mpeg2", IMGFMT_VDPAU_MPEG2)
FMT("vdpau_h264", IMGFMT_VDPAU_H264)
@@ -184,7 +185,7 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt)
// Packed RGB formats are the only formats that have less than 8 bits per
// component, and still require endian dependent access.
if (pd->comp[0].depth_minus1 + 1 <= 8 &&
- !(mpfmt >= IMGFMT_RGB12_LE || mpfmt <= IMGFMT_BGR16_BE))
+ !(mpfmt >= IMGFMT_RGB12_LE && mpfmt <= IMGFMT_BGR16_BE))
{
desc.flags |= MP_IMGFLAG_LE | MP_IMGFLAG_BE;
} else {
@@ -193,8 +194,10 @@ static struct mp_imgfmt_desc get_avutil_fmt(enum PixelFormat fmt)
desc.plane_bits = planedepth[0];
- if (!(pd->flags & PIX_FMT_RGB) && fmt != PIX_FMT_MONOBLACK &&
- fmt != PIX_FMT_PAL8)
+ if (mpfmt == IMGFMT_XYZ12_LE || mpfmt == IMGFMT_XYZ12_BE) {
+ desc.flags |= MP_IMGFLAG_XYZ;
+ } else if (!(pd->flags & PIX_FMT_RGB) && fmt != PIX_FMT_MONOBLACK &&
+ fmt != PIX_FMT_PAL8)
{
desc.flags |= MP_IMGFLAG_YUV;
} else {