Commit bfc83acf authored by Mark Thompson's avatar 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.
parent f0a978a5
...@@ -189,14 +189,14 @@ int ff_vaapi_decode_issue(AVCodecContext *avctx, ...@@ -189,14 +189,14 @@ int ff_vaapi_decode_issue(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode " av_log(avctx, AV_LOG_ERROR, "Failed to end picture decode "
"issue: %d (%s).\n", vas, vaErrorStr(vas)); "issue: %d (%s).\n", vas, vaErrorStr(vas));
err = AVERROR(EIO); err = AVERROR(EIO);
if (ctx->hwctx->driver_quirks & if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
goto fail; goto fail;
else else
goto fail_at_end; goto fail_at_end;
} }
if (ctx->hwctx->driver_quirks & if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
ff_vaapi_decode_destroy_buffers(avctx, pic); ff_vaapi_decode_destroy_buffers(avctx, pic);
......
...@@ -392,14 +392,14 @@ static int vaapi_encode_issue(AVCodecContext *avctx, ...@@ -392,14 +392,14 @@ static int vaapi_encode_issue(AVCodecContext *avctx,
err = AVERROR(EIO); err = AVERROR(EIO);
// vaRenderPicture() has been called here, so we should not destroy // vaRenderPicture() has been called here, so we should not destroy
// the parameter buffers unless separate destruction is required. // 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) AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS)
goto fail; goto fail;
else else
goto fail_at_end; goto fail_at_end;
} }
if (ctx->hwctx->driver_quirks & if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
for (i = 0; i < pic->nb_param_buffers; i++) { for (i = 0; i < pic->nb_param_buffers; i++) {
vas = vaDestroyBuffer(ctx->hwctx->display, vas = vaDestroyBuffer(ctx->hwctx->display,
......
...@@ -536,7 +536,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) ...@@ -536,7 +536,7 @@ static int deint_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail_after_render; goto fail_after_render;
} }
if (ctx->hwctx->driver_quirks & if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
vas = vaDestroyBuffer(ctx->hwctx->display, params_id); vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
if (vas != VA_STATUS_SUCCESS) { if (vas != VA_STATUS_SUCCESS) {
......
...@@ -347,7 +347,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame) ...@@ -347,7 +347,7 @@ static int scale_vaapi_filter_frame(AVFilterLink *inlink, AVFrame *input_frame)
goto fail_after_render; goto fail_after_render;
} }
if (ctx->hwctx->driver_quirks & if (HAVE_VAAPI_1 || ctx->hwctx->driver_quirks &
AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) { AV_VAAPI_DRIVER_QUIRK_RENDER_PARAM_BUFFERS) {
vas = vaDestroyBuffer(ctx->hwctx->display, params_id); vas = vaDestroyBuffer(ctx->hwctx->display, params_id);
if (vas != VA_STATUS_SUCCESS) { if (vas != VA_STATUS_SUCCESS) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment