Two methods of obtaining EGLImageKHR from a DMA ID yield different result

Using the Jetson Multimedia API to decode video, the decoded data is stored in a DMA ID. An EGLImageKHR is obtained from the DMA ID using an interface.
(1)One method is as follows:
NvBufSurface* nvbuf_surf = 0;
int ret = NvBufSurfaceFromFd(dma_id, (void**)(&nvbuf_surf));
NvBufSurfaceMapEglImage(nvbuf_surf, 0);
EGLImageKHR decode_egl_image = nvbuf_surf->surfaceList[0].mappedAddr.eglImage;
(2)Another method is:
EGLImageKHR decode_egl_image2 = NvEGLImageFromFd(eglDisplay, dma_id);

The values of decode_egl_image and decode_egl_image2 are different. Is this behavior normal? In theory, when mapping the same DMA ID, shouldn’t the obtained addresses be the same?

Please share which Jetpack version you are using. Not sure if you use latest Jetpack 5.1.2 or use previous version. And you may use either method to continue your development. It shall be same buffer mapping to two EGLImage contexts. It is supposed to work well by using single method.

Jetpack version is 5.1.2. which method is right?

Either way is good. Please give it a try.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.