From bb2ccb375ad7edc4fd7fbb8d6d4a2d36e15d0b5c Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Wed, 3 Aug 2016 21:32:20 -0300
Subject: [PATCH] avcodec/vdpau_compat: Include headers as needed
Signed-off-by: James Almer <jamrial@gmail.com>
---
libavcodec/h263dec.c | 4 ++--
libavcodec/h264_picture.c | 10 ++++------
libavcodec/h264dec.c | 11 +++++------
libavcodec/mpeg12dec.c | 5 ++---
libavcodec/vc1dec.c | 5 ++---
libavcodec/vdpau_compat.h | 3 +++
6 files changed, 18 insertions(+), 20 deletions(-)
@@ -603,8 +603,8 @@ retry:
if (!s->divx_packed && !avctx->hwaccel)
ff_thread_finish_setup(avctx);
-#if FF_API_CAP_VDPAU
- if (CONFIG_MPEG4_VDPAU_DECODER && (s->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)) {
+#if FF_API_CAP_VDPAU && CONFIG_MPEG4_VDPAU_DECODER
+ if (s->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) {
ff_vdpau_mpeg4_decode_picture(avctx->priv_data, s->gb.buffer, s->gb.buffer_end - s->gb.buffer);
goto frame_end;
}
@@ -156,9 +156,8 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
int err = 0;
h->mb_y = 0;
-#if FF_API_CAP_VDPAU
- if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER
+ if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_set_reference_frames(h);
#endif
@@ -179,9 +178,8 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
"hardware accelerator failed to decode picture\n");
}
-#if FF_API_CAP_VDPAU
- if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER
+ if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_complete(h);
#endif
@@ -50,6 +50,7 @@
#include "mathops.h"
#include "me_cmp.h"
#include "mpegutils.h"
+#include "mpegvideo.h"
#include "profiles.h"
#include "rectangle.h"
#include "thread.h"
@@ -844,9 +845,8 @@ again:
if (h->avctx->hwaccel &&
(ret = h->avctx->hwaccel->start_frame(h->avctx, buf, buf_size)) < 0)
goto end;
-#if FF_API_CAP_VDPAU
- if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER
+ if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
ff_vdpau_h264_picture_start(h);
#endif
}
@@ -858,9 +858,8 @@ again:
nal->raw_size);
if (ret < 0)
goto end;
-#if FF_API_CAP_VDPAU
- } else if (CONFIG_H264_VDPAU_DECODER &&
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) {
+#if FF_API_CAP_VDPAU && CONFIG_H264_VDPAU_DECODER
+ } else if (h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU) {
ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
start_code,
sizeof(start_code));
@@ -2433,9 +2433,8 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
s2->er.error_count += s2->thread_context[i]->er.error_count;
}
-#if FF_API_VDPAU
- if ((CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER)
- && uses_vdpau(avctx))
+#if FF_API_VDPAU && (CONFIG_MPEG_VDPAU_DECODER || CONFIG_MPEG1_VDPAU_DECODER)
+ if (uses_vdpau(avctx))
ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
#endif
@@ -909,9 +909,8 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
s->me.qpel_put = s->qdsp.put_qpel_pixels_tab;
s->me.qpel_avg = s->qdsp.avg_qpel_pixels_tab;
-#if FF_API_CAP_VDPAU
- if ((CONFIG_VC1_VDPAU_DECODER)
- &&s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) {
+#if FF_API_CAP_VDPAU && CONFIG_VC1_VDPAU_DECODER
+ if (s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) {
if (v->field_mode && buf_start_second_field) {
ff_vdpau_vc1_decode_picture(s, buf_start, buf_start_second_field - buf_start);
ff_vdpau_vc1_decode_picture(s, buf_start_second_field, (buf + buf_size) - buf_start_second_field);
@@ -25,7 +25,9 @@
#define AVCODEC_VDPAU_COMPAT_H
#include <stdint.h>
+#include "config.h"
+#if CONFIG_VDPAU
#include "h264dec.h"
#include "mpeg4video.h"
@@ -44,5 +46,6 @@ void ff_vdpau_vc1_decode_picture(MpegEncContext *s, const uint8_t *buf,
void ff_vdpau_mpeg4_decode_picture(Mpeg4DecContext *s, const uint8_t *buf,
int buf_size);
+#endif
#endif /* AVCODEC_VDPAU_COMPAT_H */
--
2.9.1