int NvBufSurfaceMapEglImage(
NvBufSurface * surf,
int index )
Creates an EGLImage from the memory of one or more NvBufSurface buffers.
Only memory type NVBUF_MEM_SURFACE_ARRAY is supported.
This function returns the created EGLImage by storing its address at surf->surfaceList->mappedAddr->eglImage. (surf is a pointer to an NvBufSurface. surfaceList is a pointer to an NvBufSurfaceParams. mappedAddr is a pointer to an NvBufSurfaceMappedAddr.eglImage is declared as a pointer to void, and holds an EGLImageKHR.)
You can use this function in scenarios where a CUDA operation on Jetson hardware memory (identified by NVBUF_MEM_SURFACE_ARRAY) is required. The EGLImageKHR struct provided by this function can then be registered with CUDA for further CUDA operations.
Parameters
- [in,out] surf
A pointer to an NvBufSurface structure. The function stores a pointer to the created EGLImage in a descendant of this structure; see the notes above. - [in] index
Index of a buffer in the batch. -1 specifies all buffers in the batch. - Returns
0 for success, or -1 otherwise.

该函数`intNvBufSurfaceMapEglImage()`从NvBufSurface缓冲区创建EGLImage,支持NVBUF_MEM_SURFACE_ARRAY类型的内存。创建的EGLImage的地址存储在NvBufSurface结构的子结构中,用于后续CUDA操作。参数包括指向NvBufSurface的指针和要映射的缓冲区索引。成功返回0,否则返回-1。
1万+

被折叠的 条评论
为什么被折叠?



