v4l2_m2m_create_bufs(9)
β¨ v4l2_m2m_create_bufs β from the Kernel API Manual, bestie β¨
okay so picture this: you're deep in the kernel source, ./include/media/v4l2-mem2mem.h is open in another tab, and you need to spin up a buffer. this is THE function for that. π
π NAME π
v4l2_m2m_create_bufs β creates a source or destination buffer, depending on the type. that's it, that's the whole vibe. the type is the main character here and decides which side gets the new buffer. β¨
πΈ SYNOPSIS πΈ
int v4l2_m2m_create_bufs (struct file *file , struct v4l2_m2m_ctx
*m2m_ctx , struct v4l2_create_buffers *create );
three args in, one int out. lowkey iconic signature ngl π«Ά
π ARGUMENTS π
fileβ pointer to astruct file. yes, thatfile. the one you already have. πm2m_ctxβ the m2m context assigned to the instance, given to you by astruct v4l2_m2m_ctx. this is the whole memory-to-memory situation, the group chat the buffers are joining. π¬createβ pointer to astruct v4l2_create_buffers. this holds the actual buffer-creation details, so likeβ¦ don't pass garbage here. π
π¦ SEE ALSO π¦
the whole extended friend group, fr fr. grab a snack, this is a long one:
- Kernel file
./include/media/v4l2-mem2mem.h 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_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)
like I said. extended friend group. every single one of them is invited to the function-reference party π§β¨
ngl this one's a short page β no OPTIONS, no RETURN VALUE section, no warnings, no bugs to report. what you see is what you get, and what you get is a buffer. slay. π
and that's the whole page, bestie β brought to you by ./include/media, dated October 2026, sitting pretty under the v4l2_m2m_create_bufs(9) banner. go create some buffers. no cap, you're gonna eat. πππ
π¦ 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