L4T Multimedia API Reference32.1 Release |
NVIDIA buffering utility library for use by applications.
The utility also transforms, composits, and blends.
Data Structures | |
struct | NvBufferCompositeBackground |
Holds composition background r,g,b colors. More... | |
struct | NvBufferRect |
Holds coordinates for a rectangle. More... | |
struct | _NvBufferCreateParams |
Holds the input parameters for hardware buffer creation. More... | |
struct | _NvBufferParams |
Holds parameters for a hardware buffer. More... | |
struct | _NvBufferCompositeParams |
Holds parameters related to compositing/blending. More... | |
struct | _NvBufferTransformParams |
Holds parameters for buffer transform functions. More... | |
Macros | |
#define | MAX_NUM_PLANES 3 |
Defines the maximum number of planes for video frame. More... | |
#define | MAX_COMPOSITE_FRAME 16 |
Defines the maximum number of input video frames that can be used for composition. More... | |
Typedefs | |
typedef struct _NvBufferSession * | NvBufferSession |
Holds an opaque NvBuffer session type required for parallel buffer tranformations and compositions. More... | |
typedef struct _NvBufferCreateParams | NvBufferCreateParams |
Holds the input parameters for hardware buffer creation. More... | |
typedef struct _NvBufferParams | NvBufferParams |
Holds parameters for a hardware buffer. More... | |
typedef struct _NvBufferCompositeParams | NvBufferCompositeParams |
Holds parameters related to compositing/blending. More... | |
typedef struct _NvBufferTransformParams | NvBufferTransformParams |
Holds parameters for buffer transform functions. More... | |
Functions | |
int | NvBufferGetSize (void) |
This method can be used to get HW Buffer struct size. More... | |
EGLImageKHR | NvEGLImageFromFd (EGLDisplay display, int dmabuf_fd) |
Creates an EGLImage instance from dmabuf-fd . More... | |
int | NvDestroyEGLImage (EGLDisplay display, EGLImageKHR eglImage) |
Destroys an EGLImage object. More... | |
int | NvBufferCreate (int *dmabuf_fd, int width, int height, NvBufferLayout layout, NvBufferColorFormat colorFormat) |
Allocates a HW buffer (deprecated). More... | |
int | NvBufferCreateEx (int *dmabuf_fd, NvBufferCreateParams *input_params) |
Allocates a HW buffer. More... | |
int | NvBufferGetParams (int dmabuf_fd, NvBufferParams *params) |
Gets buffer parameters. More... | |
int | NvBufferDestroy (int dmabuf_fd) |
Destroys a HW buffer. More... | |
int | ExtractFdFromNvBuffer (void *nvbuf, int *dmabuf_fd) |
Extracts the dmabuf_fd from the hardware buffer. More... | |
int | NvReleaseFd (int dmabuf_fd) |
Releases the dmabuf_fd buffer. More... | |
int | NvBufferMemSyncForCpu (int dmabuf_fd, unsigned int plane, void **pVirtAddr) |
Syncs the HW memory cache for the CPU. More... | |
int | NvBufferMemSyncForDevice (int dmabuf_fd, unsigned int plane, void **pVirtAddr) |
Syncs the HW memory cache sync for the device. More... | |
int | NvBufferMemMap (int dmabuf_fd, unsigned int plane, NvBufferMemFlags memflag, void **pVirtAddr) |
Gets the memory-mapped virtual address of the plane. More... | |
int | NvBufferMemUnMap (int dmabuf_fd, unsigned int plane, void **pVirtAddr) |
Unmaps 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) |
Copies the NvBuffer plane contents to a raw buffer plane. More... | |
int | Raw2NvBuffer (unsigned char *ptr, unsigned int plane, unsigned int in_width, unsigned int in_height, int dmabuf_fd) |
Copies raw buffer plane contents to an NvBuffer plane. More... | |
NvBufferSession | NvBufferSessionCreate (void) |
Creates a new NvBufferSession for parallel scheduling of buffer transformations and compositions. More... | |
void | NvBufferSessionDestroy (NvBufferSession session) |
Destroys an exisiting NvBufferSession. More... | |
int | NvBufferTransform (int src_dmabuf_fd, int dst_dmabuf_fd, NvBufferTransformParams *transform_params) |
Transforms one DMA buffer to another DMA buffer. More... | |
int | NvBufferComposite (int *src_dmabuf_fds, int dst_dmabuf_fd, NvBufferCompositeParams *composite_params) |
Composites multiple input DMA buffers to one output DMA buffer. More... | |
#define MAX_COMPOSITE_FRAME 16 |
Defines the maximum number of input video frames that can be used for composition.
Definition at line 45 of file nvbuf_utils.h.
#define MAX_NUM_PLANES 3 |
Defines the maximum number of planes for video frame.
Definition at line 40 of file nvbuf_utils.h.
typedef struct _NvBufferCompositeParams NvBufferCompositeParams |
Holds parameters related to compositing/blending.
typedef struct _NvBufferCreateParams NvBufferCreateParams |
Holds the input parameters for hardware buffer creation.
typedef struct _NvBufferParams NvBufferParams |
Holds parameters for a hardware buffer.
typedef struct _NvBufferSession* NvBufferSession |
Holds an opaque NvBuffer session type required for parallel buffer tranformations and compositions.
Operations using a single session are scheduled sequentially, after the previous operation finishes. Operations for multiple sessions are scheduled in parallel.
Definition at line 272 of file nvbuf_utils.h.
typedef struct _NvBufferTransformParams NvBufferTransformParams |
Holds parameters for buffer transform functions.
enum NvBufferColorFormat |
Defines color formats for NvBuffer.
Definition at line 104 of file nvbuf_utils.h.
Defines flags that specify valid composition/blending operations.
Enumerator | |
---|---|
NVBUFFER_COMPOSITE |
flag to set for composition. |
NVBUFFER_BLEND |
flag to set for blending. |
Definition at line 231 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 types 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 198 of file nvbuf_utils.h.
Defines flags to indicate for valid transform.
Definition at line 217 of file nvbuf_utils.h.
Defines video flip methods.
Definition at line 175 of file nvbuf_utils.h.
int ExtractFdFromNvBuffer | ( | void * | nvbuf, |
int * | dmabuf_fd | ||
) |
Extracts the dmabuf_fd
from 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 | ||
) |
Copies the NvBuffer plane contents to a 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 | ||
) |
Composites multiple input DMA buffers to one output DMA buffer.
This function 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 | ||
) |
Allocates a HW buffer (deprecated).
[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 | ||
) |
Allocates a 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 | ) |
Destroys a HW buffer.
[in] | dmabuf_fd | Specifies the dmabuf_fd hw_buffer to destroy. |
int NvBufferGetParams | ( | int | dmabuf_fd, |
NvBufferParams * | params | ||
) |
Gets buffer parameters.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[out] | params | A pointer to the structure to fill with parameters. |
int NvBufferGetSize | ( | void | ) |
This method can be used to get HW Buffer struct size.
int NvBufferMemMap | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
NvBufferMemFlags | memflag, | ||
void ** | pVirtAddr | ||
) |
Gets the memory-mapped virtual address of the plane.
The client must call NvBufferMemSyncForCpu() with the virtual address returned by this function before accessing the mapped memory in CPU.
After memory mapping is complete, mapped memory modification must be coordinated between the CPU and hardware device as follows:
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane.(Applies to NvBufferPayload_SurfArray.) |
[in] | memflag | NvBuffer memory flag. |
[out] | pVirtAddr | Virtual Address pointer of the memory-mapped plane. |
int NvBufferMemSyncForCpu | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
Syncs the HW memory cache for the CPU.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane. |
[in] | pVirtAddr | Virtual Address pointer of the memory-mapped plane. |
int NvBufferMemSyncForDevice | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
Syncs the HW memory cache sync for the device.
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane. |
[in] | pVirtAddr | Virtual Address pointer of the memory-mapped plane. |
int NvBufferMemUnMap | ( | int | dmabuf_fd, |
unsigned int | plane, | ||
void ** | pVirtAddr | ||
) |
Unmaps the mapped virtual address of the plane.
If the following conditions are both true, the client must call NvBufferMemSyncForDevice() before unmapping the memory:
[in] | dmabuf_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane.(Applies to NvBufferPayload_SurfArray.) |
[in] | pVirtAddr | Memory-mapped Virtual Address pointer of the plane. |
NvBufferSession NvBufferSessionCreate | ( | void | ) |
Creates a new NvBufferSession for parallel scheduling of buffer transformations and compositions.
void NvBufferSessionDestroy | ( | NvBufferSession | session | ) |
Destroys an exisiting NvBufferSession.
[in] | session | An existing NvBufferSession. |
int NvBufferTransform | ( | int | src_dmabuf_fd, |
int | dst_dmabuf_fd, | ||
NvBufferTransformParams * | transform_params | ||
) |
Transforms one DMA buffer to another DMA buffer.
This function can support transforms for copying, scaling, fliping, rotating, 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 | ||
) |
Destroys an EGLImage
object.
[in] | display | EGLDisplay object used to destroy EGLImage . If NULL, the nvbuf_utils API uses its own EGLDisplay instance. |
[in] | eglImage | EGLImageKHR object to be destroyed. |
EGLImageKHR NvEGLImageFromFd | ( | EGLDisplay | display, |
int | dmabuf_fd | ||
) |
Creates an EGLImage
instance from dmabuf-fd
.
[in] | display | EGLDisplay object used during the creation of EGLImage . If NULL, the nvbuf_utils API uses its own EGLDisplay instance. |
[in] | dmabuf_fd | DMABUF FD of buffer from which EGLImage to be created. |
EGLImageKHR
for success, NULL
for failure int NvReleaseFd | ( | int | dmabuf_fd | ) |
Releases the dmabuf_fd
buffer.
[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 | ||
) |
Copies raw buffer plane contents to an 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. |