STRUCT V4L2_IOCTL_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct v4l2_ioctl_ops(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual, section 9 β€” pull up a chair, we're doing kernel structs today and honestly? it's giving main character energy πŸ’…


✨ NAME ✨

  • struct v4l2_ioctl_ops β€” describe operations for each V4L2 ioctl

literally that's the whole vibe: this struct is where you describe what happens when someone hits a V4L2 ioctl on your driver. every ioctl gets its own little operation slot in here, and the kernel comes knocking. no cap 🫢


more coming in the next part, don't go anywhere πŸ¦‹

✨ SYNOPSIS ✨

okay bestie, deep breath, hydrate, sit down πŸ’– β€” because this is the whole struct, every single member, and we are not skipping a one of them. It's giving "long but iconic". Here it is, exactly as it lives, no edits, no vibes-based trimming, periodt:

struct v4l2_ioctl_ops {
    int (*vidioc_querycap)(struct file *file, void *priv, struct
v4l2_capability *cap);
    int (*vidioc_enum_fmt_vid_cap)(struct file *file, void *priv, struct
v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_vid_overlay)(struct file *file, void *priv,
struct v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_vid_out)(struct file *file, void *priv, struct
v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_sdr_cap)(struct file *file, void *priv, struct
v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_sdr_out)(struct file *file, void *priv, struct
v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_meta_cap)(struct file *file, void *priv,
struct v4l2_fmtdesc *f);
    int (*vidioc_enum_fmt_meta_out)(struct file *file, void *priv,
struct v4l2_fmtdesc *f);
    int (*vidioc_g_fmt_vid_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_vid_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_vid_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_vid_out_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_vbi_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_vbi_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_sliced_vbi_cap)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_sliced_vbi_out)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_vid_cap_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_vid_out_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_g_fmt_sdr_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_sdr_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_meta_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_g_fmt_meta_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_vid_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_vid_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_vid_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_vid_out_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_vbi_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_vbi_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_sliced_vbi_cap)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_sliced_vbi_out)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_vid_cap_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_vid_out_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_s_fmt_sdr_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_sdr_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_meta_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_s_fmt_meta_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_vid_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_vid_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_vid_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_vid_out_overlay)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_vbi_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_vbi_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_sliced_vbi_cap)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_sliced_vbi_out)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_vid_cap_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_vid_out_mplane)(struct file *file, void *priv,
struct v4l2_format *f);
    int (*vidioc_try_fmt_sdr_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_sdr_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_meta_cap)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_try_fmt_meta_out)(struct file *file, void *priv, struct
v4l2_format *f);
    int (*vidioc_reqbufs)(struct file *file, void *priv, struct
v4l2_requestbuffers *b);
    int (*vidioc_querybuf)(struct file *file, void *priv, struct
v4l2_buffer *b);
    int (*vidioc_qbuf)(struct file *file, void *priv, struct v4l2_buffer
*b);
    int (*vidioc_expbuf)(struct file *file, void *priv, struct
v4l2_exportbuffer *e);
    int (*vidioc_dqbuf)(struct file *file, void *priv, struct
v4l2_buffer *b);
    int (*vidioc_create_bufs)(struct file *file, void *priv, struct
v4l2_create_buffers *b);
    int (*vidioc_prepare_buf)(struct file *file, void *priv, struct
v4l2_buffer *b);
    int (*vidioc_remove_bufs)(struct file *file, void *priv, struct
v4l2_remove_buffers *d);
    int (*vidioc_overlay)(struct file *file, void *priv, unsigned int
i);
    int (*vidioc_g_fbuf)(struct file *file, void *priv, struct
v4l2_framebuffer *a);
    int (*vidioc_s_fbuf)(struct file *file, void *priv, const struct
v4l2_framebuffer *a);
    int (*vidioc_streamon)(struct file *file, void *priv, enum
v4l2_buf_type i);
    int (*vidioc_streamoff)(struct file *file, void *priv, enum
v4l2_buf_type i);
    int (*vidioc_g_std)(struct file *file, void *priv, v4l2_std_id
*norm);
    int (*vidioc_s_std)(struct file *file, void *priv, v4l2_std_id
norm);
    int (*vidioc_querystd)(struct file *file, void *priv, v4l2_std_id
*a);
    int (*vidioc_enum_input)(struct file *file, void *priv, struct
v4l2_input *inp);
    int (*vidioc_g_input)(struct file *file, void *priv, unsigned int
*i);
    int (*vidioc_s_input)(struct file *file, void *priv, unsigned int
i);
    int (*vidioc_enum_output)(struct file *file, void *priv, struct
v4l2_output *a);
    int (*vidioc_g_output)(struct file *file, void *priv, unsigned int
*i);
    int (*vidioc_s_output)(struct file *file, void *priv, unsigned int
i);
    int (*vidioc_query_ext_ctrl)(struct file *file, void *priv, struct
v4l2_query_ext_ctrl *a);
    int (*vidioc_g_ext_ctrls)(struct file *file, void *priv, struct
v4l2_ext_controls *a);
    int (*vidioc_s_ext_ctrls)(struct file *file, void *priv, struct
v4l2_ext_controls *a);
    int (*vidioc_try_ext_ctrls)(struct file *file, void *priv, struct
v4l2_ext_controls *a);
    int (*vidioc_querymenu)(struct file *file, void *priv, struct
v4l2_querymenu *a);
    int (*vidioc_enumaudio)(struct file *file, void *priv, struct
v4l2_audio *a);
    int (*vidioc_g_audio)(struct file *file, void *priv, struct
v4l2_audio *a);
    int (*vidioc_s_audio)(struct file *file, void *priv, const struct
v4l2_audio *a);
    int (*vidioc_enumaudout)(struct file *file, void *priv, struct
v4l2_audioout *a);
    int (*vidioc_g_audout)(struct file *file, void *priv, struct
v4l2_audioout *a);
    int (*vidioc_s_audout)(struct file *file, void *priv, const struct
v4l2_audioout *a);
    int (*vidioc_g_modulator)(struct file *file, void *priv, struct
v4l2_modulator *a);
    int (*vidioc_s_modulator)(struct file *file, void *priv, const
struct v4l2_modulator *a);
    int (*vidioc_g_pixelaspect)(struct file *file, void *priv, int
buf_type, struct v4l2_fract *aspect);
    int (*vidioc_g_selection)(struct file *file, void *priv, struct
v4l2_selection *s);
    int (*vidioc_s_selection)(struct file *file, void *priv, struct
v4l2_selection *s);
    int (*vidioc_g_jpegcomp)(struct file *file, void *priv, struct
v4l2_jpegcompression *a);
    int (*vidioc_s_jpegcomp)(struct file *file, void *priv, const struct
v4l2_jpegcompression *a);
    int (*vidioc_g_enc_index)(struct file *file, void *priv, struct
v4l2_enc_idx *a);
    int (*vidioc_encoder_cmd)(struct file *file, void *priv, struct
v4l2_encoder_cmd *a);
    int (*vidioc_try_encoder_cmd)(struct file *file, void *priv, struct
v4l2_encoder_cmd *a);
    int (*vidioc_decoder_cmd)(struct file *file, void *priv, struct
v4l2_decoder_cmd *a);
    int (*vidioc_try_decoder_cmd)(struct file *file, void *priv, struct
v4l2_decoder_cmd *a);
    int (*vidioc_g_parm)(struct file *file, void *priv, struct
v4l2_streamparm *a);
    int (*vidioc_s_parm)(struct file *file, void *priv, struct
v4l2_streamparm *a);
    int (*vidioc_g_tuner)(struct file *file, void *priv, struct
v4l2_tuner *a);
    int (*vidioc_s_tuner)(struct file *file, void *priv, const struct
v4l2_tuner *a);
    int (*vidioc_g_frequency)(struct file *file, void *priv, struct
v4l2_frequency *a);
    int (*vidioc_s_frequency)(struct file *file, void *priv, const
struct v4l2_frequency *a);
    int (*vidioc_enum_freq_bands)(struct file *file, void *priv, struct
v4l2_frequency_band *band);
    int (*vidioc_g_sliced_vbi_cap)(struct file *file, void *priv, struct
v4l2_sliced_vbi_cap *a);
    int (*vidioc_log_status)(struct file *file, void *priv);
    int (*vidioc_s_hw_freq_seek)(struct file *file, void *priv, const
struct v4l2_hw_freq_seek *a);
  #ifdef CONFIG_VIDEO_ADV_DEBUG;
    int (*vidioc_g_register)(struct file *file, void *priv, struct
v4l2_dbg_register *reg);
    int (*vidioc_s_register)(struct file *file, void *priv, const struct
v4l2_dbg_register *reg);
    int (*vidioc_g_chip_info)(struct file *file, void *priv, struct
v4l2_dbg_chip_info *chip);
  #endif;
    int (*vidioc_enum_framesizes)(struct file *file, void *priv, struct
v4l2_frmsizeenum *fsize);
    int (*vidioc_enum_frameintervals)(struct file *file, void *priv,
struct v4l2_frmivalenum *fival);
    int (*vidioc_s_dv_timings)(struct file *file, void *priv, struct
v4l2_dv_timings *timings);
    int (*vidioc_g_dv_timings)(struct file *file, void *priv, struct
v4l2_dv_timings *timings);
    int (*vidioc_query_dv_timings)(struct file *file, void *priv, struct
v4l2_dv_timings *timings);
    int (*vidioc_enum_dv_timings)(struct file *file, void *priv, struct
v4l2_enum_dv_timings *timings);
    int (*vidioc_dv_timings_cap)(struct file *file, void *priv, struct
v4l2_dv_timings_cap *cap);

