From d6de87d1d3aa4ecddf5a4e523c0410be2ab517aa Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 5 Nov 2013 21:59:26 +0100 Subject: video: make IMGFMT_RGB0 etc. exist even if libavutil doesn't support it These formats are helpful for distinguishing surfaces with and without alpha. Unfortunately, Libav and older version of FFmpeg don't support them, so code will break. Fix this by treating these formats specially on the mpv side, mapping them to RGBA on Libav, and unseting the alpha bit in the mp_imgfmt_desc struct. --- video/fmt-conversion.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'video/fmt-conversion.c') diff --git a/video/fmt-conversion.c b/video/fmt-conversion.c index 7d37e8ca87..b908837547 100644 --- a/video/fmt-conversion.c +++ b/video/fmt-conversion.c @@ -159,16 +159,22 @@ static const struct { {IMGFMT_GBRP14_BE, PIX_FMT_GBRP14BE}, {IMGFMT_GBRP14_LE, PIX_FMT_GBRP14LE}, + {IMGFMT_RGBA64_BE, PIX_FMT_RGBA64BE}, + {IMGFMT_RGBA64_LE, PIX_FMT_RGBA64LE}, + {IMGFMT_BGRA64_BE, PIX_FMT_BGRA64BE}, + {IMGFMT_BGRA64_LE, PIX_FMT_BGRA64LE}, + {IMGFMT_BGR0, PIX_FMT_BGR0}, {IMGFMT_0RGB, PIX_FMT_0RGB}, {IMGFMT_RGB0, PIX_FMT_RGB0}, {IMGFMT_0BGR, PIX_FMT_0BGR}, {IMGFMT_BGR0, PIX_FMT_BGR0}, - - {IMGFMT_RGBA64_BE, PIX_FMT_RGBA64BE}, - {IMGFMT_RGBA64_LE, PIX_FMT_RGBA64LE}, - {IMGFMT_BGRA64_BE, PIX_FMT_BGRA64BE}, - {IMGFMT_BGRA64_LE, PIX_FMT_BGRA64LE}, +#else + {IMGFMT_BGR0, PIX_FMT_BGRA}, + {IMGFMT_0RGB, PIX_FMT_ARGB}, + {IMGFMT_RGB0, PIX_FMT_RGBA}, + {IMGFMT_0BGR, PIX_FMT_ABGR}, + {IMGFMT_BGR0, PIX_FMT_BGRA}, #endif #if HAVE_AVCODEC_NEW_VDPAU_API -- cgit v1.2.3