L4T Multimedia API Reference28.2 Release |
NVIDIA buffering utility library for use by applications.
The utility also transform, composits, and blends.
Data Structures | |
struct | NvBufferCompositeBackground |
Defines composition background r,g,b colors. More... | |
struct | NvBufferRect |
Defines coordinates for rectangle. More... | |
struct | _NvBufferCreateParams |
Defines input parameters for hardware buffer creation. More... | |
struct | _NvBufferParams |
Defines parameters related to hardware buffer. More... | |
struct | _NvBufferCompositeParams |
Defines parameters related to composition/blending. More... | |
struct | _NvBufferTransformParams |
Defines parameters related to transform. More... | |
Macros | |
#define | MAX_NUM_PLANES 3 |
Defines maximum number of planes for video frame. More... | |
#define | MAX_COMPOSITE_FRAME 16 |
Defines maximum number of input video frames can be used for composition. More... | |
Typedefs | |
typedef struct _NvBufferCreateParams | NvBufferCreateParams |
Defines input parameters for hardware buffer creation. More... | |
typedef struct _NvBufferParams | NvBufferParams |
Defines parameters related to hardware buffer. More... | |
typedef struct _NvBufferCompositeParams | NvBufferCompositeParams |
Defines parameters related to composition/blending. More... | |
typedef struct _NvBufferTransformParams | NvBufferTransformParams |
Defines parameters related to transform. More... | |
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 (Deprecated, instead use NvBufferCreateEx API). More... | |
int | NvBufferCreateEx (int *dmabuf_fd, NvBufferCreateParams *input_params) |
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 | ExtractFdFromNvBuffer (void *nvbuf, int *dmabuf_fd) |
This method must be used to extract dmabuf_fd of the hardware buffer. More... | |
int | NvReleaseFd (int dmabuf_fd) |
This method must be used for releasing dmabuf_fd. 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... | |
int | NvBuffer2Raw (int dmabuf_fd, unsigned int plane, unsigned int out_width, unsigned int out_height, unsigned char *ptr) |
This method is used to copy NvBuffer plane contents to raw buffer plane. More... | |
int | Raw2NvBuffer (unsigned char *ptr, unsigned int plane, unsigned int in_width, unsigned int in_height, int dmabuf_fd) |
This method is used to copy raw buffer plane contents to NvBuffer plane. More... | |
int | NvBufferTransform (int src_dmabuf_fd, int dst_dmabuf_fd, NvBufferTransformParams *transform_params) |
This method is used to transform one DMA buffer to another DMA buffer. More... | |
int | NvBufferComposite (int *src_dmabuf_fds, int dst_dmabuf_fd, NvBufferCompositeParams *composite_params) |
This method is used to composite multiple input DMA buffers to one output DMA buffer. More... | |
#define MAX_COMPOSITE_FRAME 16 |
Defines maximum number of input video frames can be used for composition.
Definition at line 45 of file nvbuf_utils.h.
#define MAX_NUM_PLANES 3 |
Defines maximum number of planes for video frame.
Definition at line 40 of file nvbuf_utils.h.
typedef struct _NvBufferCompositeParams NvBufferCompositeParams |
Defines parameters related to composition/blending.
typedef struct _NvBufferCreateParams NvBufferCreateParams |
Defines input parameters for hardware buffer creation.
typedef struct _NvBufferParams NvBufferParams |
Defines parameters related to hardware buffer.
typedef struct _NvBufferTransformParams NvBufferTransformParams |
Defines parameters related to transform.
enum NvBufferColorFormat |
Defines color formats for NvBuffer.
Definition at line 104 of file nvbuf_utils.h.
Defines flags to indicate for valid composition/blending operation.
Enumerator | |
---|---|
NVBUFFER_COMPOSITE |
flag to set for composition. |
NVBUFFER_BLEND |
flag to set for blending. |
Definition at line 191 of file nvbuf_utils.h.
enum NvBufferLayout |
Defines Layout formats for NvBuffer video planes.
Enumerator | |
---|---|
NvBufferLayout_Pitch |
Pitch Layout. |
NvBufferLayout_BlockLinear |
BlockLinear Layout. |
Definition at line 61 of file nvbuf_utils.h.
enum NvBufferMemFlags |
Defines memory access flags for NvBuffer.
Enumerator | |
---|---|
NvBufferMem_Read |
Memory read. |
NvBufferMem_Write |
Memory write. |
NvBufferMem_Read_Write |
Memory read & write. |
Definition at line 72 of file nvbuf_utils.h.
enum NvBufferPayloadType |
Defines Payload type for NvBuffer.
Enumerator | |
---|---|
NvBufferPayload_SurfArray |
buffer payload with HW memory handle for set of planes. |
NvBufferPayload_MemHandle |
buffer payload with HW memory handle for specific memory size. |
Definition at line 50 of file nvbuf_utils.h.
enum NvBufferTag |
Defines tags to associate, while allocation of NvBuffer.
Definition at line 85 of file nvbuf_utils.h.
Defines transform video filter types.
Definition at line 158 of file nvbuf_utils.h.
Defines flags to indicate for valid transform.
Definition at line 177 of file nvbuf_utils.h.
Defines video flip methods.
Definition at line 135 of file nvbuf_utils.h.
int ExtractFdFromNvBuffer | ( | void * | nvbuf, |
int * | dmabuf_fd | ||
) |
This method must be used to extract dmabuf_fd of the hardware buffer.
[in] | nvbuf | Specifies the hw_buffer . |
[out] | dmabuf_fd | Returns DMABUF FD of hw_buffer . |
int NvBuffer2Raw | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
unsigned int | out_width, | ||
unsigned int | out_height, | ||
unsigned char * | ptr | ||
) |
This method is used to copy NvBuffer plane contents to raw buffer plane.
[in] | dmabuf_fd | DMABUF FD of NvBuffer. |
[in] | plane | video frame plane. |
[in] | out_width | aligned width of the raw data plane. |
[in] | out_height | aligned height of the raw data plane. |
[in] | ptr | pointer to the output raw plane data. |
int NvBufferComposite | ( | int * | src_dmabuf_fds, |
int | dst_dmabuf_fd, | ||
NvBufferCompositeParams * | composite_params | ||
) |
This method is used to composite multiple input DMA buffers to one output DMA buffer.
It can support composition of multiple input frames to one composited output.
[in] | src_dmabuf_fds | array of DMABUF FDs of source buffers to composite from |
[in] | dst_dmabuf_fd | DMABUF FD of destination buffer for composition |
[in] | composite_params | composition parameters |
int NvBufferCreate | ( | int * | dmabuf_fd, |
int | width, | ||
int | height, | ||
NvBufferLayout | layout, | ||
NvBufferColorFormat | colorFormat | ||
) |
Use this method to allocate HW buffer (Deprecated, instead use NvBufferCreateEx API).
[out] | dmabuf_fd | Returns dmabuf_fd of hardware buffer. |
[in] | width | Hardware buffer width, in bytes. |
[in] | height | Hardware buffer height, in bytes. |
[in] | layout | Layout of buffer. |
[in] | colorFormat | The colorFormat of buffer. |
int NvBufferCreateEx | ( | int * | dmabuf_fd, |
NvBufferCreateParams * | input_params | ||
) |
Use this method to allocate HW buffer.
[out] | dmabuf_fd | Returns dmabuf_fd of hardware buffer. |
[in] | input_params | Input parameters for hardware buffer creation. |
int NvBufferDestroy | ( | int | dmabuf_fd | ) |
This method must be used for destroying hw_buffer
.
[in] | dmabuf_fd | Specifies the dmabuf_fd hw_buffer to destroy. |
int NvBufferGetParams | ( | int | dmabuf_fd, |
NvBufferParams * | params | ||
) |
Use this method to get buffer parameters.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[out] | params | A pointer to the structure to fill with parameters. |
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.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane.(Applicale for NvBufferPayload_SurfArray) |
[in] | memflag | NvBuffer memory flag. |
[in] | pVirtAddr | Virtual Addres pointer of the mem mapped plane. |
int NvBufferMemSyncForCpu | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
This method must be used for hw memory cache sync for the CPU.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane. |
[in] | pVirtAddr | Virtual Addres pointer of the mem mapped plane. |
int NvBufferMemSyncForDevice | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
This method must be used for hw memory cache sync for device.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane. |
[in] | pVirtAddr | Virtual Addres pointer of the mem mapped plane. |
int NvBufferMemUnMap | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
This method must be used to Unmap the mapped virtual Address of the plane.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane.(Applicale for NvBufferPayload_SurfArray) |
[in] | pVirtAddr | mem mapped Virtual Addres pointer of the plane. |
int NvBufferTransform | ( | int | src_dmabuf_fd, |
int | dst_dmabuf_fd, | ||
NvBufferTransformParams * | transform_params | ||
) |
This method is used to transform one DMA buffer to another DMA buffer.
It can support transforms for copying, scaling, fliping, rotation and cropping.
[in] | src_dmabuf_fd | DMABUF FD of source buffer |
[in] | dst_dmabuf_fd | DMABUF FD of destination buffer |
[in] | transform_params | transform parameters |
int NvDestroyEGLImage | ( | EGLDisplay | display, |
EGLImageKHR | eglImage | ||
) |
This method must be used for destroying EGLImage
object.
[in] | display | EGLDisplay object used for destroying EGLImage . |
[in] | eglImage | EGLImageKHR object to be destroyed. |
EGLImageKHR NvEGLImageFromFd | ( | EGLDisplay | display, |
int | dmabuf_fd | ||
) |
This method must be used for getting EGLImage
from dmabuf-fd
.
[in] | display | EGLDisplay object used during the creation of EGLImage . |
[in] | dmabuf_fd | DMABUF FD of buffer from which EGLImage to be created. |
EGLImageKHR
for success, NULL
for failure int NvReleaseFd | ( | int | dmabuf_fd | ) |
This method must be used for releasing dmabuf_fd.
Obtained using ExtractfdFromNvBuffer API.
[in] | dmabuf_fd | Specifies the dmabuf_fd to release. |
int Raw2NvBuffer | ( | unsigned char * | ptr, |
unsigned int | plane, | ||
unsigned int | in_width, | ||
unsigned int | in_height, | ||
int | dmabuf_fd | ||
) |
This method is used to copy raw buffer plane contents to NvBuffer plane.
[in] | ptr | pointer to the input raw plane data. |
[in] | plane | video frame plane. |
[in] | in_width | aligned width of the raw data plane. |
[in] | in_height | aligned height of the raw data plane. |
[in] | dmabuf_fd | DMABUF FD of NvBuffer. |