STRUCT EM28XX_BUFFER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct em28xx_buffer(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual ✨ β€” today's main character is struct em28xx_buffer, and honestly? it's giving "one video frame's whole support system." let's get into it πŸŽ€


🌸 NAME 🌸

struct em28xx_buffer β€” the buffer that holds one (1) single video frame, no more no less πŸ¦‹


✨ SYNOPSIS ✨

struct em28xx_buffer {
    struct vb2_v4l2_buffer  vb;
    struct list_head        list;
    void *mem;
    unsigned int            length;
    int top_field;
    unsigned int            pos;
    char *vb_buf;
 };

like, that's the whole vibe right there. copy it exactly if you're writing code, i'm begging πŸ™ˆ


🫢 Members 🫢

  • vb β€” the common v4l buffer stuff. literally the standard-issue V4L2 buffer bits living inside this thing πŸ’…
  • list β€” a list head so this buffer can link up with all the other buffers. it's a group chat, and every buffer is in it 😭
  • mem β€” pointer to the buffer itself, as returned by vb2_plane_vaddr. that's where the actual memory lives ✨
  • length β€” how long the buffer is, as returned by vb2_plane_size. the size check, the vibe check πŸŽ€
  • top_field β€” if this is non-zero, it means the buffer is the top field. that's it, that's the flag πŸ‘‘
  • pos β€” tells you the next position in the buffer that's gonna get filled. the "we're up to here" marker πŸ”₯
  • vb_buf β€” pointer to the vmalloc memory address in vb. lowkey the real address energy ⭐

πŸ’€ Description πŸ’€

NOTE: in interlaced mode, pos gets reset to zero at the start of each new field β€” not frame! 🚨 like please do not get this twisted, the field/frame distinction is doing so much work here. fields are the little guys; frames are the big picture. pos starts over per field. periodt πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/media/usb/em28xx/em28xx.h
  • struct em28xx_usb_bufs(9)
  • struct em28xx_usb_ctl(9)
  • struct em28xx_fmt(9)
  • enum em28xx_amux(9)

go read those next, iykyk 🧚


and that's the whole page bestie, no cap πŸ“ β€” this one came from ./drivers/media/usb/em28xx, dated October 2026, and it's struct em28xx_buffer(9) saying bye πŸ’œπŸ¦‹

πŸ“¦ where this page comes from