diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2015-08-16 19:35:59 -0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2015-08-18 15:57:19 -0400 |
commit | 030b5a4f777b59066f1766030db082a53682994d (patch) | |
tree | fa4925411e7246103c96ba9a7c6fae69d273a3ce /libavcodec/vc1dec.c | |
parent | 7a629186ba0481f4aef1d9590d0e55b3bc5f4ed0 (diff) | |
download | ffmpeg-030b5a4f777b59066f1766030db082a53682994d.tar.gz |
lavc: put remaining bits of vdpau-in-decoder under FF_API_CAP_VDPAU.
Diffstat (limited to 'libavcodec/vc1dec.c')
-rw-r--r-- | libavcodec/vc1dec.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index abaa0b48e0..7b96ede147 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -647,12 +647,14 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, return buf_size; } +#if FF_API_CAP_VDPAU if (s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) { if (v->profile < PROFILE_ADVANCED) avctx->pix_fmt = AV_PIX_FMT_VDPAU_WMV3; else avctx->pix_fmt = AV_PIX_FMT_VDPAU_VC1; } +#endif //for advanced profile we may need to parse and unescape data if (avctx->codec_id == AV_CODEC_ID_VC1 || avctx->codec_id == AV_CODEC_ID_VC1IMAGE) { @@ -672,15 +674,21 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, if (size <= 0) continue; switch (AV_RB32(start)) { case VC1_CODE_FRAME: - if (avctx->hwaccel || - s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) + if (avctx->hwaccel +#if FF_API_CAP_VDPAU + || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU +#endif + ) buf_start = start; buf_size2 = vc1_unescape_buffer(start + 4, size, buf2); break; case VC1_CODE_FIELD: { int buf_size3; - if (avctx->hwaccel || - s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) + if (avctx->hwaccel +#if FF_API_CAP_VDPAU + || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU +#endif + ) buf_start_second_field = start; tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1)); if (!tmp) { @@ -742,8 +750,11 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, ret = AVERROR_INVALIDDATA; goto err; } else { // found field marker, unescape second field - if (avctx->hwaccel || - s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU) + if (avctx->hwaccel +#if FF_API_CAP_VDPAU + || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU +#endif + ) buf_start_second_field = divider; tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1)); if (!tmp) { @@ -890,6 +901,7 @@ 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 (v->field_mode && buf_start_second_field) { @@ -898,7 +910,9 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data, } else { ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start); } - } else if (avctx->hwaccel) { + } else +#endif + if (avctx->hwaccel) { if (v->field_mode && buf_start_second_field) { // decode first field s->picture_structure = PICT_BOTTOM_FIELD - v->tff; |