Commit ea25ccd1 authored by Luca Barbato's avatar Luca Barbato

qsv: Join the derived session to the parent

Should improve the performance on multiple transcoding from a single
source.
parent ccbb31c1
...@@ -593,6 +593,11 @@ int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession, ...@@ -593,6 +593,11 @@ int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession,
"Error setting a HW handle"); "Error setting a HW handle");
} }
err = MFXJoinSession(parent_session, session);
if (err != MFX_ERR_NONE)
return ff_qsv_print_error(avctx, err,
"Error joining session");
ret = qsv_load_plugins(session, load_plugins, avctx); ret = qsv_load_plugins(session, load_plugins, avctx);
if (ret < 0) { if (ret < 0) {
av_log(avctx, AV_LOG_ERROR, "Error loading plugins\n"); av_log(avctx, AV_LOG_ERROR, "Error loading plugins\n");
......
...@@ -515,6 +515,9 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s) ...@@ -515,6 +515,9 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
if (ret != MFX_ERR_NONE) if (ret != MFX_ERR_NONE)
return AVERROR_UNKNOWN; return AVERROR_UNKNOWN;
} }
ret = MFXJoinSession(device_hwctx->session, s->session);
if (ret != MFX_ERR_NONE)
return AVERROR_UNKNOWN;
if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode)) { if (IS_OPAQUE_MEMORY(s->in_mem_mode) || IS_OPAQUE_MEMORY(s->out_mem_mode)) {
s->opaque_alloc.In.Surfaces = s->surface_ptrs_in; s->opaque_alloc.In.Surfaces = s->surface_ptrs_in;
......
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