[FFmpeg-cvslog] vaapi: Always free parameter buffers after vaEndPicture() with libva2
Mark Thompson
git at videolan.org
Sun Nov 12 04:36:17 EET 2017
ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sun Oct 1 22:51:20 2017 +0100| [bfc83acfd6b33986480d4c6d3c571ba6a59f1d98] | committer: Mark Thompson
vaapi: Always free parameter buffers after vaEndPicture() with libva2
This is an ABI change in libva2: previously the Intel driver had this
behaviour and it was implemented as a driver quirk, but now it is part
of the specification so all drivers must do it.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bfc83acfd6b33986480d4c6d3c571ba6a59f1d98
---
libavcodec/vaapi_decode.c | 4 ++--
libavcodec/vaapi_encode.c | 4 ++--
libavfilter/vf_deinterlace_vaapi.c | 2 +-
libavfilter/vf_scale_vaapi.c | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/libavcodec/vaapi_decode.c b/libavcodec/vaapi_decode.c
index febe22a710..02304191ff 100644
--- a/libavcodec/vaapi_decode.c
+++ b/libavcodec/vaapi_decode.c
@@ -189,14 +189,14 @@ int ff_vaapi_decode_issue(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode "
"issue: %d (%s).\n", vas, vaErrorStr(vas));
err = AVERROR(EIO);
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
goto fail;
else
goto fail_at_end;
}
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
ff_vaapi_decode_destroy_buffers(avctx, pic);
diff --git a/libavcodec/vaapi_encode.c b/libavcodec/vaapi_encode.c
index 462ec7a8e7..47795ba735 100644
--- a/libavcodec/vaapi_encode.c
+++ b/libavcodec/vaapi_encode.c
@@ -392,14 +392,14 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
err = AVERROR(EIO);
// vaRenderPicture() has been called here, so we should not destroy
// the parameter buffers unless separate destruction is required.
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
goto fail;
else
goto fail_at_end;
}
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
for (i = 0; i < pic->nb_param_buffers; i++) {
vas = vaDestroyBuffer(ctx->hwctx->display,
diff --git a/libavfilter/vf_deinterlace_vaapi.c b/libavfilter/vf_deinterlace_vaapi.c
index f3afcc4f75..95a0f40419 100644
--- a/libavfilter/vf_deinterlace_vaapi.c
+++ b/libavfilter/vf_deinterlace_vaapi.c
@@ -536,7 +536,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail_after_render;
}
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
if (vas != VA_STATUS_SUCCESS) {
diff --git a/libavfilter/vf_scale_vaapi.c b/libavfilter/vf_scale_vaapi.c
index 50be68eee0..4c8f2cf4ef 100644
--- a/libavfilter/vf_scale_vaapi.c
+++ b/libavfilter/vf_scale_vaapi.c
@@ -347,7 +347,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail_after_render;
}
- if (ctx->hwctx->driver_quirks &
+ if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
if (vas != VA_STATUS_SUCCESS) {
More information about the ffmpeg-cvslog
mailing list