STRUCT DVB_VB2_CTX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct dvb_vb2_ctx(9) πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” this page is all about struct dvb_vb2_ctx, and it's literally the control struct for VB2 handler. that's the whole name tag. iykyk πŸŽ€


✨ NAME ✨

struct dvb_vb2_ctx β€” control struct for VB2 handler. no cap, that's it, that's the vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

struct dvb_vb2_ctx {
    struct vb2_queue        vb_q;
    spinlock_t slock;
    struct list_head        dvb_q;
    struct dvb_buffer       *buf;
    int offset;
    int remain;
    int state;
    int buf_siz;
    int buf_cnt;
    int nonblocking;
    enum dmx_buffer_flags flags;
    u32 count;
    char name[DVB_VB2_NAME_MAX + 1];
 };

look at her. iconic. every field accounted for, nothing skipped, we respect the struct in this house 🫢


🌸 MEMBERS 🌸

okay so let's meet the cast, one by one, main character energy for each:

  • vb_q β€” pointer to struct vb2_queue with videobuf2 queue. she's the plug πŸ”Œ
  • slock β€” spin lock used to protect buffer filling at dvb_vb2.c. do NOT skip her, she's holding the whole thing together fr fr.
  • dvb_q β€” List of buffers that are not filled yet. the "waiting room" energy πŸ’€
  • buf β€” Pointer to the buffer that are currently being filled. (yes the original grammar said "that are", we're keeping it, it's canon πŸ’–)
  • offset β€” index to the next position at the buf to be filled. the lil bookmark of progress ✨
  • remain β€” How many bytes are left to be filled at buf. the countdown, the suspense, the drama 😭
  • state β€” bitmask of buffer states as defined by enum dvb_vb2_states. bitmask bestie, not a single mood, a whole spectrum.
  • buf_siz β€” size of each VB2 buffer.
  • buf_cnt β€” number of VB2 buffers. (yes, buf_siz and buf_cnt are different things, don't mix them up, i'm begging πŸ™ˆ)
  • nonblocking β€” If different than zero, device is operating on non-blocking mode. zero = blocking, nonzero = we do NOT wait, we move 🌈
  • flags β€” buffer flags as defined by enum dmx_buffer_flags. Filled only at DMX_DQBUF. DMX_QBUF should zero this field. ⚠️ like β€” this is a real rule, not a suggestion, the zeroing is not optional.
  • count β€” monotonic counter for filled buffers. Helps to identify data stream loses. Filled only at DMX_DQBUF. DMX_QBUF should zero this field. same deal as flags, bestie: fill at DMX_DQBUF, zero at DMX_QBUF, periodt. the monotonic-ness is the whole point β€” drops get caught that way πŸ‘‘
  • name β€” name of the device type. Currently, it can either be "dvr" or "demux_filter". that's the entire roster, just those two, don't invent a third one πŸ”₯
lowkey important reminder: both flags and count say "Filled only at DMX_DQBUF. DMX_QBUF should zero this field." β€” two different fields, same exact rule. write it on your hand if u have to πŸ’€

🧚 SEE ALSO 🧚

Kernel file ./include/media/dvb_vb2.h plus the whole friend group:

go read them all, they're all slay, this struct doesn't exist in a vacuum bestie 🌟


and that's the page!! πŸ’œ this lil manual lives at ./include/media, dated October 2026, and its official title card reads struct dvb_vb2_ctx(9) β€” mwah, bye, go fill some buffers responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from