28 #ifndef NVBUFSURFACE_H_
29 #define NVBUFSURFACE_H_
46 #define STRUCTURE_PADDING 4
49 #define NVBUF_MAX_PLANES 4
Specifies BT.601 colorspace - YUV444 multi-planar.
Specifies CUDA Device memory type.
NvBufSurfaceColorFormat
Specifies color formats for NvBufSurface.
struct NvBufSurfaceCreateParams NvBufSurfaceCreateParams
Holds parameters required to allocate an NvBufSurface.
Specifies color format for packed 2 signed shorts.
uint32_t size
Holds the amount of memory to be allocated.
NvBufSurfaceLayout layout
Holds BL or PL.
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
void * _reserved[STRUCTURE_PADDING]
void * _reserved[STRUCTURE_PADDING]
Specifies BT.601 colorspace - YVU420 ER multi-planar.
#define NVBUF_MAX_PLANES
Defines the maximum number of planes.
uint32_t pitch[NVBUF_MAX_PLANES]
Holds the pitches of planes in bytes.
int NvBufSurfaceUnMapEglImage(NvBufSurface *surf, int index)
Destroys the previously created EGLImage object(s).
int NvBufSurfaceDestroy(NvBufSurface *surf)
Frees batched buffers previously allocated by NvBufSurfaceCreate().
Specifies BT.601 colorspace - YUV422 multi-planar.
void * dataPtr
Holds a pointer to allocated memory.
NvBufSurfaceColorFormat colorFormat
Holds the color format of the buffer.
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 multi-planar.
struct NvBufSurfaceMappedAddr NvBufSurfaceMappedAddr
Holds pointers for a mapped buffer.
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Specifies block linear layout.
int NvBufSurfaceSyncForDevice(NvBufSurface *surf, int index, int plane)
Syncs the hardware memory cache for the device.
Specifies NVRM Surface Array type.
uint32_t num_planes
Holds the number of planes.
Specifies an invalid color format.
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 multi-planar.
uint32_t bytesPerPix[NVBUF_MAX_PLANES]
Holds the number of bytes occupied by a pixel in each plane.
Specifies RGB-8-8-8 single plane.
Specifies RGBA-8-8-8-8 single plane.
Specifies RGB- unsigned 8 bit multiplanar plane.
Holds information about a single buffer in a batch.
Specifies NvBufSurface mapping type "write.".
Specifies ABGR-8-8-8-8 single plane.
struct NvBufSurfacePlaneParams NvBufSurfacePlaneParams
Holds the planewise parameters of a buffer.
Specifies NvBufSurface mapping type "read.".
bool isContiguous
Holds a "contiguous memory" flag.
Specifies BGR-8-8-8 single plane.
Specifies BT.2020 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
Specifies BT.601 colorspace - YUV 4:2:2 planar.
Specifies BT.709 colorspace - Y/CbCr ER 4:2:0 multi-planar.
Specifies BT.601 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
void * addr[NVBUF_MAX_PLANES]
Holds planewise pointers to a CPU mapped buffer.
NvBufSurfaceMappedAddr mappedAddr
Holds pointers to mapped buffers.
Specifies BGRA-8-8-8-8 single plane.
Specifies CUDA Host memory type.
Specifies RGBx-8-8-8-8 single plane.
uint32_t numFilled
Holds the number valid and filled buffers.
Specifies BT.601 colorspace - Y/CbCr 4:2:0 multi-planar.
Specifies memory allocated by malloc().
int NvBufSurfaceFromFd(int dmabuf_fd, void **buffer)
Gets the NvBufSurface from the DMABUF FD.
int NvBufSurfaceCopy(NvBufSurface *srcSurf, NvBufSurface *dstSurf)
Copies the content of source batched buffer(s) to destination batched buffer(s).
Specifies BT.2020 colorspace - YUV420 multi-planar.
uint32_t pitch
Holds the pitch of the buffer.
uint32_t psize[NVBUF_MAX_PLANES]
Holds the sizes of planes in bytes.
NvBufSurfaceParams * surfaceList
Holds a pointer to an array of batched buffers.
uint32_t batchSize
Holds the batch size.
Specifies BT.601 colorspace - YUV420 multi-planar.
int NvBufSurfaceSyncForCpu(NvBufSurface *surf, int index, int plane)
Syncs the hardware memory cache for the CPU.
Holds parameters required to allocate an NvBufSurface.
Specifies BGR- unsigned 8 bit multiplanar plane.
Specifies CUDA Unified memory type.
Specifies BT.601 colorspace - YUV420 ER multi-planar.
Specifies 8 bit GRAY scale - single plane.
NvBufSurfaceMemType memType
Holds type of memory for buffers in the batch.
struct NvBufSurface NvBufSurface
Holds information about batched buffers.
#define STRUCTURE_PADDING
Defines the default padding length for reserved fields of structures.
NvBufSurfacePlaneParams planeParams
Holds planewise information (width, height, pitch, offset, etc.).
Holds the planewise parameters of a buffer.
uint32_t width
Holds the width of the buffer.
Specifies BT.601 colorspace - YUV 4:2:2 planar.
uint32_t height
Holds the height of the buffer.
Specifies BT.601 colorspace - Y/CbCr 4:2:0 12-bit multi-planar.
uint64_t bufferDesc
Holds a DMABUF FD.
uint32_t height
Holds the height of the buffer.
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
Specifies ARGB-8-8-8-8 single plane.
Holds information about batched buffers.
uint32_t offset[NVBUF_MAX_PLANES]
Holds the offsets of planes in bytes.
NvBufSurfaceMemType
Specifies memory types for NvBufSurface.
Specifies BT.709 colorspace - Y/CbCr 4:2:0 multi-planar.
uint32_t width[NVBUF_MAX_PLANES]
Holds the widths of planes.
Specifies the default memory type, i.e.
uint32_t gpuId
Holds the GPU ID.
Specifies BT.601 colorspace - YUV ER 4:2:2 planar.
int NvBufSurfaceUnMap(NvBufSurface *surf, int index, int plane)
Unmaps previously mapped buffer(s).
uint32_t gpuId
Holds a GPU ID.
struct NvBufSurfaceParams NvBufSurfaceParams
Holds information about a single buffer in a batch.
Specifies BGRx-8-8-8-8 single plane.
Specifies BT.709 colorspace - YUV420 multi-planar.
Specifies BT.601 colorspace - YUV420 multi-planar.
NvBufSurfaceMemType memType
Holds the type of memory to be allocated.
Specifies NVRM Handle type.
uint32_t height[NVBUF_MAX_PLANES]
Holds the heights of planes.
Specifies BT.601 colorspace - YUV 4:2:2 planar.
int NvBufSurfaceCreate(NvBufSurface **surf, uint32_t batchSize, NvBufSurfaceCreateParams *params)
Allocates a batch of buffers.
Specifies BT.601 colorspace - YUV 4:2:2 planar.
void * _reserved[STRUCTURE_PADDING]
NvBufSurfaceLayout
Specifies layout formats for NvBufSurface video planes.
Specifies BT.709 colorspace - Y/CbCr ER 4:2:0 10-bit multi-planar.
uint32_t width
Holds the width of the buffer.
NvBufSurfaceLayout layout
Holds the surface layout.
bool isContiguous
Holds an "is contiguous" flag.
Specifies BT.601 colorspace - Y/CbCr 4:2:0 multi-planar.
Specifies xBGR-8-8-8-8 single plane.
Specifies RGB-32bit Floating point multiplanar plane.
Specifies NvBufSurface mapping type "read/write.".
NvBufSurfaceMemMapFlags
Specifies mapping types for NvBufSurface.
void * eglImage
Holds a pointer to a mapped EGLImage.
Specifies BT.709 colorspace - YUV420 ER multi-planar.
Specifies BT.601 colorspace - Y/CbCr ER 4:2:0 10-bit multi-planar.
Specifies BT.2020 colorspace - Y/CbCr 4:2:0 multi-planar.
NvBufSurfaceColorFormat colorFormat
Holds the color format of the buffer.
int NvBufSurfaceMap(NvBufSurface *surf, int index, int plane, NvBufSurfaceMemMapFlags type)
Maps hardware batched buffers to the HOST or CPU address space.
Specifies BGR-32bit Floating point multiplanar plane.
Specifies xRGB-8-8-8-8 single plane.
Holds pointers for a mapped buffer.
uint32_t dataSize
Holds the amount of allocated memory.
Specifies BT.709 colorspace - Y/CbCr 4:2:0 10-bit multi-planar.
int NvBufSurfaceMapEglImage(NvBufSurface *surf, int index)
Creates an EGLImage from the memory of one or more NvBufSurface buffers.
void * _reserved[STRUCTURE_PADDING *NVBUF_MAX_PLANES]
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.