Hi guys,
In this post https://forums.developer.nvidia.com/t/how-to-acquire-frames-out-of-eglstreamkhr-and-map-to-nvbuffer-for-use-in-nvvideoencoder/112794 a solution suggested for acquire nvbuffer(dmaBuffer) from EGLstream
It is impossible to map the buffer directly. Need one memcpy through CUDA.
You need to create NvBuffer and get CUDA pointer of destination by calling:
NvEGLImageFromFd();
cuGraphicsEGLRegisterImage();
cuGraphicsResourceGetMappedEglFrame();
,use CUDA consumer APIs to get CUDA pointer of source:
cuEGLStreamConsumerAcquireFrame();
cuGraphicsResourceGetMappedEglFrame();
, and copy source(CUDA consumer) to destination(NvBuffer).
Is there any complete sample code with for example GL producer or CUDA producer and DMA consumer like what suggested above post.
Thanks so much.