v4l2_m2m_dst_buf_is_last(9)
π v4l2_m2m_dst_buf_is_last(9) π
okay so bestie, welcome to the Kernel API Manual β yes, that's the actual manual name, we're in the big leagues now β¨. This one's about a tiny little function that answers one very specific question about your mem2mem session, and honestly it's giving "quiet hero of the drain state machine" energy.
πΈ NAME πΈ
v4l2_m2m_dst_buf_is_last β returns the current encoding/decoding session draining management state of the next queued capture buffer. like, it tells you whether the buffer you're about to hand over is the final one in the whole session π
β¨ SYNOPSIS β¨
bool v4l2_m2m_dst_buf_is_last (struct v4l2_m2m_ctx *m2m_ctx );
she takes one pointer, she gives you a bool. lowkey iconic π
π¦ ARGUMENTS π¦
m2m_ctxβ the m2m context that's assigned to the instance, which was given to you bystruct v4l2_m2m_ctx. that's the one and only thing she needs from you π«Ά
π₯ DESCRIPTION π₯
so here's the vibe: this last capture buffer should be tagged with V4L2_BUF_FLAG_LAST, and that tag is what notifies everyone that the capture session is ending. that's it, that's the whole point β no cap. mark the final buffer, signal the end, done ππ
fr fr though β the flag is doing the actual announcing here. this function exists to tell you whether your next queued capture buffer is the one that gets it. π§
π SEE ALSO π
Kernel file ./include/media/v4l2-mem2mem.h β go read it, she has lore π β plus literally all of these:
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_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_dst_buf_safe(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)
that's the whole page, bestie β mwah π
came from ./include/media, dated October 2026, and the page itself is v4l2_m2m_dst_buf_is_last(9) β shoutout to the kernel docs squad for keeping the vibe alive πβ¨π¦
π¦ 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