From 8d061989dd0397da15aa29f52d243fe125bf2f5e Mon Sep 17 00:00:00 2001 From: "Ronald S. Bultje" Date: Mon, 18 Feb 2013 08:15:52 -0800 Subject: lavc: Split out ff_hwaccel_pixfmt_list_420[] over individual codecs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not all hwaccels implement all codecs, so using one single list for multiple such codecs means some codecs will be represented in the list, even though they don't actually handle that codec. Copying specific lists in each codec fixes that. Signed-off-by: Martin Storsjö --- libavcodec/mpeg12.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'libavcodec/mpeg12.c') diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 4df51a22a9..8aa31222b3 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1176,6 +1176,20 @@ static const enum AVPixelFormat pixfmt_xvmc_mpg2_420[] = { AV_PIX_FMT_XVMC_MPEG2_MC, AV_PIX_FMT_NONE }; +static const enum AVPixelFormat mpeg12_hwaccel_pixfmt_list_420[] = { +#if CONFIG_MPEG2_DXVA2_HWACCEL + AV_PIX_FMT_DXVA2_VLD, +#endif +#if CONFIG_MPEG2_VAAPI_HWACCEL + AV_PIX_FMT_VAAPI_VLD, +#endif +#if CONFIG_MPEG1_VDPAU_HWACCEL | CONFIG_MPEG2_VDPAU_HWACCEL + AV_PIX_FMT_VDPAU, +#endif + AV_PIX_FMT_YUV420P, + AV_PIX_FMT_NONE +}; + static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) { Mpeg1Context *s1 = avctx->priv_data; @@ -1190,7 +1204,7 @@ static enum AVPixelFormat mpeg_get_pixelformat(AVCodecContext *avctx) return AV_PIX_FMT_VDPAU_MPEG2; } else { if (s->chroma_format < 2) - return avctx->get_format(avctx, ff_hwaccel_pixfmt_list_420); + return avctx->get_format(avctx, mpeg12_hwaccel_pixfmt_list_420); else if (s->chroma_format == 2) return AV_PIX_FMT_YUV422P; else -- cgit v1.2.3