struct vb2_queue — a videobuf queue
struct vb2_queue { enum v4l2_buf_type type; unsigned int io_modes; unsigned fileio_read_once:1; unsigned fileio_write_immediately:1; unsigned allow_zero_bytesused:1; struct mutex * lock; struct v4l2_fh * owner; const struct vb2_ops * ops; const struct vb2_mem_ops * mem_ops; void * drv_priv; unsigned int buf_struct_size; u32 timestamp_flags; gfp_t gfp_flags; u32 min_buffers_needed; };
queue type (see V4L2_BUF_TYPE_* in linux/videodev2.h
supported io methods (see vb2_io_modes enum)
report EOF after reading the first buffer
queue buffer after each write
call
allow bytesused == 0 to be passed to the driver
pointer to a mutex that protects the vb2_queue struct. The driver can set this to a mutex to let the v4l2 core serialize the queuing ioctls. If the driver wants to handle locking itself, then this should be set to NULL. This lock is not used by the videobuf2 core API.
The filehandle that 'owns' the buffers, i.e. the filehandle that called reqbufs, create_buffers or started fileio. This field is not used by the videobuf2 core API, but it allows drivers to easily associate an owner filehandle with the queue.
driver-specific callbacks
memory allocator specific callbacks
driver private data
size of the driver-specific buffer structure; “0” indicates the driver doesn't want to use a custom buffer structure type, so sizeof(struct vb2_buffer) will is used
Timestamp flags; V4L2_BUF_FLAG_TIMESTAMP_* and V4L2_BUF_FLAG_TSTAMP_SRC_*
additional gfp flags used when allocating the buffers. Typically this is 0, but it may be e.g. GFP_DMA or __GFP_DMA32 to force the buffer allocation to a specific memory zone.
the minimum number of buffers needed before
start_streaming
can be called. Used when a DMA engine
cannot be started unless at least this number of buffers
have been queued into the driver.