|
Jetson Linux API Reference
|
35.3.1 Release
|
Go to the documentation of this file.
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;
uint32_t mem_offset
Holds the offset of the first valid byte from the data pointer.
const uint32_t index
Holds the buffer index.
unsigned char * data
Holds a pointer to the plane memory.
Holds the buffer plane parameters.
NvBufferPlaneFormat fmt
Holds the format of the plane.
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.
void deallocateMemory()
Deallocates buffer memory.
#define MAX_PLANES
Specifies the maximum number of planes a buffer can contain.
int allocateMemory()
Allocates software memory for the buffer.
~NvBuffer()
Destroys an NvBuffer object.
void unmap()
Unmaps the contents of the buffer from memory.
uint32_t n_planes
Holds the number of planes in the buffer.
enum v4l2_buf_type buf_type
Type of the buffer.
int fd
Holds the file descriptor (FD) of the plane of the exported buffer, in the case of V4L2 MMAP buffers.
NvBufferPlane planes[MAX_PLANES]
Holds the data pointer, plane file descriptor (FD), plane format, etc.
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.
Defines a helper class for operations performed on a V4L2 Element plane.
int ref()
Increases the reference count of the buffer.
enum v4l2_memory memory_type
Type of memory associated with the buffer.
uint32_t length
Holds the size of the buffer in bytes.
int map()
Maps the contents of the buffer to memory.
Class representing a buffer.
int unref()
Decreases the reference count of the buffer.
uint32_t bytesused
Holds the number of valid bytes in the plane.