36 #ifndef __NV_BUFFER_H__
37 #define __NV_BUFFER_H__
39 #include <linux/videodev2.h>
157 NvBuffer(uint32_t pixfmt, uint32_t width, uint32_t height, uint32_t
index);
267 uint32_t width, uint32_t height, uint32_t raw_pixfmt);
270 pthread_mutex_t ref_lock;
int map()
Maps the contents of the buffer to memory.
uint32_t n_planes
Holds the number of planes in the buffer.
uint32_t mem_offset
Holds the offset of the first valid byte from the data pointer.
uint32_t bytesused
Holds the number of valid bytes in the plane.
NvBufferPlaneFormat fmt
Holds the format of the plane.
enum v4l2_buf_type buf_type
Type of the buffer.
static int fill_buffer_plane_format(uint32_t *num_planes, NvBuffer::NvBufferPlaneFormat *planefmts, uint32_t width, uint32_t height, uint32_t raw_pixfmt)
Fills the NvBuffer::NvBufferPlaneFormat array.
Defines a helper class for operations performed on a V4L2 Element plane.
void unmap()
Unmaps the contents of the buffer from memory.
Class representing a buffer.
NVIDIA V4L2 API Extensions
int ref()
Increases the reference count of the buffer.
#define MAX_PLANES
Specifies the maximum number of planes a buffer can contain.
unsigned char * data
Holds a pointer to the plane memory.
int fd
Holds the file descriptor (FD) of the plane of the exported buffer, in the case of V4L2 MMAP buffers...
int allocateMemory()
Allocates software memory for the buffer.
Holds the buffer plane parameters.
void deallocateMemory()
Deallocates buffer memory.
~NvBuffer()
Destroys an NvBuffer object.
enum v4l2_memory memory_type
Type of memory associated with the buffer.
const uint32_t index
Holds the buffer index.
NvBufferPlane planes[MAX_PLANES]
Holds the data pointer, plane file descriptor (FD), plane format, etc.
int unref()
Decreases the reference count of the buffer.
uint32_t length
Holds the size of the buffer in bytes.
NvBuffer(enum v4l2_buf_type buf_type, enum v4l2_memory memory_type, uint32_t n_planes, NvBufferPlaneFormat *fmt, uint32_t index)
Creates a new NvBuffer object.