Nano DS 4.0 plugins: Can NvBufSurfaceMapEglImage be applied directly to the NvBufSurface of the GstBuffer...

Platform is Nano

Referring to the sample plugin gstdsexample.cpp.

Can NvBufSurfaceMapEglImage be applied directly to the NvBufSurface of the input GstBuffer?

I want to know if I can avoid creating another NvBufSurface and doing a NvBufSurfTransform if all I want to do is performing CUDA computations directly on NV12 frames in CUDA memory.

Hi frederickkl77n1,

Would you please help to update you description or subject with the platform that you’re using?

Thanks

Updated title. It’s a question related to DS4.0 plugins on the Nano.

Hi,
It should work. You can create EGLImage by calling NvBufSurfaceMapEglImage() and then call cuGraphicsEGLRegisterImage(), cuGraphicsResourceGetMappedEglFrame(). Sample code is at

tegra_multimedia_api\samples\common\algorithm\cuda\NvCudaProc.cpp

Thanks :)