v4l2_ctrl_modify_dimensions(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… v4l2_ctrl_modify_dimensions(9)

okay bestie, welcome to the Kernel API Manual β€” yes, that Kernel API Manual β€” and today's main character is v4l2_ctrl_modify_dimensions. she's a tiny little function that messes with the shape of your array controls on the fly, and honestly? iconic. πŸŽ€


✨ NAME ✨

v4l2_ctrl_modify_dimensions β€” Update the dimensions of an array control. πŸ¦‹


🌸 SYNOPSIS 🌸

int v4l2_ctrl_modify_dimensions (struct v4l2_ctrl *ctrl , u32
       dims[V4L2_CTRL_MAX_DIMS] );

πŸŽ€ ARGUMENTS πŸŽ€

  • ctrl β€” The control to update. like, the actual one you're changing. her. πŸ‘‘
  • dims β€” The control's new dimensions. the new fit, the new silhouette, the new vibe check. ✨

πŸ’– DESCRIPTION πŸ’–

so here's the tea: this function lets you Update the dimensions of an array control on the fly. no cap, mid-flight resize. πŸ¦‹

and because the universe loves a hard reset, the elements of the array are reset to their default value β€” even if the dimensions are unchanged. yep. even then. you look at it, you go "same shape", and it still wipes the elements back to default. no notes, that's just how it is. 😭

An error is returned if dims is invalid for this control type. invalid dims = no slay, error only. πŸ™ˆ

also important, and i need you to hear me on this one: This function assumes that the control handler is not locked and will take the lock itself. so don't be out here double-locking, bestie, she's got it covered. πŸ”₯


⭐ NOTE ⭐

calling this function when the same control is used in pending requests is untested. lowkey it should work β€” a request with the wrong size of the control will drop that control silently β€” but it will be very confusing. πŸ’€ like, it'll work but you'll be sitting there like "...what just happened". you've been warned, fr fr.


🫢 SEE ALSO 🫢

okay this list is long, so buckle up. Kernel file ./include/media/v4l2-ctrls.h, plus: 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_std_compound(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_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)


πŸ’€ real talk before you go: if dims isn't valid for this control type, you get an error. and remember the reset-to-default behaviour β€” it happens even when the dimensions didn't change. she does not skip the reset. periodt.

and that's the whole page, bestie!! 🧚 this one came from source ./include/media, version/date October 2026, and it's v4l2_ctrl_modify_dimensions(9) signing off. mwah. πŸ’œπŸ“

πŸ“¦ where this page comes from