hi,i hope someone can help me.
I am using NvDecoder to decode multiple videos.follow the sample i have finished my job.
but now i want to improve performance.
when i saw the following codes
int NvDecoder::HandlePictureDisplay(CUVIDPARSERDISPINFO *pDispInfo) {
CUVIDPROCPARAMS videoProcessingParameters = {};
videoProcessingParameters.progressive_frame = pDispInfo->progressive_frame;
videoProcessingParameters.second_field = pDispInfo->repeat_first_field + 1;
videoProcessingParameters.top_field_first = pDispInfo->top_field_first;
videoProcessingParameters.unpaired_field = pDispInfo->repeat_first_field < 0;
videoProcessingParameters.output_stream = m_cuvidStream;
CUdeviceptr dpSrcFrame = 0;
unsigned int nSrcPitch = 0;
CUDA_DRVAPI_CALL(cuCtxPushCurrent(m_cuContext));
NVDEC_API_CALL(cuvidMapVideoFrame(m_hDecoder, pDispInfo->picture_index, &dpSrcFrame,
&nSrcPitch, &videoProcessingParameters));
..............
}
I realised that i can use 'CUstream' to get a perfect result of parallel execution in cuda.
So i create a custream by 'cuStreamCreate(&custream,0)' outside.then use it as followed.
int NvDecoder::Decode(const uint8_t *pData, int nSize, int nFlags, int64_t nTimestamp ,Custream custream)
{
............
NVDEC_API_CALL(cuvidParseVideoData(m_hParser, &packet));
//m_cuvidStream = 0; //sample default 0
m_cuvidStream=custream;
........
}
Now i get a mistake :
‘cuvidMapVideoFrame(m_hDecoder, pDispInfo->picture_index, &dpSrcFrame, &nSrcPitch, &videoProcessingParameters) returned error 400’
what i can do to solve this problem, cuvidMapVideoFrame can not use CUstream?