include/media/videobuf2-v4l2.h

Source file repositories/reference/linux-study-clean/include/media/videobuf2-v4l2.h

File Facts

System
Linux kernel
Corpus path
include/media/videobuf2-v4l2.h
Extension
.h
Size
14395 bytes
Lines
375
Domain
Repository Root And Misc
Bucket
include
Inferred role
Repository Root And Misc: implementation source
Status
source implementation candidate

Why This File Exists

Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.

Dependency Surface

Detected Declarations

Annotated Snippet

struct vb2_v4l2_buffer {
	struct vb2_buffer	vb2_buf;

	__u32			flags;
	__u32			field;
	struct v4l2_timecode	timecode;
	__u32			sequence;
	__s32			request_fd;
	bool			is_held;
	struct vb2_plane	planes[VB2_MAX_PLANES];
};

/* VB2 V4L2 flags as set in vb2_queue.subsystem_flags */
#define VB2_V4L2_FL_SUPPORTS_M2M_HOLD_CAPTURE_BUF (1 << 0)

/*
 * to_vb2_v4l2_buffer() - cast struct vb2_buffer * to struct vb2_v4l2_buffer *
 */
#define to_vb2_v4l2_buffer(vb) \
	container_of(vb, struct vb2_v4l2_buffer, vb2_buf)

/**
 * vb2_find_buffer() - Find a buffer with given timestamp
 *
 * @q:		pointer to &struct vb2_queue with videobuf2 queue.
 * @timestamp:	the timestamp to find.
 *
 * Returns the buffer with the given @timestamp, or NULL if not found.
 */
struct vb2_buffer *vb2_find_buffer(struct vb2_queue *q, u64 timestamp);

int vb2_querybuf(struct vb2_queue *q, struct v4l2_buffer *b);

/**
 * vb2_reqbufs() - Wrapper for vb2_core_reqbufs() that also verifies
 * the memory and type values.
 *
 * @q:		pointer to &struct vb2_queue with videobuf2 queue.
 * @req:	&struct v4l2_requestbuffers passed from userspace to
 *		&v4l2_ioctl_ops->vidioc_reqbufs handler in driver.
 */
int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req);

/**
 * vb2_create_bufs() - Wrapper for vb2_core_create_bufs() that also verifies
 * the memory and type values.
 *
 * @q:		pointer to &struct vb2_queue with videobuf2 queue.
 * @create:	creation parameters, passed from userspace to
 *		&v4l2_ioctl_ops->vidioc_create_bufs handler in driver
 */
int vb2_create_bufs(struct vb2_queue *q, struct v4l2_create_buffers *create);

/**
 * vb2_prepare_buf() - Pass ownership of a buffer from userspace to the kernel
 *
 * @q:		pointer to &struct vb2_queue with videobuf2 queue.
 * @mdev:	pointer to &struct media_device, may be NULL.
 * @b:		buffer structure passed from userspace to
 *		&v4l2_ioctl_ops->vidioc_prepare_buf handler in driver
 *
 * Should be called from &v4l2_ioctl_ops->vidioc_prepare_buf ioctl handler
 * of a driver.
 *
 * This function:
 *
 * #) verifies the passed buffer,
 * #) calls &vb2_ops->buf_prepare callback in the driver (if provided),
 *    in which driver-specific buffer initialization can be performed.
 * #) if @b->request_fd is non-zero and @mdev->ops->req_queue is set,
 *    then bind the prepared buffer to the request.
 *
 * The return values from this function are intended to be directly returned
 * from &v4l2_ioctl_ops->vidioc_prepare_buf handler in driver.
 */
int vb2_prepare_buf(struct vb2_queue *q, struct media_device *mdev,
		    struct v4l2_buffer *b);

/**
 * vb2_qbuf() - Queue a buffer from userspace
 * @q:		pointer to &struct vb2_queue with videobuf2 queue.
 * @mdev:	pointer to &struct media_device, may be NULL.
 * @b:		buffer structure passed from userspace to
 *		&v4l2_ioctl_ops->vidioc_qbuf handler in driver
 *
 * Should be called from &v4l2_ioctl_ops->vidioc_qbuf handler of a driver.
 *
 * This function:
 *
 * #) verifies the passed buffer;

Annotation

Implementation Notes