v4l2_m2m_buf_copy_metadata(9)
π v4l2_m2m_buf_copy_metadata β from the Kernel API Manual β¨
okay bestie, buckle up, because today we're talking about a tiny little helper in the kernel media world and honestly? she's doing the most with the least. this is v4l2_m2m_buf_copy_metadata, straight out of the Kernel API Manual, and she has exactly one job: take the metadata off your output buffer and hand it over to your capture buffer. that's it. that's the whole personality. π
β¨ NAME β¨
v4l2_m2m_buf_copy_metadata β copies buffer metadata from the output buffer over to the capture buffer, no cap, that's literally the function π«Ά
πΈ SYNOPSIS πΈ
void v4l2_m2m_buf_copy_metadata (const struct vb2_v4l2_buffer *out_vb ,
struct vb2_v4l2_buffer *cap_vb );
look at her. two pointers, void return, absolutely no drama. iconic π
π¦ ARGUMENTS π¦
out_vbβ the output buffer, aka the source of the metadata. she's the one doing the giving here, the main character of this little exchange πcap_vbβ the capture buffer, aka the one that will receive the metadata. she shows up, hands empty, and leaves with the goods π
π DESCRIPTION π
so here's the vibe check: this helper function copies the timestamp, the timecode (but only if the TIMECODE buffer flag was set, okay? only then, don't come for her), the field, and the TIMECODE and TSTAMP_SRC_MASK flags β all of it travelling from out_vb over to cap_vb. β¨
like, it's giving "passing the aux cord." out buffer had it, cap buffer gets it. simple, clean, effective. the way that she just does it with no fuss ππ
π SEE ALSO π
okay this section is a whole friend group, so let's meet everybody π«Ά. first up, the kernel file itself:
./include/media/v4l2-mem2mem.h
and now the entire squad, in order, no one left behind (i would never π):
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_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)
that's fifty-something functions and structs and every single one of them is invited to the group chat, i checked twice πβ¨
aaaaand that's the page!! π okay so the source lives in ./include/media, this is the Kernel API Manual edition dated October 2026, all about v4l2_m2m_buf_copy_metadata(9) β mwah, go copy that metadata bestie, you're gonna slay ππ¦β
π¦ 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