STRUCT MTK_VIDEO_DEC_BUF(9)
π struct mtk_video_dec_buf(9) β the Kernel API Manual glow-up π
okay so bestie, this is a page from the Kernel API Manual and it's all about one very specific little struct, so grab your iced coffee and let's get into it β¨
πΈ NAME πΈ
struct mtk_video_dec_buf β literally the private data that's related to each VB2 buffer. that's it, that's the whole vibe π«Ά
β¨ SYNOPSIS β¨
here's the shape of it, exactly as it lives, no cap:
struct mtk_video_dec_buf {
struct v4l2_m2m_buffer m2m_buf;
bool used;
bool queued_in_vb2;
bool queued_in_v4l2;
bool error;
union {
struct vdec_fb frame_buffer;
struct mtk_vcodec_mem bs_buffer;
};
};
look at that anonymous union living its best main character life π
π¦ Members π¦
m2m_bufβ the M2M buffer. that's the whole description, she's brief and she knows it πusedβ capture buffer that contains decoded frame data and is kept in the codec data structure. so like, it's holding the decoded frame tea and staying put in the codec's data structure πqueued_in_vb2β the capture buffer is queued invb2. yes queen, she's in the queue πqueued_in_v4l2β this capture buffer is sitting in the v4l2 driver but not in the vb2 queue yet. like she's in the group chat but hasn't opened the poll πerrorβ an unrecoverable error occurs on this buffer. big yikes, it's giving π β and note the word unrecoverable, we do not soft-pedal that one{unnamed_union}β anonymous. mysterious. iconic πframe_bufferβ the decode status, plus the buffer information of the capture buffer πbs_bufferβ output buffer info β
π₯ {unnamed_union} β a lil sub-heading of her own π₯
so the two members frame_buffer and bs_buffer both live inside that same anonymous union, and they're the two flavours you get depending on what you're looking at:
frame_bufferβ decode status, and buffer information of Capture buffer πbs_bufferβ output buffer info πΈ
π Note π
these status information help us track and debug buffer state. fr fr, the status flags are basically the receipts that let you follow what a buffer's been up to and debug it when things go sideways π§
ngl bestie, treat thosebools like a tiny little state machine βused,queued_in_vb2,queued_in_v4l2,errorβ and remembererrormeans an unrecoverable error, so don't go expecting a comeback tour π
π SEE ALSO π
- Kernel file β
./drivers/media/platform/mediatek/vcodec/decoder/mtk_vcodec_dec.h(the struct's home address π‘) - struct
vdec_fb(9)β go read up on that one too, iykyk π¦
and that's the page! π
this little number came to you straight from the source at ./drivers/media/platform/media... and it's dated October 2026, so mark your calendars and stan responsibly. bye bestie, slay your buffers πβπ
π¦ 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