v4l2_m2m_src_buf_remove(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… v4l2_m2m_src_buf_remove πŸ’…

okay so bestie, welcome to the Kernel API Manual β€” yes it's a whole manual, and yes this page is literally just about taking a buffer off a list and handing it back. tiny function, big main character energy. let's go 🫢


✨ NAME ✨

v4l2_m2m_src_buf_remove β€” bestie, this one takes off a source buffer from the list of ready buffers and returns it. that's the whole gig. it's giving "bouncer at the club, but the club is a linked list" πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct vb2_v4l2_buffer * v4l2_m2m_src_buf_remove (struct v4l2_m2m_ctx
*m2m_ctx );

like, look at that return type. struct vb2_v4l2_buffer * β€” a pointer, we're getting the actual buffer back, not a copy. obsessed ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • m2m_ctx β€” the m2m context assigned to the instance, given to you by struct v4l2_m2m_ctx. this is the ✨context✨ (literally) β€” hand it over and the function knows which list it's working with. no cap.

🌈 SEE ALSO 🌈

okay this is the part where the manpage goes absolutely feral with cross-references, and honestly? it ate. there are so many of them, so let's do this in chunks, iykyk πŸ‘‘

the kernel file itself, first:

  • Kernel file ./include/media/v4l2-mem2mem.h

then the structs (the friend group πŸ’–):

  • struct v4l2_m2m_ops(9)
  • struct v4l2_m2m_queue_ctx(9)
  • struct v4l2_m2m_ctx(9)
  • struct v4l2_m2m_buffer(9)

the core context / scheduling girlies:

the ioctl-coded squad (reqbufs, qbuf, dqbuf, we love a queue πŸ“):

lifecycle icons β€” init, release, get, put, ctx things ✨:

buffer-queue brainrot (affectionate) 🧚:

the next/last peekers πŸ‘€:

the iterator loops (for each, but make it fashion):

the videobuf queues:

and the buffer-remove family β€” this function's literal siblings, plus a metadata copy friend πŸ’€:


fr fr a little reminder: this page only documents taking a source buffer off the ready list and returning it. the dst versions are their own whole thing, don't mix them up bestie πŸ™ˆ

and that's the whole page!! short, sweet, and absolutely iconic for a kernel function πŸ’œ

sign-off time: this masterpiece lives in ./include/media, it's stamped October 2026, and it answers to the name v4l2_m2m_src_buf_remove(9) β€” under the umbrella of that Kernel API Manual we mentioned up top. mwah, go remove some buffers responsibly πŸŽ€βœ¨

πŸ“¦ where this page comes from