L4T Multimedia API Reference

28.1 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NV HW Buffer Utility API

Detailed Description

NVIDIA buffering utility library for use by applications.

Data Structures

struct  _NvBufferParams
 

Macros

#define MAX_NUM_PLANES   3
 

Typedefs

typedef struct _NvBufferParams NvBufferParams
 

Enumerations

enum  NvBufferLayout {
  NvBufferLayout_Pitch,
  NvBufferLayout_BlockLinear
}
 
enum  NvBufferMemFlags {
  NvBufferMem_Read,
  NvBufferMem_Write,
  NvBufferMem_Read_Write
}
 
enum  NvBufferColorFormat {
  NvBufferColorFormat_YUV420,
  NvBufferColorFormat_YVU420,
  NvBufferColorFormat_NV12,
  NvBufferColorFormat_NV21,
  NvBufferColorFormat_UYVY,
  NvBufferColorFormat_VYUY,
  NvBufferColorFormat_YUYV,
  NvBufferColorFormat_YVYU,
  NvBufferColorFormat_ABGR32,
  NvBufferColorFormat_XRGB32,
  NvBufferColorFormat_ARGB32,
  NvBufferColorFormat_Invalid
}
 

Functions

EGLImageKHR NvEGLImageFromFd (EGLDisplay display, int dmabuf_fd)
 This method must be used for getting EGLImage from dmabuf-fd. More...
 
int NvDestroyEGLImage (EGLDisplay display, EGLImageKHR eglImage)
 This method must be used for destroying EGLImage object. More...
 
int NvBufferCreate (int *dmabuf_fd, int width, int height, NvBufferLayout layout, NvBufferColorFormat colorFormat)
 Use this method to allocate HW buffer. More...
 
int NvBufferGetParams (int dmabuf_fd, NvBufferParams *params)
 Use this method to get buffer parameters. More...
 
int NvBufferDestroy (int dmabuf_fd)
 This method must be used for destroying hw_buffer. More...
 
int NvBufferMemSyncForCpu (int dmabuf_fd, unsigned int plane, void **pVirtAddr)
 This method must be used for hw memory cache sync for the CPU. More...
 
int NvBufferMemSyncForDevice (int dmabuf_fd, unsigned int plane, void **pVirtAddr)
 This method must be used for hw memory cache sync for device. More...
 
int NvBufferMemMap (int dmabuf_fd, unsigned int plane, NvBufferMemFlags memflag, void **pVirtAddr)
 This method must be used for getting mem mapped virtual Address of the plane. More...
 
int NvBufferMemUnMap (int dmabuf_fd, unsigned int plane, void **pVirtAddr)
 This method must be used to Unmap the mapped virtual Address of the plane. More...
 

Macro Definition Documentation

#define MAX_NUM_PLANES   3

Definition at line 36 of file nvbuf_utils.h.

Typedef Documentation

Enumeration Type Documentation

Enumerator
NvBufferColorFormat_YUV420 
NvBufferColorFormat_YVU420 
NvBufferColorFormat_NV12 
NvBufferColorFormat_NV21 
NvBufferColorFormat_UYVY 
NvBufferColorFormat_VYUY 
NvBufferColorFormat_YUYV 
NvBufferColorFormat_YVYU 
NvBufferColorFormat_ABGR32 
NvBufferColorFormat_XRGB32 
NvBufferColorFormat_ARGB32 
NvBufferColorFormat_Invalid 

Definition at line 51 of file nvbuf_utils.h.

Enumerator
NvBufferLayout_Pitch 
NvBufferLayout_BlockLinear 

Definition at line 38 of file nvbuf_utils.h.

Enumerator
NvBufferMem_Read 
NvBufferMem_Write 
NvBufferMem_Read_Write 

Definition at line 44 of file nvbuf_utils.h.

Function Documentation

int NvBufferCreate ( int *  dmabuf_fd,
int  width,
int  height,
NvBufferLayout  layout,
NvBufferColorFormat  colorFormat 
)

Use this method to allocate HW buffer.

Parameters
[out]dmabuf_fdReturns dmabuf_fd of hardware buffer.
[in]widthHardware buffer width, in bytes.
[in]heightHardware buffer height, in bytes.
[in]layoutLayout of buffer.
[in]colorFormatThe colorFormat of buffer.
Returns
0 for success, -1 for failure
int NvBufferDestroy ( int  dmabuf_fd)

This method must be used for destroying hw_buffer.

Parameters
[in]dmabuf_fdSpecifies the dmabuf_fd hw_buffer to destroy.
Returns
0 for success, -1 for failure.
int NvBufferGetParams ( int  dmabuf_fd,
NvBufferParams params 
)

Use this method to get buffer parameters.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[out]paramsA pointer to the structure to fill with parameters.
Returns
0 for success, -1 for failure.
int NvBufferMemMap ( int  dmabuf_fd,
unsigned int  plane,
NvBufferMemFlags  memflag,
void **  pVirtAddr 
)

This method must be used for getting mem mapped virtual Address of the plane.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[in]planevideo frame plane.
[in]memflagNvBuffer memory flag.
[in]pVirtAddrVirtual Addres pointer of the mem mapped plane.
Returns
0 for success, -1 for failure.
int NvBufferMemSyncForCpu ( int  dmabuf_fd,
unsigned int  plane,
void **  pVirtAddr 
)

This method must be used for hw memory cache sync for the CPU.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[in]planevideo frame plane.
[in]pVirtAddrVirtual Addres pointer of the mem mapped plane.
Returns
0 for success, -1 for failure.
int NvBufferMemSyncForDevice ( int  dmabuf_fd,
unsigned int  plane,
void **  pVirtAddr 
)

This method must be used for hw memory cache sync for device.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[in]planevideo frame plane.
[in]pVirtAddrVirtual Addres pointer of the mem mapped plane.
Returns
0 for success, -1 for failure.
int NvBufferMemUnMap ( int  dmabuf_fd,
unsigned int  plane,
void **  pVirtAddr 
)

This method must be used to Unmap the mapped virtual Address of the plane.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[in]planevideo frame plane.
[in]pVirtAddrmem mapped Virtual Addres pointer of the plane.
Returns
0 for success, -1 for failure.
int NvDestroyEGLImage ( EGLDisplay  display,
EGLImageKHR  eglImage 
)

This method must be used for destroying EGLImage object.

Parameters
[in]displayEGLDisplay object used for destroying EGLImage.
[in]eglImageEGLImageKHR object to be destroyed.
Returns
0 for success, -1 for failure
EGLImageKHR NvEGLImageFromFd ( EGLDisplay  display,
int  dmabuf_fd 
)

This method must be used for getting EGLImage from dmabuf-fd.

Parameters
[in]displayEGLDisplay object used during the creation of EGLImage.
[in]dmabuf_fdDMABUF FD of buffer from which EGLImage to be created.
Returns
EGLImageKHR for success, NULL for failure