if ((ret = alloc_picture(h, pic)) < 0)
return ret;
- if(!h->frame_recovered && !h->avctx->hwaccel &&
- !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU))
+ if(!h->frame_recovered && !h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ && !(h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+#endif
+ )
avpriv_color_frame(pic->f, c);
h->cur_pic_ptr = pic;
*fmt++ = AV_PIX_FMT_D3D11VA_VLD;
#endif
#if CONFIG_H264_VAAPI_HWACCEL
- *fmt++ = AV_PIX_FMT_VAAPI_VLD;
+ *fmt++ = AV_PIX_FMT_VAAPI;
#endif
#if CONFIG_H264_VDA_HWACCEL
*fmt++ = AV_PIX_FMT_VDA_VLD;
goto fail;
}
+#if FF_API_CAP_VDPAU
if (h->avctx->codec &&
h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU &&
(h->sps.bit_depth_luma != 8 || h->sps.chroma_format_idc > 1)) {
ret = AVERROR_INVALIDDATA;
goto fail;
}
+#endif
if (h->sps.bit_depth_luma < 8 || h->sps.bit_depth_luma > 14 ||
h->sps.bit_depth_luma == 11 || h->sps.bit_depth_luma == 13
if (first_mb_in_slice == 0) { // FIXME better field boundary detection
if (h->current_slice) {
- av_assert0(!h->setup_finished);
+ if (h->setup_finished) {
+ av_log(h->avctx, AV_LOG_ERROR, "Too many fields\n");
+ return AVERROR_INVALIDDATA;
+ }
if (h->cur_pic_ptr && FIELD_PICTURE(h) && h->first_field) {
ret = ff_h264_field_end(h, h->slice_ctx, 1);
h->current_slice = 0;
h->slice_ctx[0].next_slice_idx = INT_MAX;
- if (h->avctx->hwaccel ||
- h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU)
+ if (h->avctx->hwaccel
+#if FF_API_CAP_VDPAU
+ || h->avctx->codec->capabilities & AV_CODEC_CAP_HWACCEL_VDPAU
+#endif
+ )
return 0;
if (context_count == 1) {
int ret;