|
Jetson Linux API Reference
|
32.7.5 Release
|
Go to the documentation of this file.
47 #ifndef __NV_V4L2_ELELMENT_PLANE_H__
48 #define __NV_V4L2_ELELMENT_PLANE_H__
59 #define PLANE_DEBUG_MSG(str) COMP_DEBUG_MSG(plane_name << ":" << str);
64 #define PLANE_INFO_MSG(str) COMP_INFO_MSG(plane_name << ":" << str);
69 #define PLANE_WARN_MSG(str) COMP_WARN_MSG(plane_name << ":" << str);
74 #define PLANE_ERROR_MSG(str) COMP_ERROR_MSG(plane_name << ":" << str);
79 #define PLANE_SYS_ERROR_MSG(str) COMP_SYS_ERROR_MSG(plane_name << ":" << str);
116 int getFormat(
struct v4l2_format & format);
125 int setFormat(
struct v4l2_format & format);
155 int getCrop(
struct v4l2_crop & crop);
167 int setSelection(uint32_t target, uint32_t flags,
struct v4l2_rect & rect);
179 int reqbufs(
enum v4l2_memory mem_type, uint32_t num);
252 int setupPlane(
enum v4l2_memory mem_type, uint32_t num_buffers,
bool map,
bool allocate);
302 NvBuffer ** shared_buffer, uint32_t num_retries);
360 return num_queued_buffers;
370 return total_dequeued_buffers;
380 return total_queued_buffers;
482 const char *plane_name;
484 enum v4l2_buf_type buf_type;
489 uint32_t num_buffers;
500 enum v4l2_memory memory_type;
502 uint32_t num_queued_buffers;
504 uint32_t total_queued_buffers;
506 uint32_t total_dequeued_buffers;
511 bool dqthread_running;
533 static void *dqThread(
void *v4l2_element_plane);
544 inline int isInError()
580 const char *comp_name;
Defines a helper class for V4L2 based components.
uint32_t getNumQueuedBuffers()
Gets the number of buffers currently queued on the plane.
int qBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer *shared_buffer)
Queues a buffer on the plane.
int setSelection(uint32_t target, uint32_t flags, struct v4l2_rect &rect)
Sets the selection rectangle for the plane.
void setBufferPlaneFormat(int n_planes, NvBuffer::NvBufferPlaneFormat *planefmts)
Sets the format of the planes of the buffer that is used with this plane.
NvBuffer * getNthBuffer(uint32_t n)
Gets the NvBuffer object at index n.
int waitForDQThread(uint32_t max_wait_ms)
Waits for the DQ Thread to stop.
int dqBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer **buffer, NvBuffer **shared_buffer, uint32_t num_retries)
Dequeues a buffer from the plane.
int stopDQThread()
Force stops the DQ Thread if it is running.
int setupPlane(enum v4l2_memory mem_type, uint32_t num_buffers, bool map, bool allocate)
Helper method that encapsulates all the method calls required to set up the plane for streaming.
int setStreamParms(struct v4l2_streamparm &parm)
Sets streaming parameters.
uint32_t getNumPlanes()
Gets the number of planes buffers on this plane for the currently set format.
pthread_cond_t plane_cond
Plane condition that application can wait on to receive notifications from qBuffer/dqBuffer.
int mapOutputBuffers(struct v4l2_buffer &v4l2_buf, int dmabuff_fd)
Maps the NvMMBuffer to NvBuffer for V4L2_MEMORY_DMABUF.
bool setDQThreadCallback(dqThreadCallback callback)
Sets the DQ Thread callback method.
int waitAllBuffersQueued(uint32_t max_wait_ms)
Waits until all buffers of the plane are queued.
int getFormat(struct v4l2_format &format)
Gets the plane format.
int startDQThread(void *data)
Starts DQ Thread.
enum v4l2_buf_type getBufType()
Gets the streaming/buffer type of this plane.
#define MAX_PLANES
Specifies the maximum number of planes a buffer can contain.
int exportBuffer(uint32_t buf_index)
Exports the buffer as DMABUF FD.
uint32_t getTotalQueuedBuffers()
Gets the total number of buffers queued on the plane.
int getCrop(struct v4l2_crop &crop)
Gets the cropping rectangle for the plane.
Description: This file defines macros for logging messages.
int waitAllBuffersDequeued(uint32_t max_wait_ms)
Waits until all buffers of the plane are dequeued.
int reqbufs(enum v4l2_memory mem_type, uint32_t num)
Requests for buffers on the plane.
bool getStreamStatus()
Checks whether the plane is streaming.
Defines a helper class for operations performed on a V4L2 Element plane.
int setFormat(struct v4l2_format &format)
Sets the plane format.
int queryBuffer(uint32_t buf_index)
Queries the status of the buffer at the index.
void deinitPlane()
Helper method that encapsulates all the method calls required to deinitialize the plane for streaming...
int setStreamStatus(bool status)
Starts or stops streaming on the plane.
uint32_t getNumBuffers()
Gets the number of buffers allocated/requested on the plane.
uint32_t getTotalDequeuedBuffers()
Gets the total number of buffers dequeued from the plane.
int unmapOutputBuffers(int index, int dmabuff_fd)
Unmaps the NvMMBuffer for V4L2_MEMORY_DMABUF.
Class representing a buffer.
pthread_mutex_t plane_lock
Mutex lock used along with plane_cond.
bool(* dqThreadCallback)(struct v4l2_buffer *v4l2_buf, NvBuffer *buffer, NvBuffer *shared_buffer, void *data)
This is a callback function type method that is called by the DQ Thread when it successfully dequeues...