STRUCT V4L2_PLANE(9)
π struct v4l2_plane β plane info for multi-planar buffers
okay bestie, welcome to the Kernel API Manual β¨ this one's short but it's important, so pay attention π«Ά It's literally the struct that holds the deets for one single plane inside a multi-planar buffer. no cap.
πΈ SYNOPSIS πΈ
struct v4l2_plane {
__u32 bytesused;
__u32 length;
union {
__u32 mem_offset;
unsigned long userptr;
__s32 fd;
} m;
__u32 data_offset;
__u32 reserved[11];
};
likeβ¦ look at her. she's gorgeous. π
π Members π
bytesusedβ the number of bytes that data actually occupies in the plane, aka the payload. the real content. the main character energy π«Άlengthβ the size of this plane itself, in bytes. and bestie, read this twice: it is NOT the payload. it's the container, not the snack. πmβ the union ofmem_offset,userptrandfd. she contains multitudes πm.mem_offsetβ when the memory in the associatedstruct v4l2_bufferisV4L2_MEMORY_MMAP, this equals the offset from the start of the device memory for this plane β or it's a "cookie" that should be passed tommapcalled on the video node πͺ lowkey iconicm.userptrβ when the memory isV4L2_MEMORY_USERPTR, this is a userspace pointer pointing right at this plane π₯m.fdβ when the memory isV4L2_MEMORY_DMABUF, this is a userspace file descriptor associated with this plane π¦data_offsetβ offset in the plane to the start of the data. usually0, unless there's a header sitting in front of the data π (there's always someone in front of you in line, fr fr)reservedβ drivers and applications must zero this array. not "should", not "maybe", must. zero it out bestie π
β¨ Description β¨
so multi-planar buffers are made of one or more planes, right? π like, an YCbCr buffer with two planes can have one plane for Y, and another for the interleaved CbCr components. that's the vibe π
Each plane can live in a separate memory buffer β or even in a completely separate memory node (e.g. in embedded devices π). literally independent. they don't even have to be in the same neighborhood. slay.
π₯ SEE ALSO π₯
Kernel file ./include/uapi/linux/videodev2.h β go read the source, iykyk π and also go say hi to her friends:
struct v4l2_capability(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_create_buffers(9)struct v4l2_remove_buffers(9)
and that's the whole page, bestie π« this one lives in ./include/uapi/linux, dated October 2026, and it's filed under struct v4l2_plane(9) β go forth and zero your reserved array ππβ¨
π¦ 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