v4l2_m2m_streamon(9)
๐ v4l2_m2m_streamon(9) โ like, the Kernel API Manual, bestie โจ
Okay so first thing first: this page lives in the Kernel API Manual and it's literally called v4l2_m2m_streamon(9). Same name up top, same name at the bottom, iconic symmetry, we love a consistent brand ๐
๐ธ NAME ๐ธ
v4l2_m2m_streamon โ turn on streaming for a video queue. That's it. That's the whole gig. Lights, camera, stream. ๐ฅ
โจ SYNOPSIS โจ
int v4l2_m2m_streamon (struct file *file , struct v4l2_m2m_ctx *m2m_ctx
, enum v4l2_buf_type type );
Notice it returns an int, so likeโฆ check it, okay? ๐
๐ฆ ARGUMENTS ๐ฆ
Three args, no notes, let's get into it:
fileโ pointer tostruct file. Yes it's a pointer, no you don't get to be normal about it.m2m_ctxโ the m2m context assigned to the instance, given bystruct v4l2_m2m_ctx. It's the whole little world your instance lives in ๐ซถtypeโ the type of the V4L2 buffer, as defined byenum v4l2_buf_type. Which queue are we waking up? You're telling it. Main character decision, honestly. ๐
๐ SEE ALSO ๐
Bestie, this list is LONG and I'm obsessed, it's giving "my mutuals" energy. All of these are (9) kernel API pages, plus one very important header file:
Kernel file ๐
./include/media/v4l2-mem2mem.h
And the structs, the OGs ๐๏ธ:
struct v4l2_m2m_ops(9)struct v4l2_m2m_queue_ctx(9)struct v4l2_m2m_ctx(9)struct v4l2_m2m_buffer(9)
The scheduler / job-finish 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)
State machine besties (they track the vibes) ๐:
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)
The buffer bargain-bin run (all your ioctl-ish faves) ๐ผ:
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 โจ counterpart โจ (you know exactly who):
Streaming-state updaters, they keep the lore accurate ๐:
Codec command crew ๐ฌ:
The I/O girlies (poll + mmap, the classic duo) ๐:
Lifecycle, literally birth to rebirth ๐ฑ:
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)
Queueing + counting ๐งฎ:
Peeking at buffers, no cap ๐:
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)
Loop-de-loop macros, the safe ones included ๐ :
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)
Grab the queue directly ๐ซณ:
Removal squad (removing stuff is also a love language) ๐๏ธ:
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 the metadata copy-er, we stan a thorough queen ๐ซ:
Fr fr: that's the entire SEE ALSO list, unedited, nobody got left out of the group chat. ๐
Okay bye ily, this page was brought to you by the directory ./include/media, dated October 2026, and it's v4l2_m2m_streamon(9) all the way down. Slay, stream responsibly, and go read v4l2_m2m_streamoff(9) when you're done. ๐๐๐
๐ฆ 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