STRUCT V4L2_EXPORTBUFFER(9)
π
struct v4l2_exportbuffer β Kernel API Manual, bestie edition
okay so real talk, this struct is the one that lets you yeet a video buffer out as a DMABUF file descriptor β¨ it's giving "handoff era" and honestly? iconic.
β¨ NAME β¨
struct v4l2_exportbuffer β export of video buffer as DMABUF file descriptor π¦
π SYNOPSIS π
struct v4l2_exportbuffer {
__u32 type;
__u32 index;
__u32 plane;
__u32 flags;
__s32 fd;
__u32 reserved[11];
};
no cap, that's the whole layout π
πΈ Members πΈ (yes we're doing every single one, don't scroll)
typeβenum v4l2_buf_type; it's the buffer type, and heads up:type == *_MPLANEmeans you're in multiplanar buffer territory π«Άindexβ the id number of the buffer, aka which one you're talking aboutplaneβ index of the plane to be exported; for single plane queues it's just0flagsβ flags for the newly created file; rn onlyO_CLOEXECis supported, so go peek at the manual of theopensyscall for the deets πfdβ the file descriptor associated with DMABUF, and note that the driver sets this one, not you πreservedβ drivers and applications must zero this array. literally mandatory. zero it. periodt.
π Description π
so this struct holds the data used for exporting a video buffer as a DMABUF file descriptor. slay.
the buffer is identified by a 'cookie' that VIDIOC_QUERYBUF hands you β and it's literally the identical cookie you'd use to mmap the buffer into userspace, iykyk π
β οΈ every reserved field must be set to zero. all of them. no exceptions, bestie.
and here's the lore: the field reserved0 is expected to become a structure 'type' that would allow an alternative layout of the struct's content. so because of that future glow-up, that field should not be used for any other extensions. do not repurpose it, I'm begging π
π₯ SEE ALSO π₯
Kernel file ./include/uapi/linux/videodev2.h β and the whole friend group:
struct v4l2_capability(9)struct v4l2_plane(9)struct v4l2_buffer(9)v4l2_timeval_to_ns(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)
k that's the whole page, go export some buffers responsibly π this diva lives in ./include/uapi/linux and the version vibes are dated October 2026 β mwah, catch you in the next manpage ππ
π¦ 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