STRUCT V4L2_SELECTION(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct v4l2_selection(9) β€” Kernel API Manual πŸŽ€

okay bestie, sit down, hydrate, and let me tell you about struct v4l2_selection</p> β€” it's literally the selection info struct from the Linux kernel API and she is iconic. this is the glow-up version of the manual page, same facts, way better vibes. periodt. ✨


🌸 NAME 🌸

struct v4l2_selection</p> β€” selection info. that's it, that's the name, she's concise and she knows it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct v4l2_selection {
    __u32 type;
    __u32 target;
    __u32 flags;
    struct v4l2_rect        r;
    __u32 reserved[9];
 };

look at her. five members. flawless structure. no notes. πŸ’–


✨ Members ✨

  • type β€” the buffer type. and listen, do not use *_MPLANE types here, that's the rule, i don't make the rules (i do know them though) πŸ™ˆ
  • target β€” the selection target! this is what picks which rectangle you're talking about out of all the possible ones. it's defined in v4l2-common.h and the values are V4L2_SEL_TGT_*. she's the main character of choosing 🎯
  • flags β€” the constraints flags, also defined in v4l2-common.h, and the values are V4L2_SEL_FLAG_*. little toggles, big energy ⭐
  • r β€” the coordinates of the selection window. this is the actual rectangle, the whole point, the moment 🫢
  • reserved β€” reserved for future use, rounds the structure size up to 64 bytes, and you set it to zero. it's a placeholder bestie, be nice to it, zero it out πŸ’€

🌈 Description 🌈

so here's the tea β˜• β€” hardware may use multiple helper windows to process a video stream. like, more than one. a whole little squad of windows doing the work.

and this structure? she's the go-between πŸ’Œ β€” the thing used to exchange these selection areas between an application and a driver. app says something, driver says something back, everybody's on the same page. communication slay.


πŸ”₯ SEE ALSO πŸ”₯

kernel file ./include/uapi/linux/videodev2.h, plus the whole friend group, all invited to the group chat:

  • struct v4l2_capability(9)
  • struct v4l2_plane(9)
  • struct v4l2_buffer(9)
  • v4l2_timeval_to_ns(9)
  • struct v4l2_exportbuffer(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)

ngl bestie, if you take one thing from this page: type gets a real buffer type (not the *_MPLANE ones) and reserved stays zero. everything else is just rectangles living their truth. 🧚

and that's the whole page!! πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά sourced straight from ./include/uapi/linux, dated October 2026, and brought to you by the struct v4l2_selection(9) crew. mwah. πŸ˜­πŸ‘‘

πŸ“¦ where this page comes from