25 #ifndef _NVBUF_UTILS_H_
26 #define _NVBUF_UTILS_H_
34 #include <EGL/eglext.h>
40 #define MAX_NUM_PLANES 3
45 #define MAX_COMPOSITE_FRAME 16
445 int NvBuffer2Raw (
int dmabuf_fd,
unsigned int plane,
unsigned int out_width,
unsigned int out_height,
unsigned char *ptr);
457 int Raw2NvBuffer (
unsigned char *ptr,
unsigned int plane,
unsigned int in_width,
unsigned int in_height,
int dmabuf_fd);
uint32_t layout[MAX_NUM_PLANES]
layout type of each planes of hardware buffer.
uint32_t num_planes
number of planes of hardware buffer.
int ExtractFdFromNvBuffer(void *nvbuf, int *dmabuf_fd)
This method must be used to extract dmabuf_fd of the hardware buffer.
Y/CbCr 4:2:0 multi-planar.
uint32_t left
rectangle left.
NvBufferRect src_comp_rect[MAX_COMPOSITE_FRAME]
source rectangle coordinates of input buffers for composition.
tag for H264/H265/VP9 Video Decoder.
transform flag to set flip method.
float g
background color value for g.
uint32_t psize[MAX_NUM_PLANES]
size of each vodeo planes of hardware buffer.
transform flag to set filter type.
int NvReleaseFd(int dmabuf_fd)
This method must be used for releasing dmabuf_fd.
flag to set for composition.
transform flag to crop source rectangle.
Video flip rotate 270 degree clockwise.
Video flip with respect to Y-axis.
uint32_t input_buf_count
number of the input buffers to be composited.
tag for Video Transform/Composite.
int32_t memsize
size of the memory.
Video flip inverse transpode.
NvBufferRect dst_comp_rect[MAX_COMPOSITE_FRAME]
destination rectangle coordinates of input buffers for composition.
int32_t width
width of the buffer.
Video flip rotate 180 degree clockwise.
Defines composition background r,g,b colors.
int NvBufferMemUnMap(int dmabuf_fd, unsigned int plane, void **pVirtAddr)
This method must be used to Unmap the mapped virtual Address of the plane.
Y/CbCr 4:2:0 multi-planar.
struct _NvBufferCreateParams NvBufferCreateParams
Defines input parameters for hardware buffer creation.
transform filter bilinear.
buffer payload with HW memory handle for specific memory size.
Defines parameters related to hardware buffer.
uint32_t nv_buffer_size
size of hardware 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.
transform filter nearest.
uint32_t composite_flag
flag to indicate which of the composition/blending parameters are valid.
uint32_t height
rectangle height.
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.
NvBufferTransform_Flag
Defines flags to indicate for valid transform.
uint32_t pixel_format
video format type of hardware buffer.
int NvBufferMemSyncForCpu(int dmabuf_fd, unsigned int plane, void **pVirtAddr)
This method must be used for hw memory cache sync for the CPU.
NvBufferComposite_Flag
Defines flags to indicate for valid composition/blending operation.
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.
uint32_t width
rectangle width.
NvBufferTag
Defines tags to associate, while allocation of NvBuffer.
float b
background color value for b.
#define MAX_NUM_PLANES
Defines maximum number of planes for video frame.
NvBufferColorFormat colorFormat
colorformat of the buffer.
struct _NvBufferCompositeParams NvBufferCompositeParams
Defines parameters related to composition/blending.
NvBufferCompositeBackground composite_bgcolor
background color values for composition.
float dst_comp_rect_alpha[MAX_COMPOSITE_FRAME]
alpha values of input buffers for the blending.
NvBufferPayloadType payloadType
payload type of the buffer.
uint32_t height[MAX_NUM_PLANES]
height of each planes of hardware buffer.
tag for Jpeg Encoder/Decoder.
struct _NvBufferParams NvBufferParams
Defines parameters related to hardware buffer.
int NvBufferMemSyncForDevice(int dmabuf_fd, unsigned int plane, void **pVirtAddr)
This method must be used for hw memory cache sync for device.
uint32_t width[MAX_NUM_PLANES]
width of each planes of hardware buffer.
uint32_t pitch[MAX_NUM_PLANES]
pitch of each planes of hardware buffer.
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).
EGLImageKHR NvEGLImageFromFd(EGLDisplay display, int dmabuf_fd)
This method must be used for getting EGLImage from dmabuf-fd.
uint32_t dmabuf_fd
dmabuf_fd of hardware buffer.
uint32_t offset[MAX_NUM_PLANES]
memory offset values of each video planes of hardware buffer.
buffer payload with HW memory handle for set of planes.
uint32_t top
rectangle top.
int32_t memsize
size of the memory.
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.
Video flip with respect to X-axis.
void * nv_buffer
pointer to hardware buffer memory.
Defines input parameters for hardware buffer creation.
int NvBufferGetParams(int dmabuf_fd, NvBufferParams *params)
Use this method to get buffer parameters.
NvBufferPayloadType
Defines Payload type for NvBuffer.
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.
int32_t height
height of the buffer.
NvBufferTransform_Filter
Defines transform video filter types.
NvBufferLayout layout
layout of the buffer.
NvBufferTag nvbuf_tag
tag to associate with the buffer.
float r
background color value for r.
struct _NvBufferTransformParams NvBufferTransformParams
Defines parameters related to transform.
transform flag to crop destination rectangle.
NvBufferPayloadType payloadType
payload type of the buffer.
NvBufferTransform_Flip
Defines video flip methods.
NvBufferLayout
Defines Layout formats for NvBuffer video planes.
tag for H264/H265 Video Encoder.
int NvBufferDestroy(int dmabuf_fd)
This method must be used for destroying hw_buffer.
int NvBufferCreateEx(int *dmabuf_fd, NvBufferCreateParams *input_params)
Use this method to allocate HW buffer.
Defines coordinates for rectangle.
NvBufferColorFormat
Defines color formats for NvBuffer.
Defines parameters related to composition/blending.
Video flip rotate 90 degree clockwise.
int NvDestroyEGLImage(EGLDisplay display, EGLImageKHR eglImage)
This method must be used for destroying EGLImage object.
flag to set for blending.
NvBufferMemFlags
Defines memory access flags for NvBuffer.
#define MAX_COMPOSITE_FRAME
Defines maximum number of input video frames can be used for composition.