[FFmpeg-cvslog] qsvenc: Allow use of hw_device_ctx to make the internal session

Mark Thompson git at videolan.org
Thu Jun 15 00:39:41 EEST 2017


ffmpeg | branch: master | Mark Thompson <sw at jkqxz.net> | Sat Mar  4 23:57:37 2017 +0000| [28aedeed1961392d6b27f2f3abe4fd4c33393b93] | committer: Mark Thompson

qsvenc: Allow use of hw_device_ctx to make the internal session

(cherry picked from commit 3d197514e613ccd9eab43180c0a7c8b09a307606)

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

 libavcodec/qsvenc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/libavcodec/qsvenc.c b/libavcodec/qsvenc.c
index 64227cea6e..5eb506fb76 100644
--- a/libavcodec/qsvenc.c
+++ b/libavcodec/qsvenc.c
@@ -700,6 +700,13 @@ static int qsvenc_init_session(AVCodecContext *avctx, QSVEncContext *q)
         }
 
         q->session = q->internal_session;
+    } else if (avctx->hw_device_ctx) {
+        ret = ff_qsv_init_session_device(avctx, &q->internal_session,
+                                         avctx->hw_device_ctx, q->load_plugins);
+        if (ret < 0)
+            return ret;
+
+        q->session = q->internal_session;
     } else {
         ret = ff_qsv_init_internal_session(avctx, &q->internal_session,
                                            q->load_plugins);



More information about the ffmpeg-cvslog mailing list