v4l2_ctrl_new_std_compound(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… v4l2_ctrl_new_std_compound β€” the Kernel API Manual glow-up πŸŽ€

okay bestie, grab your boba because we're diving into v4l2_ctrl_new_std_compound from the Kernel API Manual and honestly? it's giving "small function, big responsibilities" ✨


✨ NAME ✨

v4l2_ctrl_new_std_compound β€” allocates AND initializes a brand-new standard V4L2 compound control. that's it, that's the whole vibe. πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

struct v4l2_ctrl * v4l2_ctrl_new_std_compound (struct v4l2_ctrl_handler
*hdl , const struct v4l2_ctrl_ops *ops , u32 id , const union
v4l2_ctrl_ptr p_def , const union v4l2_ctrl_ptr p_min , const union
v4l2_ctrl_ptr p_max );

like, six arguments, one function, zero chill. 😭


🌸 ARGUMENTS 🌸

  • hdl β€” the control handler. the main character, the one who holds everything together 🫢
  • ops β€” the control ops. the whole personality of the control, ngl
  • id β€” the control ID. your control's little name tag πŸŽ€
  • p_def β€” the control's default value. the factory settings era ✨
  • p_min β€” the control's minimum value. the floor, literally
  • p_max β€” the control's maximum value. the ceiling, the limit, the "no further" πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so this one is same as v4l2_ctrl_new_std β€” but with support for compound controls πŸ’– say it back.

to fill in the p_def, p_min and p_max fields, you use v4l2_ctrl_ptr_create to convert a pointer to a const union v4l2_ctrl_ptr. cute, right?

and here's the slay shortcut: use v4l2_ctrl_ptr_create(NULL) if you want the default, minimum or maximum value of the compound control to be all zeroes. zeroes everywhere, no notes. ⭐

okay and this part matters β€” if the compound control does not set the V4L2_CTRL_FLAG_HAS_WHICH_MIN_MAX flag, then it doesn't have minimum and maximum values. so in that case just use v4l2_ctrl_ptr_create(NULL) for the p_min and p_max arguments. no min, no max, no problem πŸ¦‹

bestie pls don't skip this part, it's the whole plot πŸ™ˆ

πŸ’œ SEE ALSO πŸ’œ

the crossover episode nobody asked for but everybody needed β€” the kernel file ./include/media/v4l2-ctrls.h and the entire ctrl extended universe:

like, it's a whole friend group at this point πŸ’€


and that's the tea β˜• β€” this page lives in ./include/media, dated October 2026, and it's part of the Kernel API Manual. mwah, go write some compound controls bestie πŸ’–βœ¨πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from