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.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/videodev2.hmedia/videobuf2-core.h
Detected Declarations
struct video_devicestruct vb2_v4l2_bufferstruct media_requestfunction vb2_queue_is_busy
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
- Immediate include surface: `linux/videodev2.h`, `media/videobuf2-core.h`.
- Detected declarations: `struct video_device`, `struct vb2_v4l2_buffer`, `struct media_request`, `function vb2_queue_is_busy`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.