diff options
author | Mark Thompson <sw@jkqxz.net> | 2017-03-04 23:57:37 +0000 |
---|---|---|
committer | Mark Thompson <sw@jkqxz.net> | 2017-06-14 22:26:32 +0100 |
commit | 28aedeed1961392d6b27f2f3abe4fd4c33393b93 (patch) | |
tree | 4e5bad17f6cf3f94e2709cb21217a25fa1b2f64a /libavcodec | |
parent | 8aa3c2df1ae64b4b30462cc8a164520e65312d1a (diff) | |
download | ffmpeg-28aedeed1961392d6b27f2f3abe4fd4c33393b93.tar.gz |
qsvenc: Allow use of hw_device_ctx to make the internal session
(cherry picked from commit 3d197514e613ccd9eab43180c0a7c8b09a307606)
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/qsvenc.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); |