UNION V4L2_CTRL_PTR(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… union v4l2_ctrl_ptr β€” a pointer to a control value

okay bestie, welcome to the Kernel API Manual ✨ this one is genuinely so satisfying to look at, because it's just... one union that can point at literally everything a V4L2 control could possibly hold. it's giving "one bag, infinite outfits" πŸŽ€


🌸 NAME

union v4l2_ctrl_ptr β€” a pointer to a control value, periodt πŸ’–


✨ SYNOPSIS

union v4l2_ctrl_ptr {
    s32 *p_s32;
    s64 *p_s64;
    u8 *p_u8;
    u16 *p_u16;
    u32 *p_u32;
    char *p_char;
    struct v4l2_ctrl_mpeg2_sequence *p_mpeg2_sequence;
    struct v4l2_ctrl_mpeg2_picture *p_mpeg2_picture;
    struct v4l2_ctrl_mpeg2_quantisation *p_mpeg2_quantisation;
    struct v4l2_ctrl_fwht_params *p_fwht_params;
    struct v4l2_ctrl_h264_sps *p_h264_sps;
    struct v4l2_ctrl_h264_pps *p_h264_pps;
    struct v4l2_ctrl_h264_scaling_matrix *p_h264_scaling_matrix;
    struct v4l2_ctrl_h264_slice_params *p_h264_slice_params;
    struct v4l2_ctrl_h264_decode_params *p_h264_decode_params;
    struct v4l2_ctrl_h264_pred_weights *p_h264_pred_weights;
    struct v4l2_ctrl_vp8_frame *p_vp8_frame;
    struct v4l2_ctrl_hevc_sps *p_hevc_sps;
    struct v4l2_ctrl_hevc_pps *p_hevc_pps;
    struct v4l2_ctrl_hevc_slice_params *p_hevc_slice_params;
    struct v4l2_ctrl_vp9_compressed_hdr *p_vp9_compressed_hdr_probs;
    struct v4l2_ctrl_vp9_frame *p_vp9_frame;
    struct v4l2_ctrl_hdr10_cll_info *p_hdr10_cll;
    struct v4l2_ctrl_hdr10_mastering_display *p_hdr10_mastering;
    struct v4l2_area *p_area;
    struct v4l2_ctrl_av1_sequence *p_av1_sequence;
    struct v4l2_ctrl_av1_tile_group_entry *p_av1_tile_group_entry;
    struct v4l2_ctrl_av1_frame *p_av1_frame;
    struct v4l2_ctrl_av1_film_grain *p_av1_film_grain;
    struct v4l2_rect *p_rect;
    void *p;
    const void *p_const;
 };

like… look at her. 32 members, all chillin' in one union, zero drama (as long as you only use one at a time, iykyk πŸ™ˆ).


πŸ¦‹ Members

πŸ“ the little scalar girlies

  • p_s32 β€” pointer to a 32-bit signed value.
  • p_s64 β€” pointer to a 64-bit signed value.
  • p_u8 β€” pointer to a 8-bit unsigned value.
  • p_u16 β€” pointer to a 16-bit unsigned value.
  • p_u32 β€” pointer to a 32-bit unsigned value.
  • p_char β€” pointer to a string. yes she's a char pointer, she's classy like that πŸ’…

πŸŽ€ MPEG2 + FWHT era

  • p_mpeg2_sequence β€” pointer to a MPEG2 sequence structure.
  • p_mpeg2_picture β€” pointer to a MPEG2 picture structure.
  • p_mpeg2_quantisation β€” pointer to a MPEG2 quantisation data structure.
  • p_fwht_params β€” pointer to a FWHT stateless parameters structure.

πŸ”₯ H.264 squad (six of them, she's thorough)

  • p_h264_sps β€” pointer to a struct v4l2_ctrl_h264_sps.
  • p_h264_pps β€” pointer to a struct v4l2_ctrl_h264_pps.
  • p_h264_scaling_matrix β€” pointer to a struct v4l2_ctrl_h264_scaling_matrix.
  • p_h264_slice_params β€” pointer to a struct v4l2_ctrl_h264_slice_params.
  • p_h264_decode_params β€” pointer to a struct v4l2_ctrl_h264_decode_params.
  • p_h264_pred_weights β€” pointer to a struct v4l2_ctrl_h264_pred_weights.

🌈 VP8 says hi once

  • p_vp8_frame β€” pointer to a VP8 frame params structure.

🧚 HEVC trio

  • p_hevc_sps β€” pointer to an HEVC sequence parameter set structure.
  • p_hevc_pps β€” pointer to an HEVC picture parameter set structure.
  • p_hevc_slice_params β€” pointer to an HEVC slice parameters structure.

πŸ’œ VP9 duo

  • p_vp9_compressed_hdr_probs β€” pointer to a VP9 frame compressed header probs structure.
  • p_vp9_frame β€” pointer to a VP9 frame params structure.

⭐ HDR10 glow-up

  • p_hdr10_cll β€” pointer to an HDR10 Content Light Level structure.
  • p_hdr10_mastering β€” pointer to an HDR10 Mastering Display structure.

🌸 geometry moment

  • p_area β€” pointer to an area.

πŸ‘‘ AV1 besties

  • p_av1_sequence β€” pointer to an AV1 sequence structure.
  • p_av1_tile_group_entry β€” pointer to an AV1 tile group entry structure.
  • p_av1_frame β€” pointer to an AV1 frame structure.
  • p_av1_film_grain β€” pointer to an AV1 film grain structure.

🫢 and the catch-alls

  • p_rect β€” pointer to a rectangle.
  • p β€” pointer to a compound value.
  • p_const β€” pointer to a constant compound value. (const-correct queen πŸ‘‘)

πŸ” SEE ALSO

okay this list is LONG and honestly iconic, buckle up:

kernel file ./include/media/v4l2-ctrls.h, 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_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 I said. LONG. but every single one of them ate πŸ’…


ngl, this page lives in ./include/media, dated October 2026 β€” that's the source and the version, bestie, and that's the whole manual page πŸ’– mwah, go point at some control values responsibly βœ¨πŸŽ€
πŸ“¦ where this page comes from