On 26/09/2017 03:55, Chao Liu wrote:
2017-09-25 18:04 GMT+08:00 Luca Barbato <[email protected]>:

Should improve the performance on multiple transcoding from a single
source.
---
  libavcodec/qsv.c     | 5 +++++
  libavfilter/qsvvpp.c | 3 +++
  2 files changed, 8 insertions(+)

diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c
index 56bfbb33d2..76a0e26bb4 100644
--- a/libavcodec/qsv.c
+++ b/libavcodec/qsv.c
@@ -594,6 +594,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..5d20a383fc 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;
--
2.11.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel


Works fine on my side.
LGTM

Thank you, I'll push it tomorrow. Maxym is it fine for you as well?

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to