[FFmpeg-cvslog] avcodec/nvdec: pass CUstream in vpp parameters

Timo Rothenpieler git at videolan.org
Thu May 10 01:47:33 EEST 2018


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Tue May  8 00:07:31 2018 +0200| [880236e898fdc2610a60b644b8d802bc299e4d71] | committer: Timo Rothenpieler

avcodec/nvdec: pass CUstream in vpp parameters

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

 libavcodec/nvdec.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavcodec/nvdec.c b/libavcodec/nvdec.c
index 502747adfd..e779be3a45 100644
--- a/libavcodec/nvdec.c
+++ b/libavcodec/nvdec.c
@@ -39,6 +39,7 @@ typedef struct NVDECDecoder {
 
     AVBufferRef *hw_device_ref;
     CUcontext    cuda_ctx;
+    CUstream     stream;
 
     CudaFunctions *cudl;
     CuvidFunctions *cvdl;
@@ -189,6 +190,7 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref,
     }
     decoder->cuda_ctx = device_hwctx->cuda_ctx;
     decoder->cudl = device_hwctx->internal->cuda_dl;
+    decoder->stream = device_hwctx->stream;
 
     ret = cuvid_load_functions(&decoder->cvdl, logctx);
     if (ret < 0) {
@@ -386,7 +388,7 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
     NVDECFrame        *cf = (NVDECFrame*)fdd->hwaccel_priv;
     NVDECDecoder *decoder = (NVDECDecoder*)cf->decoder_ref->data;
 
-    CUVIDPROCPARAMS vpp = { .progressive_frame = 1 };
+    CUVIDPROCPARAMS vpp = { 0 };
     NVDECFrame *unmap_data = NULL;
 
     CUresult err;
@@ -397,6 +399,9 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
     unsigned int offset = 0;
     int ret = 0;
 
+    vpp.progressive_frame = 1;
+    vpp.output_stream = decoder->stream;
+
     err = decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx);
     if (err != CUDA_SUCCESS)
         return AVERROR_UNKNOWN;



More information about the ffmpeg-cvslog mailing list