summaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2013-02-18 08:15:52 -0800
committerMartin Storsjö <martin@martin.st>2013-03-06 21:18:50 +0200
commit8d061989dd0397da15aa29f52d243fe125bf2f5e (patch)
tree699546f4517dee6841f701ff8282c366e0efb22b /libavcodec/mpeg12.c
parent5a4e9fe855282a99586050a507d0a486ad39df5b (diff)
downloadffmpeg-streaming-8d061989dd0397da15aa29f52d243fe125bf2f5e.zip
ffmpeg-streaming-8d061989dd0397da15aa29f52d243fe125bf2f5e.tar.gz
lavc: Split out ff_hwaccel_pixfmt_list_420[] over individual codecs
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ö <martin@martin.st>
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 4df51a2..8aa3122 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
OpenPOWER on IntegriCloud