v4l2_m2m_decoder_cmd(9)
π v4l2_m2m_decoder_cmd(9) β like, the decoder command executor bestie β¨
okay so real talk: this is a page from the Kernel API Manual (v4l2_m2m_decoder_cmd(9), the mem2mem decoder one) and it is so much less scary than the name makes it sound. grab a matcha π and let's get into it.
πΈ NAME πΈ
v4l2_m2m_decoder_cmd β execute a decoder command. that's it, that's the whole thing. you hand it a command and it goes and does the thing π
β¨ SYNOPSIS β¨
int v4l2_m2m_decoder_cmd (struct file *file , struct v4l2_m2m_ctx
*m2m_ctx , struct v4l2_decoder_cmd *dc );
like, copy it exactly, no cap β those spaces before the commas are canonical, do not come for them π«Ά
π ARGUMENTS π
three args, all pointers, all iconic in their own way:
fileβ pointer tostruct file. just the file, living its life, being a pointer to it π¦m2m_ctxβ the m2m context assigned to the instance, given bystruct v4l2_m2m_ctx. this is the main character of the whole mem2mem situation honestly πdcβ pointer to the decoder command. this is where you tell it what to execute. the vibe check, if you will π
π₯ SEE ALSO π₯
okay this list is long but every single one is here because we do not skip, we do not summarise, we list all of them periodt. the whole thing lives in the kernel file ./include/media/v4l2-mem2mem.h:
- the structs, the founding mothers:
struct v4l2_m2m_ops(9),struct v4l2_m2m_queue_ctx(9),struct v4l2_m2m_ctx(9),struct v4l2_m2m_buffer(9) - the context/queue girlies:
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) - the state machine crew π:
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) - sleep mode besties π΄:
v4l2_m2m_suspend(9),v4l2_m2m_resume(9) - buffer administration:
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) - the streaming girlies βΆοΈ:
v4l2_m2m_streamon(9),v4l2_m2m_streamoff(9),v4l2_m2m_update_start_streaming_state(9),v4l2_m2m_update_stop_streaming_state(9) - the sibling:
v4l2_m2m_encoder_cmd(9)β yeah the encoder got one too, we support her π«Ά - waiting around:
v4l2_m2m_poll(9),v4l2_m2m_mmap(9) - life cycle:
v4l2_m2m_init(9),v4l2_m2m_release(9),v4l2_m2m_get(9),v4l2_m2m_put(9) - ctx life cycle:
v4l2_m2m_ctx_init(9),v4l2_m2m_ctx_release(9) - buffer queueing + peeking:
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) - the loopers π:
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) - getting the queues:
v4l2_m2m_get_src_vq(9),v4l2_m2m_get_dst_vq(9) - removal squad ποΈ:
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) - and finally the metadata copier:
v4l2_m2m_buf_copy_metadata(9)
iykyk π
that's the whole page bestie, nothing skipped, nothing invented π
and for the cute sign-off: this little love letter to mem2mem comes from the source file ./include/media, dated October 2026, in the Kernel API Manual β see you in the kernel tree, mwah πβ¨
π¦ 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