v4l2_m2m_for...dst_buf_safe(9)
π NAME π
v4l2_m2m_for_each_dst_buf_safe β bestie, this is the macro you use when you wanna iterate over a list of destination ready buffers safely β¨
Ok so real talk, this is from the Kernel API Manual (v4l2_m2m_for...dst_buf_safe(9) if you're keeping score π), and it's literally the "don't trip while you're walking" version of a for-each loop. Main character energy for kernel devs only.
πΈ SYNOPSIS πΈ
v4l2_m2m_for_each_dst_buf_safe (m2m_ctx , b , n );
That's it. Three things in, vibes out. π¦
β¨ ARGUMENTS β¨
m2m_ctxβ the m2m context assigned to the instance, like, given bystruct v4l2_m2m_ctx. She's the one holding the whole situation together, no cap.bβ the current buffer, of typestruct v4l2_m2m_buffer. This is your little iterator bestie that walks the list πnβ honestly? just used as temporary storage. She's not the star of the show, she's the stagehand. Still iconic tho π«Ά
Heads up bestie β the_safein the name is doing a LOT of work here. It means you can yank stuff out of the list mid-iteration without the loop going π on you. That's the whole point ofnexisting.
π¦ SEE ALSO π¦
Ok this list is giving extended universe, so buckle up. First up, the kernel file herself:
./include/media/v4l2-mem2mem.h
Then the whole friend group, in order, no skipping, periodt:
struct v4l2_m2m_ops(9)struct v4l2_m2m_queue_ctx(9)struct v4l2_m2m_ctx(9)struct v4l2_m2m_buffer(9)v4l2_m2m_get_curr_priv(9)v4l2_m2m_get_vq(9)v4l2_m2m_try_schedule(9)v4l2_m2m_job_finish(9)v4l2_m2m_buf_done_and_job_finish(9)v4l2_m2m_clear_state(9)v4l2_m2m_mark_stopped(9)v4l2_m2m_dst_buf_is_last(9)v4l2_m2m_has_stopped(9)v4l2_m2m_is_last_draining_src_buf(9)v4l2_m2m_last_buffer_done(9)v4l2_m2m_suspend(9)v4l2_m2m_resume(9)v4l2_m2m_reqbufs(9)v4l2_m2m_querybuf(9)v4l2_m2m_qbuf(9)v4l2_m2m_dqbuf(9)v4l2_m2m_prepare_buf(9)v4l2_m2m_create_bufs(9)v4l2_m2m_expbuf(9)v4l2_m2m_streamon(9)v4l2_m2m_streamoff(9)v4l2_m2m_update_start_streaming_state(9)v4l2_m2m_update_stop_streaming_state(9)v4l2_m2m_encoder_cmd(9)v4l2_m2m_decoder_cmd(9)v4l2_m2m_poll(9)v4l2_m2m_mmap(9)v4l2_m2m_init(9)v4l2_m2m_release(9)v4l2_m2m_get(9)v4l2_m2m_put(9)v4l2_m2m_ctx_init(9)v4l2_m2m_ctx_release(9)v4l2_m2m_buf_queue(9)v4l2_m2m_num_src_bufs_ready(9)v4l2_m2m_num_dst_bufs_ready(9)v4l2_m2m_next_buf(9)v4l2_m2m_next_src_buf(9)v4l2_m2m_next_dst_buf(9)v4l2_m2m_last_buf(9)v4l2_m2m_last_src_buf(9)v4l2_m2m_last_dst_buf(9)v4l2_m2m_for_each_dst_buf(9)v4l2_m2m_for_each_src_buf(9)v4l2_m2m_for_each_src_buf_safe(9)v4l2_m2m_get_src_vq(9)v4l2_m2m_get_dst_vq(9)v4l2_m2m_buf_remove(9)v4l2_m2m_src_buf_remove(9)v4l2_m2m_dst_buf_remove(9)v4l2_m2m_buf_remove_by_buf(9)v4l2_m2m_src_buf_remove_by_buf(9)v4l2_m2m_dst_buf_remove_by_buf(9)v4l2_m2m_buf_copy_metadata(9)
Like I said. Extended universe. π§ Take your time, she's worth it.
That's the whole page, bestie β go forth and iterate safely π
Source path: ./include/media Β· dated October 2026 Β· page name v4l2_m2m_for...dst_buf_safe(9) π slay, go read the source, ily, bye β¨
π¦ 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