v4l2_ctrl_new_std_compound(9)
π 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, nglidβ 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, literallyp_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:
union v4l2_ctrl_ptr(9),v4l2_ctrl_ptr_create(9)struct v4l2_ctrl_ops(9),struct v4l2_ctrl_type_ops(9),v4l2_ctrl_notify_fnc(9)struct v4l2_ctrl(9),struct v4l2_ctrl_ref(9)struct v4l2_ctrl_handler(9),struct v4l2_ctrl_config(9),v4l2_ctrl_fill(9)v4l2_ctrl_handler_init_class(9),v4l2_ctrl_handler_init(9),v4l2_ctrl_handler_free(9)v4l2_ctrl_lock(9),v4l2_ctrl_unlock(9)__v4l2_ctrl_handler_setup(9),v4l2_ctrl_handler_setup(9),v4l2_ctrl_handler_log_status(9)v4l2_ctrl_new_custom(9),v4l2_ctrl_new_std(9),v4l2_ctrl_new_std_menu(9)v4l2_ctrl_new_std_menu_items(9),v4l2_ctrl_new_int_menu(9)v4l2_ctrl_filter(9),v4l2_ctrl_add_handler(9),v4l2_ctrl_radio_filter(9)v4l2_ctrl_cluster(9),v4l2_ctrl_auto_cluster(9),v4l2_ctrl_find(9)v4l2_ctrl_activate(9),__v4l2_ctrl_grab(9),v4l2_ctrl_grab(9)__v4l2_ctrl_modify_range(9),v4l2_ctrl_modify_range(9)__v4l2_ctrl_modify_dimensions(9),v4l2_ctrl_modify_dimensions(9)v4l2_ctrl_notify(9),v4l2_ctrl_get_name(9),v4l2_ctrl_get_menu(9),v4l2_ctrl_get_int_menu(9)v4l2_ctrl_g_ctrl(9),__v4l2_ctrl_s_ctrl(9),v4l2_ctrl_s_ctrl(9)v4l2_ctrl_g_ctrl_int64(9),__v4l2_ctrl_s_ctrl_int64(9),v4l2_ctrl_s_ctrl_int64(9)__v4l2_ctrl_s_ctrl_string(9),v4l2_ctrl_s_ctrl_string(9)__v4l2_ctrl_s_ctrl_compound(9),v4l2_ctrl_s_ctrl_compound(9)v4l2_ctrl_replace(9),v4l2_ctrl_merge(9),v4l2_ctrl_log_status(9)v4l2_ctrl_subscribe_event(9),v4l2_ctrl_poll(9)v4l2_ctrl_request_setup(9),v4l2_ctrl_request_complete(9)v4l2_ctrl_request_hdl_find(9),v4l2_ctrl_request_hdl_put(9),v4l2_ctrl_request_hdl_ctrl_find(9)v4l2_queryctrl(9),v4l2_query_ext_ctrl_to_v4l2_queryctrl(9),v4l2_query_ext_ctrl(9),v4l2_querymenu(9)v4l2_g_ctrl(9),v4l2_s_ctrl(9)v4l2_g_ext_ctrls(9),v4l2_try_ext_ctrls(9),v4l2_s_ext_ctrls(9)v4l2_ctrl_subdev_subscribe_event(9),v4l2_ctrl_subdev_log_status(9)v4l2_ctrl_new_fwnode_properties(9)v4l2_ctrl_type_op_equal(9),v4l2_ctrl_type_op_init(9),v4l2_ctrl_type_op_log(9),v4l2_ctrl_type_op_validate(9)
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
- 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