STRUCT SKELETON(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct skeleton β€” literally all the internal data for one (1) instance of a device, bestie. One struct, one device, that's the whole vibe πŸ’…


🌸 SYNOPSIS 🌸

struct skeleton {
    struct pci_dev *pdev;
    struct v4l2_device v4l2_dev;
    struct video_device vdev;
    struct v4l2_ctrl_handler ctrl_handler;
    struct mutex lock;
    v4l2_std_id std;
    struct v4l2_dv_timings timings;
    struct v4l2_pix_format format;
    unsigned input;
    struct vb2_queue queue;
    spinlock_t qlock;
    struct list_head buf_list;
    unsigned field;
    unsigned sequence;
 };

No cap, that's the whole blueprint πŸŽ€


πŸ’… Members πŸ’…

Okay so let's go through every single one of these, because they all matter, periodt:

  • pdev β€” the PCI device. Like, the actual hardware babe 🫢
  • v4l2_dev β€” the top-level v4l2 device struct, the main character of the operation πŸ‘‘
  • vdev β€” the video node structure 🌈
  • ctrl_handler β€” the control handler structure, holding all the controls together ✨
  • lock β€” the ioctl serialization mutex. It keeps your ioctls from stepping on each other's toes πŸ’€
  • std β€” the current SDTV standard πŸ“Ί
  • timings β€” the current HDTV timings, fancy ✨
  • format β€” the current pix format πŸŽ€
  • input β€” the current video input (0 = SDTV, 1 = HDTV). Pick your fighter πŸ¦‹
  • queue β€” the vb2 video capture queue 🌸
  • qlock β€” spinlock controlling access to buf_list and sequence. Not me being protective of just those two πŸ™ˆ
  • buf_list β€” the list of buffers queued for DMA πŸ“
  • field β€” the field (TOP/BOTTOM/other) of the current buffer ⭐
  • sequence β€” the frame sequence counter, counting frames like it's a stan counter πŸ”₯

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./samples/v4l/v4l2-pci-skeleton.c β€” go read it, iykyk 🧚

And that's the whole page bestie 🫢 this little icon came from ./samples/v4l, dated October 2026, living its life as struct skeleton(9) in the Kernel API Manual πŸ’œ slay.

πŸ“¦ where this page comes from