STRUCT V4L2_CREATE_BUFFERS(9)
π struct v4l2_create_buffers(9) π
okay bestie, so this is a page straight outta the Kernel API Manual β it's the man page for struct v4l2_create_buffers(9), and it's literally the argument struct for VIDIOC_CREATE_BUFS. no cap, that's the whole NAME section. let's get into it π
β¨ SYNOPSIS β¨
like, here's the shape of it, exactly as it lives in the kernel:
struct v4l2_create_buffers {
__u32 index;
__u32 count;
__u32 memory;
struct v4l2_format format;
__u32 capabilities;
__u32 flags;
__u32 max_num_buffers;
__u32 reserved[5];
};
look at her. so structured. so organized. main character struct energy fr fr π
πΈ Members πΈ
indexβ on return, this is the index of the first created buffer π so like, the kernel hands it back to you after the call.countβ entry: the number of buffers you're requesting π that's you telling the kernel how many you want, going in.memoryβ enumv4l2_memory; this is the buffer memory type. pick your vibe.formatβ the frame format that the buffers are being requested for β¨ it's giving "what are these buffers even for."capabilitiesβ the capabilities of this buffer type. iykyk.flagsβ extra buffer management attributes π¦ but lowkey ignored unless the queue has theV4L2_BUF_CAP_SUPPORTS_MMAP_CACHE_HINTScapability and is configured for MMAP streaming I/O. so don't just assume they do something, bestie.max_num_buffersβ if theV4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERScapability flag is set, this field indicates the maximum possible number of buffers for this queue π₯ otherwise it's just sitting there.reservedβ future extensions π§ like, reserved for the kernel girlies of tomorrow. don't touch.
heads up:reserved[5]is literally an array of five. it'sreserved, plural, and it's for future extensions. respect her space π
β Return β
the return value is the number of created buffers β that's it, that's the number. slay.
π¦ SEE ALSO π¦
kernel file ./include/uapi/linux/videodev2.h, plus the whole friend group:
struct v4l2_capability(9)struct v4l2_plane(9)struct v4l2_buffer(9)v4l2_timeval_to_ns(9)struct v4l2_exportbuffer(9)struct v4l2_selection(9)struct v4l2_plane_pix_format(9)struct v4l2_pix_format_mplane(9)struct v4l2_sdr_format(9)struct v4l2_meta_format(9)struct v4l2_format(9)struct v4l2_event_motion_det(9)struct v4l2_remove_buffers(9)
and that's the page, bestie!! π this one shipped out of ./include/uapi/linux, dated October 2026, and it's literally filed under struct v4l2_create_buffers(9) β go create some buffers, you've got this π«Άβ¨π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms