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?