Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ int PyNvGopDecoder::GetYUVFromFrame(NvDecoder* decoder, const uint8_t* pFrame, u
decoded_frame.timestamp = timestamp;
decoded_frame.SetColorRange(color_range);

// Copy the decode frames from device
CUDA_DRVAPI_CALL(cuMemcpyDtoD((CUdeviceptr)pFrame_buffer, (CUdeviceptr)pFrame, decoder->GetFrameSize()));
// Queue the decode-buffer copy on the decoder stream. DecProc synchronizes
// this stream before returning the Python-visible frame.
CUDA_DRVAPI_CALL(cuMemcpyDtoDAsync((CUdeviceptr)pFrame_buffer, (CUdeviceptr)pFrame,
decoder->GetFrameSize(), decoder->GetStream()));

switch (decoded_frame.format) {
case Pixel_Format_NV12: {
Expand Down Expand Up @@ -481,6 +483,8 @@ void PyNvGopDecoder::DecProc(AVColorRange color_range, NvDecoder* decoder,
<< " is different with number of frame id:" << std::to_string(sorted_frame_ids.size());
}

CUDA_DRVAPI_CALL(cuStreamSynchronize(decoder->GetStream()));

nvtxRangePop();
}

Expand Down