NVIDIA DeepStream SDK API Reference

5.0 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvbufsurface.h File Reference

Detailed Description

NvBufSurface Interface

This file specifies the NvBufSurface management API.

The NvBufSurface API provides methods to allocate / deallocate, map / unmap and copy batched buffers.

Definition in file nvbufsurface.h.

Go to the source code of this file.

Data Structures

struct  NvBufSurfacePlaneParams
 Holds the planewise parameters of a buffer. More...
 
struct  NvBufSurfaceCreateParams
 Holds parameters required to allocate an NvBufSurface. More...
 
struct  NvBufSurfaceMappedAddr
 Holds pointers for a mapped buffer. More...
 
struct  NvBufSurfaceParams
 Holds information about a single buffer in a batch. More...
 
struct  NvBufSurface
 Holds information about batched buffers. More...
 

Macros

#define STRUCTURE_PADDING   4
 Defines the default padding length for reserved fields of structures. More...
 
#define NVBUF_MAX_PLANES   4
 Defines the maximum number of planes. More...
 

Typedefs

typedef struct
NvBufSurfacePlaneParams 
NvBufSurfacePlaneParams
 Holds the planewise parameters of a buffer. More...
 
typedef struct
NvBufSurfaceCreateParams 
NvBufSurfaceCreateParams
 Holds parameters required to allocate an NvBufSurface. More...
 
typedef struct
NvBufSurfaceMappedAddr 
NvBufSurfaceMappedAddr
 Holds pointers for a mapped buffer. More...
 
typedef struct NvBufSurfaceParams NvBufSurfaceParams
 Holds information about a single buffer in a batch. More...
 
typedef struct NvBufSurface NvBufSurface
 Holds information about batched buffers. More...
 

Enumerations

enum  NvBufSurfaceMemMapFlags {
  NVBUF_MAP_READ,
  NVBUF_MAP_WRITE,
  NVBUF_MAP_READ_WRITE
}
 Specifies mapping types for NvBufSurface. More...
 
enum  NvBufSurfaceColorFormat {
  NVBUF_COLOR_FORMAT_INVALID,
  NVBUF_COLOR_FORMAT_GRAY8,
  NVBUF_COLOR_FORMAT_YUV420,
  NVBUF_COLOR_FORMAT_YVU420,
  NVBUF_COLOR_FORMAT_YUV420_ER,
  NVBUF_COLOR_FORMAT_YVU420_ER,
  NVBUF_COLOR_FORMAT_NV12,
  NVBUF_COLOR_FORMAT_NV12_ER,
  NVBUF_COLOR_FORMAT_NV21,
  NVBUF_COLOR_FORMAT_NV21_ER,
  NVBUF_COLOR_FORMAT_UYVY,
  NVBUF_COLOR_FORMAT_UYVY_ER,
  NVBUF_COLOR_FORMAT_VYUY,
  NVBUF_COLOR_FORMAT_VYUY_ER,
  NVBUF_COLOR_FORMAT_YUYV,
  NVBUF_COLOR_FORMAT_YUYV_ER,
  NVBUF_COLOR_FORMAT_YVYU,
  NVBUF_COLOR_FORMAT_YVYU_ER,
  NVBUF_COLOR_FORMAT_YUV444,
  NVBUF_COLOR_FORMAT_RGBA,
  NVBUF_COLOR_FORMAT_BGRA,
  NVBUF_COLOR_FORMAT_ARGB,
  NVBUF_COLOR_FORMAT_ABGR,
  NVBUF_COLOR_FORMAT_RGBx,
  NVBUF_COLOR_FORMAT_BGRx,
  NVBUF_COLOR_FORMAT_xRGB,
  NVBUF_COLOR_FORMAT_xBGR,
  NVBUF_COLOR_FORMAT_RGB,
  NVBUF_COLOR_FORMAT_BGR,
  NVBUF_COLOR_FORMAT_NV12_10LE,
  NVBUF_COLOR_FORMAT_NV12_12LE,
  NVBUF_COLOR_FORMAT_YUV420_709,
  NVBUF_COLOR_FORMAT_YUV420_709_ER,
  NVBUF_COLOR_FORMAT_NV12_709,
  NVBUF_COLOR_FORMAT_NV12_709_ER,
  NVBUF_COLOR_FORMAT_YUV420_2020,
  NVBUF_COLOR_FORMAT_NV12_2020,
  NVBUF_COLOR_FORMAT_NV12_10LE_ER,
  NVBUF_COLOR_FORMAT_NV12_10LE_709,
  NVBUF_COLOR_FORMAT_NV12_10LE_709_ER,
  NVBUF_COLOR_FORMAT_NV12_10LE_2020,
  NVBUF_COLOR_FORMAT_SIGNED_R16G16,
  NVBUF_COLOR_FORMAT_LAST
}
 Specifies color formats for NvBufSurface. More...
 
enum  NvBufSurfaceLayout {
  NVBUF_LAYOUT_PITCH,
  NVBUF_LAYOUT_BLOCK_LINEAR
}
 Specifies layout formats for NvBufSurface video planes. More...
 
enum  NvBufSurfaceMemType {
  NVBUF_MEM_DEFAULT,
  NVBUF_MEM_CUDA_PINNED,
  NVBUF_MEM_CUDA_DEVICE,
  NVBUF_MEM_CUDA_UNIFIED,
  NVBUF_MEM_SURFACE_ARRAY,
  NVBUF_MEM_HANDLE,
  NVBUF_MEM_SYSTEM
}
 Specifies memory types for NvBufSurface. More...
 

Functions

int NvBufSurfaceCreate (NvBufSurface **surf, uint32_t batchSize, NvBufSurfaceCreateParams *params)
 Allocates a batch of buffers. More...
 
int NvBufSurfaceDestroy (NvBufSurface *surf)
 Frees batched buffers previously allocated by NvBufSurfaceCreate(). More...
 
int NvBufSurfaceMap (NvBufSurface *surf, int index, int plane, NvBufSurfaceMemMapFlags type)
 Maps hardware batched buffers to the HOST or CPU address space. More...
 
int NvBufSurfaceUnMap (NvBufSurface *surf, int index, int plane)
 Unmaps previously mapped buffer(s). More...
 
int NvBufSurfaceCopy (NvBufSurface *srcSurf, NvBufSurface *dstSurf)
 Copies the content of source batched buffer(s) to destination batched buffer(s). More...
 
int NvBufSurfaceSyncForCpu (NvBufSurface *surf, int index, int plane)
 Syncs the hardware memory cache for the CPU. More...
 
int NvBufSurfaceSyncForDevice (NvBufSurface *surf, int index, int plane)
 Syncs the hardware memory cache for the device. More...
 
int NvBufSurfaceFromFd (int dmabuf_fd, void **buffer)
 Gets the NvBufSurface from the DMABUF FD. More...
 
int NvBufSurfaceMemSet (NvBufSurface *surf, int index, int plane, uint8_t value)
 Fills each byte of the buffer(s) in an NvBufSurface with a provided value. More...
 
int NvBufSurfaceMapEglImage (NvBufSurface *surf, int index)
 Creates an EGLImage from the memory of one or more NvBufSurface buffers. More...
 
int NvBufSurfaceUnMapEglImage (NvBufSurface *surf, int index)
 Destroys the previously created EGLImage object(s). More...