Commit 880236e8 authored by Timo Rothenpieler's avatar Timo Rothenpieler

avcodec/nvdec: pass CUstream in vpp parameters

parent c8556834
...@@ -39,6 +39,7 @@ typedef struct NVDECDecoder { ...@@ -39,6 +39,7 @@ typedef struct NVDECDecoder {
AVBufferRef *hw_device_ref; AVBufferRef *hw_device_ref;
CUcontext cuda_ctx; CUcontext cuda_ctx;
CUstream stream;
CudaFunctions *cudl; CudaFunctions *cudl;
CuvidFunctions *cvdl; CuvidFunctions *cvdl;
...@@ -189,6 +190,7 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref, ...@@ -189,6 +190,7 @@ static int nvdec_decoder_create(AVBufferRef **out, AVBufferRef *hw_device_ref,
} }
decoder->cuda_ctx = device_hwctx->cuda_ctx; decoder->cuda_ctx = device_hwctx->cuda_ctx;
decoder->cudl = device_hwctx->internal->cuda_dl; decoder->cudl = device_hwctx->internal->cuda_dl;
decoder->stream = device_hwctx->stream;
ret = cuvid_load_functions(&decoder->cvdl, logctx); ret = cuvid_load_functions(&decoder->cvdl, logctx);
if (ret < 0) { if (ret < 0) {
...@@ -386,7 +388,7 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame) ...@@ -386,7 +388,7 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
NVDECFrame *cf = (NVDECFrame*)fdd->hwaccel_priv; NVDECFrame *cf = (NVDECFrame*)fdd->hwaccel_priv;
NVDECDecoder *decoder = (NVDECDecoder*)cf->decoder_ref->data; NVDECDecoder *decoder = (NVDECDecoder*)cf->decoder_ref->data;
CUVIDPROCPARAMS vpp = { .progressive_frame = 1 }; CUVIDPROCPARAMS vpp = { 0 };
NVDECFrame *unmap_data = NULL; NVDECFrame *unmap_data = NULL;
CUresult err; CUresult err;
...@@ -397,6 +399,9 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame) ...@@ -397,6 +399,9 @@ static int nvdec_retrieve_data(void *logctx, AVFrame *frame)
unsigned int offset = 0; unsigned int offset = 0;
int ret = 0; int ret = 0;
vpp.progressive_frame = 1;
vpp.output_stream = decoder->stream;
err = decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx); err = decoder->cudl->cuCtxPushCurrent(decoder->cuda_ctx);
if (err != CUDA_SUCCESS) if (err != CUDA_SUCCESS)
return AVERROR_UNKNOWN; return AVERROR_UNKNOWN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment