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