v4l2_m2m_prepare_buf(9)
π
v4l2_m2m_prepare_buf(9) β the Kernel API Manual page, bestie edition π
okay so β¨ this is a page straight out of the Kernel API Manual (yes the actual kernel docs, we're fancy now π ) and it's all about one lil function that gets a buffer ready to go β src or dst, depends on the type, iykyk π¦
β¨ NAME β¨
v4l2_m2m_prepare_buf β prepare a source or destination buffer, depending on the type π
like, that's literally the whole gig. you hand it a buffer and it preps it. whether it's the source one or the destination one is justβ¦ vibes-based on the type, no cap πΈ
π«Ά SYNOPSIS π«Ά
int v4l2_m2m_prepare_buf (struct file *file , struct v4l2_m2m_ctx
*m2m_ctx , struct v4l2_buffer *buf );
it returns an int, bestie. and it takes three pointers. three!! we love a three-pointer situation π
π§ ARGUMENTS π§
fileβ pointer tostruct file. that's it, that's the whole description. a pointer. to astruct file. iconic behavior honestly πm2m_ctxβ the m2m context that's been assigned to the instance, given bystruct v4l2_m2m_ctx. so like, the mem2mem context holding it down for this instance π«Άbufβ pointer tostruct v4l2_buffer. your buffer!! the one getting prepped!! go off π
π SEE ALSO π
so this function has a whole friend group, and honestly the way it's an entire extended family of (9) pagesβ¦ π₯
the kernel file for all this is at ./include/media/v4l2-mem2mem.h, and it's giving main character energy for:
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_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)
bestie that's like sixty cross-references. read them. all of them. i'm not kidding π
β¨ and that's the page!! π it lives in ./include/media, dated October 2026, and the manual page itself is v4l2_m2m_prepare_buf(9) π
go prep some buffers, you absolute icon ππ periodt.
π¦ 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