[FFmpeg-cvslog] qsv: Join the derived session to the parent

Luca Barbato git at videolan.org
Sat Nov 11 20:24:58 EET 2017


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Sun Sep 24 13:54:28 2017 +0000| [ea25ccd1b2a980df8d43cc1f86a23e3c094090a6] | committer: Luca Barbato

qsv: Join the derived session to the parent

Should improve the performance on multiple transcoding from a single
source.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ea25ccd1b2a980df8d43cc1f86a23e3c094090a6
---

 libavcodec/qsv.c     | 5 +++++
 libavfilter/qsvvpp.c | 3 +++
 2 files changed, 8 insertions(+)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index a8ae65622c..96dca14e9a 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -593,6 +593,11 @@ int ff_qsv_init_session_device(AVCodecContext *avctx, mfxSession *psession,
                                       "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);
     if (ret < 0) {
         av_log(avctx, AV_LOG_ERROR, "Error loading plugins\n");
diff --git a/libavfilter/qsvvpp.c b/libavfilter/qsvvpp.c
index 0b639c2d67..a96cfa65de 100644
--- a/libavfilter/qsvvpp.c
+++ b/libavfilter/qsvvpp.c
@@ -515,6 +515,9 @@ static int init_vpp_session(AVFilterContext *avctx, QSVVPPContext *s)
         if (ret != MFX_ERR_NONE)
             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)) {
         s->opaque_alloc.In.Surfaces   = s->surface_ptrs_in;



More information about the ffmpeg-cvslog mailing list