|
Jetson Linux API Reference
|
32.7.6 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;
int queryBuffer(uint32_t buf_index)
Queries the status of the buffer at the index.
uint32_t getNumQueuedBuffers()
Gets the number of buffers currently queued on the plane.
int waitForDQThread(uint32_t max_wait_ms)
Waits for the DQ Thread to stop.
int setStreamStatus(bool status)
Starts or stops streaming on the plane.
int getFormat(struct v4l2_format &format)
Gets the plane format.
int startDQThread(void *data)
Starts DQ Thread.
Class representing a buffer.
void deinitPlane()
Helper method that encapsulates all the method calls required to deinitialize the plane for streaming...
pthread_cond_t plane_cond
Plane condition that application can wait on to receive notifications from qBuffer/dqBuffer.
int stopDQThread()
Force stops the DQ Thread if it is running.
bool getStreamStatus()
Checks whether the plane is streaming.
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...
int setFormat(struct v4l2_format &format)
Sets the plane format.
int exportBuffer(uint32_t buf_index)
Exports the buffer as DMABUF FD.
uint32_t getNumPlanes()
Gets the number of planes buffers on this plane for the currently set format.
int qBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer *shared_buffer)
Queues a buffer on the plane.
int dqBuffer(struct v4l2_buffer &v4l2_buf, NvBuffer **buffer, NvBuffer **shared_buffer, uint32_t num_retries)
Dequeues a buffer from the plane.
uint32_t getNumBuffers()
Gets the number of buffers allocated/requested on 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.
uint32_t getTotalQueuedBuffers()
Gets the total number of buffers queued on the plane.
int reqbufs(enum v4l2_memory mem_type, uint32_t num)
Requests for buffers on the plane.
int waitAllBuffersDequeued(uint32_t max_wait_ms)
Waits until all buffers of the plane are dequeued.
pthread_mutex_t plane_lock
Mutex lock used along with plane_cond.
int waitAllBuffersQueued(uint32_t max_wait_ms)
Waits until all buffers of the plane are queued.
bool setDQThreadCallback(dqThreadCallback callback)
Sets the DQ Thread callback method.
enum v4l2_buf_type getBufType()
Gets the streaming/buffer type of this plane.
uint32_t getTotalDequeuedBuffers()
Gets the total number of buffers dequeued from the plane.
Defines a helper class for V4L2 based components.
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 getCrop(struct v4l2_crop &crop)
Gets the cropping rectangle for the plane.
NvBuffer * getNthBuffer(uint32_t n)
Gets the NvBuffer object at index n.
Defines a helper class for operations performed on a V4L2 Element plane.
int setStreamParms(struct v4l2_streamparm &parm)
Sets streaming parameters.
Description: This file defines macros for logging messages.
int setSelection(uint32_t target, uint32_t flags, struct v4l2_rect &rect)
Sets the selection rectangle for the plane.
#define MAX_PLANES
Specifies the maximum number of planes a buffer can contain.
Holds the buffer plane format.
int unmapOutputBuffers(int index, int dmabuff_fd)
Unmaps the NvMMBuffer for V4L2_MEMORY_DMABUF.
int mapOutputBuffers(struct v4l2_buffer &v4l2_buf, int dmabuff_fd)
Maps the NvMMBuffer to NvBuffer for V4L2_MEMORY_DMABUF.