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