how to get gpu memory address (in GPU)from CUdeviceptr in video sdk(6.0)

my project want to use GUP to decode two h264 video,scaled one video and mixed video and then encode in GPU,
now I use video sdk and can decode h264 from video api,but from api ,I can only get CUdeviceptr,I need to get the GPU memory address for YUV scale and merge,
below is my video sdk code:

CUdeviceptr pDecodedFrame = 0;
unsigned int nDecodedPitch = 0;
CUresult oResult = cuvidMapVideoFrame(pDecoder->m_videoDecoder, pPicParams->picture_index, &pDecodedFrame, &nDecodedPitch, &oVideoProcessingParameters);

my question is : how can I get the ptr of buffer(in GPU) from pDecodedFrame

any advice is welcome


pDecodedFrame is the CUDA device pointer for the decoded frame. You can use that pointer for any subsequent processing in CUDA.

What do you mean by “ptr of buffer (in GPU)”?

thanks for your reply,I need use pDecodedFrame as pointer in CUDA to mix video in GPU

The deviceptr returned by cuvidMapVideoframe precisely points to memory location in the Video memory which contains the output. In your case pDecodedFrame is of type CUdeviceptr which is actually the pointer to GPU memory. You can use this in subsequent CUDA operations as CUdeviceptr. In case you need to access this output in sysmem/cpu you need to allocate system resource and do a cuMemcpyDtoH from dev ptr to sys ptr.

is there any scale video function and mix video function in CUDA,I need to scale one video and mixed to another video,
any advice is welcome,thanks