STRUCT DVB_VB2_CTX(9)
π 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 tostruct vb2_queuewith videobuf2 queue. she's the plug πslockβ spin lock used to protect buffer filling atdvb_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 thebufto be filled. the lil bookmark of progress β¨remainβ How many bytes are left to be filled atbuf. the countdown, the suspense, the drama πstateβ bitmask of buffer states as defined byenum 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_sizandbuf_cntare 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 byenum dmx_buffer_flags. Filled only atDMX_DQBUF.DMX_QBUFshould 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 atDMX_DQBUF.DMX_QBUFshould zero this field. same deal asflags, bestie: fill atDMX_DQBUF, zero atDMX_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: bothflagsandcountsay "Filled only atDMX_DQBUF.DMX_QBUFshould 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:
enum dvb_buf_type(9)enum dvb_vb2_states(9)struct dvb_buffer(9)dvb_vb2_init(9)dvb_vb2_release(9)dvb_vb2_is_streaming(9)dvb_vb2_fill_buffer(9)dvb_vb2_poll(9)dvb_vb2_stream_on(9)dvb_vb2_stream_off(9)dvb_vb2_reqbufs(9)dvb_vb2_querybuf(9)dvb_vb2_expbuf(9)dvb_vb2_qbuf(9)dvb_vb2_dqbuf(9)dvb_vb2_mmap(9)
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
- 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