aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-21 23:40:03 -0300
committerJames Almer <jamrial@gmail.com>2017-10-21 23:40:03 -0300
commitc68a3ab96ec0497ae2d627ddd30c61737d18173e (patch)
tree5176f02ac79027e41655aa4c67a16913675461c6
parentb48ed00403603f5d850eaa7b3e2fcda9ef98fb1c (diff)
parent7b917041184874e7d7cba4450813de7e0bb28a33 (diff)
downloadffmpeg-c68a3ab96ec0497ae2d627ddd30c61737d18173e.tar.gz
Merge commit '7b917041184874e7d7cba4450813de7e0bb28a33'
* commit '7b917041184874e7d7cba4450813de7e0bb28a33': lavc: Drop deprecated VDPAU codec capability Merged-by: James Almer <jamrial@gmail.com>
-rw-r--r--libavcodec/avcodec.h14
-rw-r--r--libavcodec/decode.c4
-rw-r--r--libavcodec/error_resilience.c3
-rw-r--r--libavcodec/h263dec.c7
-rw-r--r--libavcodec/h264_picture.c12
-rw-r--r--libavcodec/h264_slice.c23
-rw-r--r--libavcodec/h264dec.c21
-rw-r--r--libavcodec/mpegpicture.c6
-rw-r--r--libavcodec/mpegvideo.c12
-rw-r--r--libavcodec/vc1dec.c38
-rw-r--r--libavcodec/vdpau.h34
-rw-r--r--libavcodec/version.h3
12 files changed, 9 insertions, 168 deletions
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 6922b5b6fc..076332b6f1 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -1031,13 +1031,6 @@ typedef struct RcOverride{
*/
#define AV_CODEC_CAP_SMALL_LAST_FRAME (1 << 6)
-#if FF_API_CAP_VDPAU
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define AV_CODEC_CAP_HWACCEL_VDPAU (1 << 7)
-#endif
-
/**
* Codec can output multiple frames per AVPacket
* Normally demuxers return one frame at a time, demuxers which do not do
@@ -1222,12 +1215,7 @@ typedef struct RcOverride{
* This can be used to prevent truncation of the last audio samples.
*/
#define CODEC_CAP_SMALL_LAST_FRAME AV_CODEC_CAP_SMALL_LAST_FRAME
-#if FF_API_CAP_VDPAU
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define CODEC_CAP_HWACCEL_VDPAU AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
+
/**
* Codec can output multiple frames per AVPacket
* Normally demuxers return one frame at a time, demuxers which do not do
diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index 1337ffb527..7f08f0ec18 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1214,10 +1214,6 @@ int ff_get_format(AVCodecContext *avctx, const enum AVPixelFormat *fmt)
if (!(desc->flags & AV_PIX_FMT_FLAG_HWACCEL))
break;
-#if FF_API_CAP_VDPAU
- if (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
- break;
-#endif
if (avctx->hw_frames_ctx) {
AVHWFramesContext *hw_frames_ctx = (AVHWFramesContext*)avctx->hw_frames_ctx->data;
diff --git a/libavcodec/error_resilience.c b/libavcodec/error_resilience.c
index 5364940e94..0c7f29d171 100644
--- a/libavcodec/error_resilience.c
+++ b/libavcodec/error_resilience.c
@@ -814,9 +814,6 @@ void ff_er_frame_start(ERContext *s)
static int er_supported(ERContext *s)
{
if(s->avctx->hwaccel && s->avctx->hwaccel->decode_slice ||
-#if FF_API_CAP_VDPAU
- s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU ||
-#endif
!s->cur_pic.f ||
s->cur_pic.field_picture
)
diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index bcb2b08bb0..288a0cd431 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -603,13 +603,6 @@ retry:
if (!s->divx_packed)
ff_thread_finish_setup(avctx);
-#if FF_API_CAP_VDPAU
- if (CONFIG_MPEG4_VDPAU_DECODER && (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;
- }
-#endif
-
if (avctx->hwaccel) {
ret = avctx->hwaccel->start_frame(avctx, s->gb.buffer,
s->gb.buffer_end - s->gb.buffer);
diff --git a/libavcodec/h264_picture.c b/libavcodec/h264_picture.c
index 99d9f9075c..30987d3145 100644
--- a/libavcodec/h264_picture.c
+++ b/libavcodec/h264_picture.c
@@ -152,12 +152,6 @@ 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)
- ff_vdpau_h264_set_reference_frames(h);
-#endif
-
if (in_setup || !(avctx->active_thread_type & FF_THREAD_FRAME)) {
if (!h->droppable) {
err = ff_h264_execute_ref_pic_marking(h);
@@ -175,12 +169,6 @@ 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)
- ff_vdpau_h264_picture_complete(h);
-#endif
-
if (!in_setup && !h->droppable)
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
h->picture_structure == PICT_BOTTOM_FIELD);
diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
index 2577edd8a6..5d9558745e 100644
--- a/libavcodec/h264_slice.c
+++ b/libavcodec/h264_slice.c
@@ -497,11 +497,7 @@ static int h264_frame_start(H264Context *h)
if ((ret = alloc_picture(h, pic)) < 0)
return ret;
- if(!h->frame_recovered && !h->avctx->hwaccel
-#if FF_API_CAP_VDPAU
- && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
-#endif
- )
+ if(!h->frame_recovered && !h->avctx->hwaccel)
ff_color_frame(pic->f, c);
h->cur_pic_ptr = pic;
@@ -939,17 +935,6 @@ static int h264_slice_header_init(H264Context *h)
goto fail;
}
-#if FF_API_CAP_VDPAU
- if (h->avctx->codec &&
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU &&
- (sps->bit_depth_luma != 8 || sps->chroma_format_idc > 1)) {
- av_log(h->avctx, AV_LOG_ERROR,
- "VDPAU decoding does not support video colorspace.\n");
- ret = AVERROR_INVALIDDATA;
- goto fail;
- }
-#endif
-
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
sps->bit_depth_luma == 11 || sps->bit_depth_luma == 13
) {
@@ -2738,11 +2723,7 @@ int ff_h264_execute_decode_slices(H264Context *h)
h->slice_ctx[0].next_slice_idx = INT_MAX;
- if (h->avctx->hwaccel || context_count < 1
-#if FF_API_CAP_VDPAU
- || h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
- )
+ if (h->avctx->hwaccel || context_count < 1)
return 0;
av_assert0(context_count && h->slice_ctx[context_count - 1].mb_y < h->mb_height);
diff --git a/libavcodec/h264dec.c b/libavcodec/h264dec.c
index f29c3f9048..b11a5ea636 100644
--- a/libavcodec/h264dec.c
+++ b/libavcodec/h264dec.c
@@ -527,10 +527,6 @@ static void flush_dpb(AVCodecContext *avctx)
h->context_initialized = 0;
}
-#if FF_API_CAP_VDPAU
-static const uint8_t start_code[] = { 0x00, 0x00, 0x01 };
-#endif
-
static int get_last_needed_nal(H264Context *h)
{
int nals_needed = 0;
@@ -688,11 +684,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
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)
- ff_vdpau_h264_picture_start(h);
-#endif
}
max_slice_ctx = avctx->hwaccel ? 1 : h->nb_slice_ctx;
@@ -701,18 +692,6 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size)
ret = avctx->hwaccel->decode_slice(avctx, nal->raw_data, nal->raw_size);
h->nb_slice_ctx_queued = 0;
} else
-#if FF_API_CAP_VDPAU
- if (CONFIG_H264_VDPAU_DECODER &&
- 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));
- ff_vdpau_add_data_chunk(h->cur_pic_ptr->f->data[0],
- nal->raw_data,
- nal->raw_size);
- ret = 0;
- } else
-#endif
ret = ff_h264_execute_decode_slices(h);
if (ret < 0 && (h->avctx->err_recognition & AV_EF_EXPLODE))
goto end;
diff --git a/libavcodec/mpegpicture.c b/libavcodec/mpegpicture.c
index 53fb35b4bd..9811a778b7 100644
--- a/libavcodec/mpegpicture.c
+++ b/libavcodec/mpegpicture.c
@@ -58,11 +58,7 @@ int ff_mpeg_framesize_alloc(AVCodecContext *avctx, MotionEstContext *me,
{
int alloc_size = FFALIGN(FFABS(linesize) + 64, 32);
- if (avctx->hwaccel
-#if FF_API_CAP_VDPAU
- || avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
- )
+ if (avctx->hwaccel)
return 0;
if (linesize < 24) {
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index c4089972f0..75e6742995 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1311,11 +1311,7 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
return -1;
}
- if (!avctx->hwaccel
-#if FF_API_CAP_VDPAU
- && !(avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
-#endif
- ) {
+ if (!avctx->hwaccel) {
for(i=0; i<avctx->height; i++)
memset(s->last_picture_ptr->f->data[0] + s->last_picture_ptr->f->linesize[0]*i,
0x80, avctx->width);
@@ -1661,11 +1657,7 @@ void ff_print_debug_info2(AVCodecContext *avctx, AVFrame *pict, uint8_t *mbskip_
}
/* TODO: export all the following to make them accessible for users (and filters) */
- if (avctx->hwaccel || !mbtype_table
-#if FF_API_CAP_VDPAU
- || (avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU)
-#endif
- )
+ if (avctx->hwaccel || !mbtype_table)
return;
diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c
index 16c601e756..b68115613a 100644
--- a/libavcodec/vc1dec.c
+++ b/libavcodec/vc1dec.c
@@ -657,15 +657,6 @@ 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) {
int buf_size2 = 0;
@@ -684,21 +675,13 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
if (size <= 0) continue;
switch (AV_RB32(start)) {
case VC1_CODE_FRAME:
- if (avctx->hwaccel
-#if FF_API_CAP_VDPAU
- || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
- )
+ if (avctx->hwaccel)
buf_start = start;
buf_size2 = vc1_unescape_buffer(start + 4, size, buf2);
break;
case VC1_CODE_FIELD: {
int buf_size3;
- if (avctx->hwaccel
-#if FF_API_CAP_VDPAU
- || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
- )
+ if (avctx->hwaccel)
buf_start_second_field = start;
tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
if (!tmp) {
@@ -764,11 +747,7 @@ static int vc1_decode_frame(AVCodecContext *avctx, void *data,
ret = AVERROR_INVALIDDATA;
goto err;
} else { // found field marker, unescape second field
- if (avctx->hwaccel
-#if FF_API_CAP_VDPAU
- || s->avctx->codec->capabilities&AV_CODEC_CAP_HWACCEL_VDPAU
-#endif
- )
+ if (avctx->hwaccel)
buf_start_second_field = divider;
tmp = av_realloc_array(slices, sizeof(*slices), (n_slices+1));
if (!tmp) {
@@ -917,17 +896,6 @@ 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) {
- 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);
- } else {
- ff_vdpau_vc1_decode_picture(s, buf_start, (buf + buf_size) - buf_start);
- }
- } else
-#endif
if (avctx->hwaccel) {
s->mb_y = 0;
if (v->field_mode && buf_start_second_field) {
diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h
index 855d387d9a..458e4fa605 100644
--- a/libavcodec/vdpau.h
+++ b/libavcodec/vdpau.h
@@ -214,40 +214,6 @@ attribute_deprecated
int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
#endif
-#if FF_API_CAP_VDPAU
-/** @brief The videoSurface is used for rendering. */
-#define FF_VDPAU_STATE_USED_FOR_RENDER 1
-
-/**
- * @brief The videoSurface is needed for reference/prediction.
- * The codec manipulates this.
- */
-#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
-
-/**
- * @brief This structure is used as a callback between the FFmpeg
- * decoder (vd_) and presentation (vo_) module.
- * This is used for defining a video frame containing surface,
- * picture parameter, bitstream information etc which are passed
- * between the FFmpeg decoder and its clients.
- */
-struct vdpau_render_state {
- VdpVideoSurface surface; ///< Used as rendered surface, never changed.
-
- int state; ///< Holds FF_VDPAU_STATE_* values.
-
- /** picture parameter information for all supported codecs */
- union AVVDPAUPictureInfo info;
-
- /** Describe size/location of the compressed video data.
- Set to 0 when freeing bitstream_buffers. */
- int bitstream_buffers_allocated;
- int bitstream_buffers_used;
- /** The user is responsible for freeing this buffer using av_freep(). */
- VdpBitstreamBuffer *bitstream_buffers;
-};
-#endif
-
/* @}*/
#endif /* AVCODEC_VDPAU_H */
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 1431d94d76..0335a2868c 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -57,9 +57,6 @@
#ifndef FF_API_LOWRES
#define FF_API_LOWRES (LIBAVCODEC_VERSION_MAJOR < 59)
#endif
-#ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
-#endif
#ifndef FF_API_BUFS_VDPAU
#define FF_API_BUFS_VDPAU (LIBAVCODEC_VERSION_MAJOR < 58)
#endif