okay so. that was a lot. let's vibe-check what you just scrolled past 🫢

every single member is a function pointer starting with vidioc_, and like, almost all of them open with the same two args β€” struct file *file, void *priv β€” and then a pointer to whatever struct that ioctl is about. consistency is lowkey the moment here ✨

here's the family tree, so you don't get lost in the sauce:

  • vidioc_querycap β€” the one that doesn't follow the crowd: it takes struct v4l2_capability *cap.
  • the vidioc_enum_fmt_* girlies β€” vid_cap, vid_overlay, vid_out, sdr_cap, sdr_out, meta_cap, meta_out β€” all taking struct v4l2_fmtdesc *f.
  • the big vidioc_g_fmt_* / vidioc_s_fmt_* / vidioc_try_fmt_* trios, all taking struct v4l2_format *f. and bestie there are so many variants: vid_cap, vid_overlay, vid_out, vid_out_overlay, vbi_cap, vbi_out, sliced_vbi_cap, sliced_vbi_out, vid_cap_mplane, vid_out_mplane, sdr_cap, sdr_out, meta_cap, meta_out. yes. all three prefixes. all fourteen flavors. we chew πŸ“
  • the buffer squad β€” vidioc_reqbufs (struct v4l2_requestbuffers *b), vidioc_querybuf (struct v4l2_buffer *b), vidioc_qbuf (struct v4l2_buffer *b), vidioc_expbuf (struct v4l2_exportbuffer *e), vidioc_dqbuf (struct v4l2_buffer *b), vidioc_create_bufs (struct v4l2_create_buffers *b), vidioc_prepare_buf (struct v4l2_buffer *b), and vidioc_remove_bufs (struct v4l2_remove_buffers *d β€” note the *d, she's different πŸ’…).
  • vidioc_overlay taking unsigned int i, plus vidioc_g_fbuf (struct v4l2_framebuffer *a) and vidioc_s_fbuf (const struct v4l2_framebuffer *a).
  • streaming: vidioc_streamon and vidioc_streamoff, both enum v4l2_buf_type i.
  • standards: vidioc_g_std (v4l2_std_id *norm), vidioc_s_std (v4l2_std_id norm), vidioc_querystd (v4l2_std_id *a).
  • inputs and outputs: vidioc_enum_input (struct v4l2_input *inp), vidioc_g_input / vidioc_s_input (unsigned int *i / unsigned int i), and the matching vidioc_enum_output (struct v4l2_output *a), vidioc_g_output / vidioc_s_output (unsigned int *i / unsigned int i).
  • controls: vidioc_query_ext_ctrl (struct v4l2_query_ext_ctrl *a), vidioc_g_ext_ctrls, vidioc_s_ext_ctrls, vidioc_try_ext_ctrls (all struct v4l2_ext_controls *a), and vidioc_querymenu (struct v4l2_querymenu *a).
  • audio: vidioc_enumaudio, vidioc_g_audio, vidioc_s_audio (that last one const struct v4l2_audio *a), then vidioc_enumaudout, vidioc_g_audout, vidioc_s_audout (const struct v4l2_audioout *a).
  • vidioc_g_modulator (struct v4l2_modulator *a) and vidioc_s_modulator (const struct v4l2_modulator *a).
  • vidioc_g_pixelaspect β€” the iconique one taking int buf_type, struct v4l2_fract *aspect.
  • vidioc_g_selection / vidioc_s_selection, both struct v4l2_selection *s.
  • vidioc_g_jpegcomp (struct v4l2_jpegcompression *a) / vidioc_s_jpegcomp (const struct v4l2_jpegcompression *a), and vidioc_g_enc_index (struct v4l2_enc_idx *a).
  • encoder/decoder cmd quartet: vidioc_encoder_cmd, vidioc_try_encoder_cmd (both struct v4l2_encoder_cmd *a), vidioc_decoder_cmd, vidioc_try_decoder_cmd (both struct v4l2_decoder_cmd *a).
  • params: vidioc_g_parm / vidioc_s_parm, both struct v4l2_streamparm *a.
  • tuner + frequency block: vidioc_g_tuner (struct v4l2_tuner *a), vidioc_s_tuner (const struct v4l2_tuner *a), vidioc_g_frequency (struct v4l2_frequency *a), vidioc_s_frequency (const struct v4l2_frequency *a), vidioc_enum_freq_bands (struct v4l2_frequency_band *band).
  • vidioc_g_sliced_vbi_cap (struct v4l2_sliced_vbi_cap *a), and vidioc_log_status β€” the minimalist queen, she takes only struct file *file, void *priv and nothing else 😌
  • vidioc_s_hw_freq_seek (const struct v4l2_hw_freq_seek *a).
and then, tucked in the middle, the debug block: #ifdef CONFIG_VIDEO_ADV_DEBUG; with vidioc_g_register (struct v4l2_dbg_register *reg), vidioc_s_register (const struct v4l2_dbg_register *reg), and vidioc_g_chip_info (struct v4l2_dbg_chip_info *chip), closed by #endif;. those members only exist when that config is on, iykyk. (and yes, the semicolons after #ifdef / #endif are literally there in the page β€” I'm not touching them, don't come for me πŸ™ˆ)

and the grand finale, after the #endif;:

  • vidioc_enum_framesizes (struct v4l2_frmsizeenum *fsize)
  • vidioc_enum_frameintervals (struct v4l2_frmivalenum *fival)
  • vidioc_s_dv_timings, vidioc_g_dv_timings, vidioc_query_dv_timings β€” all struct v4l2_dv_timings *timings
  • vidioc_enum_dv_timings (struct v4l2_enum_dv_timings *timings)
  • vidioc_dv_timings_cap (struct v4l2_dv_timings_cap *cap)

ngl, reading that struct top to bottom is a whole cardio session πŸ’€ but that's the synopsis bestie, every pointer accounted for, no cap πŸ”₯

           int (*vidioc_g_edid)(struct file *file, void *priv, struct v4l2_edid
       *edid);
           int (*vidioc_s_edid)(struct file *file, void *priv, struct v4l2_edid
       *edid);
           int (*vidioc_subscribe_event)(struct v4l2_fh *fh, const struct
       v4l2_event_subscription *sub);
           int (*vidioc_unsubscribe_event)(struct v4l2_fh *fh, const struct
       v4l2_event_subscription *sub);
           long (*vidioc_default)(struct file *file, void *priv, bool
       valid_prio, unsigned int cmd, void *arg);
        };

