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