πŸŽ€ Members πŸŽ€

okay so this is the whole roster, bestie β€” every single function pointer in the struct, what it's for, and which ioctl it's serving. πŸ’–

tiny heads up on the formatting: where you see something like VIDIOC_QUERYCAP (vidioc_querycap), the second bit is the doc reference target β€” same name as the ioctl's own section. Keeping both so you never get lost, bestie 🫢
  • vidioc_querycap β€” pointer to the function that implements the VIDIOC_QUERYCAP (vidioc_querycap) ioctl ✨
  • vidioc_enum_fmt_vid_cap β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for video capture in single and multi plane mode πŸŽ€
  • vidioc_enum_fmt_vid_overlay β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for video overlay
  • vidioc_enum_fmt_vid_out β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for video output in single and multi plane mode
  • vidioc_enum_fmt_sdr_cap β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for Software Defined Radio capture πŸ“»
  • vidioc_enum_fmt_sdr_out β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for Software Defined Radio output
  • vidioc_enum_fmt_meta_cap β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for metadata capture
  • vidioc_enum_fmt_meta_out β€” pointer to the function that implements the VIDIOC_ENUM_FMT (vidioc_enum_fmt) ioctl logic for metadata output

🌸 the G_FMT girlies (get it? …get it? 😭)

  • vidioc_g_fmt_vid_cap β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video capture in single plane mode
  • vidioc_g_fmt_vid_overlay β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video overlay
  • vidioc_g_fmt_vid_out β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video out in single plane mode
  • vidioc_g_fmt_vid_out_overlay β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video overlay output
  • vidioc_g_fmt_vbi_cap β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for raw VBI capture
  • vidioc_g_fmt_vbi_out β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for raw VBI output
  • vidioc_g_fmt_sliced_vbi_cap β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for sliced VBI capture πŸ”ͺ (sliced, not spicy, it's a VBI thing)
  • vidioc_g_fmt_sliced_vbi_out β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for sliced VBI output
  • vidioc_g_fmt_vid_cap_mplane β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video capture in multiple plane mode
  • vidioc_g_fmt_vid_out_mplane β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for video out in multiplane plane mode πŸ‘‘ (yes, "multiplane plane" β€” that's literally what it says, don't come for me)
  • vidioc_g_fmt_sdr_cap β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio capture
  • vidioc_g_fmt_sdr_out β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio output
  • vidioc_g_fmt_meta_cap β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for metadata capture
  • vidioc_g_fmt_meta_out β€” pointer to the function that implements the VIDIOC_G_FMT (vidioc_g_fmt) ioctl logic for metadata output

πŸ’… the S_FMT set (setting the vibe, literally)

  • vidioc_s_fmt_vid_cap β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video capture in single plane mode
  • vidioc_s_fmt_vid_overlay β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video overlay
  • vidioc_s_fmt_vid_out β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video out in single plane mode
  • vidioc_s_fmt_vid_out_overlay β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video overlay output
  • vidioc_s_fmt_vbi_cap β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for raw VBI capture
  • vidioc_s_fmt_vbi_out β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for raw VBI output
  • vidioc_s_fmt_sliced_vbi_cap β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for sliced VBI capture
  • vidioc_s_fmt_sliced_vbi_out β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for sliced VBI output
  • vidioc_s_fmt_vid_cap_mplane β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video capture in multiple plane mode
  • vidioc_s_fmt_vid_out_mplane β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for video out in multiplane plane mode
  • vidioc_s_fmt_sdr_cap β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio capture
  • vidioc_s_fmt_sdr_out β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio output
  • vidioc_s_fmt_meta_cap β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for metadata capture
  • vidioc_s_fmt_meta_out β€” pointer to the function that implements the VIDIOC_S_FMT (vidioc_g_fmt) ioctl logic for metadata output

πŸ¦‹ the TRY_FMT crew (the "what if" girls, no commitment πŸ’€)

  • vidioc_try_fmt_vid_cap β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video capture in single plane mode
  • vidioc_try_fmt_vid_overlay β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video overlay
  • vidioc_try_fmt_vid_out β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video out in single plane mode
  • vidioc_try_fmt_vid_out_overlay β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video overlay output
  • vidioc_try_fmt_vbi_cap β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for raw VBI capture
  • vidioc_try_fmt_vbi_out β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for raw VBI output
  • vidioc_try_fmt_sliced_vbi_cap β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for sliced VBI capture
  • vidioc_try_fmt_sliced_vbi_out β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for sliced VBI output
  • vidioc_try_fmt_vid_cap_mplane β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video capture in multiple plane mode
  • vidioc_try_fmt_vid_out_mplane β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for video out in multiplane plane mode
  • vidioc_try_fmt_sdr_cap β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio capture
  • vidioc_try_fmt_sdr_out β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for Software Defined Radio output
  • vidioc_try_fmt_meta_cap β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for metadata capture
  • vidioc_try_fmt_meta_out β€” pointer to the function that implements the VIDIOC_TRY_FMT (vidioc_g_fmt) ioctl logic for metadata output

πŸ“ buffer business (the whole qbuf/dqbuf economy, iykyk)

  • vidioc_reqbufs β€” pointer to the function that implements the VIDIOC_REQBUFS (vidioc_reqbufs) ioctl
  • vidioc_querybuf β€” pointer to the function that implements the VIDIOC_QUERYBUF (vidioc_querybuf) ioctl
  • vidioc_qbuf β€” pointer to the function that implements the VIDIOC_QBUF (vidioc_qbuf) ioctl
  • vidioc_expbuf β€” pointer to the function that implements the VIDIOC_EXPBUF (vidioc_expbuf) ioctl πŸ“€
  • vidioc_dqbuf β€” pointer to the function that implements the VIDIOC_DQBUF (vidioc_qbuf) ioctl
  • vidioc_create_bufs β€” pointer to the function that implements the VIDIOC_CREATE_BUFS (vidioc_create_bufs) ioctl ✨
  • vidioc_prepare_buf β€” pointer to the function that implements the VIDIOC_PREPARE_BUF (vidioc_prepare_buf) ioctl
  • vidioc_remove_bufs β€” pointer to the function that implements the VIDIOC_REMOVE_BUFS (vidioc_remove_bufs) ioctl πŸ—‘οΈ

🌈 overlay & framebuffer icons

  • vidioc_overlay β€” pointer to the function that implements the VIDIOC_OVERLAY (vidioc_overlay) ioctl
  • vidioc_g_fbuf β€” pointer to the function that implements the VIDIOC_G_FBUF (vidioc_g_fbuf) ioctl
  • vidioc_s_fbuf β€” pointer to the function that implements the VIDIOC_S_FBUF (vidioc_g_fbuf) ioctl
not me noticing that vidioc_s_fbuf points at the vidioc_g_fbuf reference while the others point at their own β€” that's just how the page has it, so I'm passing it to you exactly as-is, bestie πŸ™ˆ

  • vidioc_streamon β€” the pointer that runs the VIDIOC_STREAMON ioctl, aka press play on the stream πŸ”₯
  • vidioc_streamoff β€” the pointer that runs the VIDIOC_STREAMOFF ioctl, aka the stop button πŸ’…
  • vidioc_g_std β€” pointer to the function implementing the VIDIOC_G_STD ioctl
  • vidioc_s_std β€” pointer to the function implementing the VIDIOC_S_STD ioctl
  • vidioc_querystd β€” pointer to the function implementing the VIDIOC_QUERYSTD ioctl
  • vidioc_enum_input β€” pointer to the function implementing the VIDIOC_ENUM_INPUT ioctl
  • vidioc_g_input β€” pointer to the function implementing the VIDIOC_G_INPUT ioctl
  • vidioc_s_input β€” pointer to the function implementing the VIDIOC_S_INPUT ioctl
  • vidioc_enum_output β€” pointer to the function implementing the VIDIOC_ENUM_OUTPUT ioctl
  • vidioc_g_output β€” pointer to the function implementing the VIDIOC_G_OUTPUT ioctl
  • vidioc_s_output β€” pointer to the function implementing the VIDIOC_S_OUTPUT ioctl
  • vidioc_query_ext_ctrl β€” pointer to the function implementing the VIDIOC_QUERY_EXT_CTRL ioctl
  • vidioc_g_ext_ctrls β€” pointer to the function implementing the VIDIOC_G_EXT_CTRLS ioctl
  • vidioc_s_ext_ctrls β€” pointer to the function implementing the VIDIOC_S_EXT_CTRLS ioctl
  • vidioc_try_ext_ctrls β€” pointer to the function implementing the VIDIOC_TRY_EXT_CTRLS ioctl
  • vidioc_querymenu β€” pointer to the function implementing the VIDIOC_QUERYMENU ioctl
  • vidioc_enumaudio β€” pointer to the function implementing the VIDIOC_ENUMAUDIO ioctl
  • vidioc_g_audio β€” pointer to the function implementing the VIDIOC_G_AUDIO ioctl
  • vidioc_s_audio β€” pointer to the function implementing the VIDIOC_S_AUDIO ioctl
  • vidioc_enumaudout β€” pointer to the function implementing the VIDIOC_ENUMAUDOUT ioctl
  • vidioc_g_audout β€” pointer to the function implementing the VIDIOC_G_AUDOUT ioctl
  • vidioc_s_audout β€” pointer to the function implementing the VIDIOC_S_AUDOUT ioctl
  • vidioc_g_modulator β€” pointer to the function implementing the VIDIOC_G_MODULATOR ioctl
  • vidioc_s_modulator β€” pointer to the function implementing the VIDIOC_S_MODULATOR ioctl
  • vidioc_g_pixelaspect β€” pointer to the function implementing the pixelaspect part of the VIDIOC_CROPCAP ioctl ✨ (just that part, bestie, not the whole cropcap situation)
  • vidioc_g_selection β€” pointer to the function implementing the VIDIOC_G_SELECTION ioctl
  • vidioc_s_selection β€” pointer to the function implementing the VIDIOC_S_SELECTION ioctl
  • vidioc_g_jpegcomp β€” pointer to the function implementing the VIDIOC_G_JPEGCOMP ioctl
  • vidioc_s_jpegcomp β€” pointer to the function implementing the VIDIOC_S_JPEGCOMP ioctl
  • vidioc_g_enc_index β€” pointer to the function implementing the VIDIOC_G_ENC_INDEX ioctl
  • vidioc_encoder_cmd β€” pointer to the function implementing the VIDIOC_ENCODER_CMD ioctl
  • vidioc_try_encoder_cmd β€” pointer to the function implementing the VIDIOC_TRY_ENCODER_CMD ioctl
  • vidioc_decoder_cmd β€” pointer to the function implementing the VIDIOC_DECODER_CMD ioctl
  • vidioc_try_decoder_cmd β€” pointer to the function implementing the VIDIOC_TRY_DECODER_CMD ioctl
  • vidioc_g_parm β€” pointer to the function implementing the VIDIOC_G_PARM ioctl
  • vidioc_s_parm β€” pointer to the function implementing the VIDIOC_S_PARM ioctl
  • vidioc_g_tuner β€” pointer to the function implementing the VIDIOC_G_TUNER ioctl
  • vidioc_s_tuner β€” pointer to the function implementing the VIDIOC_S_TUNER ioctl
  • vidioc_g_frequency β€” pointer to the function implementing the VIDIOC_G_FREQUENCY ioctl
  • vidioc_s_frequency β€” pointer to the function implementing the VIDIOC_S_FREQUENCY ioctl
  • vidioc_enum_freq_bands β€” pointer to the function implementing the VIDIOC_ENUM_FREQ_BANDS ioctl
  • vidioc_g_sliced_vbi_cap β€” pointer to the function implementing the VIDIOC_G_SLICED_VBI_CAP ioctl
  • vidioc_log_status β€” pointer to the function implementing the VIDIOC_LOG_STATUS ioctl
  • vidioc_s_hw_freq_seek β€” pointer to the function implementing the VIDIOC_S_HW_FREQ_SEEK ioctl
  • vidioc_g_register β€” pointer to the function implementing the VIDIOC_DBG_G_REGISTER ioctl
  • vidioc_s_register β€” pointer to the function implementing the VIDIOC_DBG_S_REGISTER ioctl
  • vidioc_g_chip_info β€” pointer to the function implementing the VIDIOC_DBG_G_CHIP_INFO ioctl
  • vidioc_enum_framesizes β€” pointer to the function implementing the VIDIOC_ENUM_FRAMESIZES ioctl
  • vidioc_enum_frameintervals β€” pointer to the function implementing the VIDIOC_ENUM_FRAMEINTERVALS ioctl
  • vidioc_s_dv_timings β€” pointer to the function implementing the VIDIOC_S_DV_TIMINGS ioctl
  • vidioc_g_dv_timings β€” pointer to the function implementing the VIDIOC_G_DV_TIMINGS ioctl
  • vidioc_query_dv_timings β€” pointer to the function implementing the VIDIOC_QUERY_DV_TIMINGS ioctl
  • vidioc_enum_dv_timings β€” pointer to the function implementing the VIDIOC_ENUM_DV_TIMINGS ioctl
  • vidioc_dv_timings_cap β€” pointer to the function implementing the VIDIOC_DV_TIMINGS_CAP ioctl
  • vidioc_g_edid β€” pointer to the function implementing the VIDIOC_G_EDID ioctl
  • vidioc_s_edid β€” pointer to the function implementing the VIDIOC_S_EDID ioctl
  • vidioc_subscribe_event β€” pointer to the function implementing the VIDIOC_SUBSCRIBE_EVENT ioctl
  • vidioc_unsubscribe_event β€” pointer to the function implementing the VIDIOC_UNSUBSCRIBE_EVENT ioctl
  • vidioc_default β€” the catch-all pointer, pointed used to allow other ioctls 🫢 (yes, it's the "anything else? sure babe" slot)

🌈 SEE ALSO 🌈

Kernel file ./include/media/v4l2-ioctl.h, plus the whole friend group of related functions β€” go say hi πŸ‘‹


That's the whole struct, bestie β€” every single pointer accounted for, no cap πŸ’― 59 little function pointers and not one skipped. You ate that. πŸŽ€

And that's a wrap on struct v4l2_ioctl_ops(9)! This page lives in ./include/media, version is October 2026, and the footer calls it struct v4l2_ioctl_ops(9) β€” iconic, timeless, very demure. Mwah πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from