v4l2_subdev_...e_get_format(9)
π v4l2_subdev_state_get_format(9) β a Kernel API Manual moment π
okay so bestie, we're in the Kernel API Manual today and I need you to lock in for like 30 seconds because this one is actually so chill once you get it. it's giving "find my format" energy and honestly? iconic.
β¨ NAME β¨
v4l2_subdev_state_get_format β Get pointer to a stream format π«Ά
π¦ SYNOPSIS π¦
v4l2_subdev_state_get_format (state , pad , ... );
like literally just those three things, no cap β¨
πΈ ARGUMENTS πΈ
stateβ the subdevice state, your main character struct πpadβ the pad id, iykyk π...β the stream id, and it's optional (yes bestie, you can skip it, she's flexible π)
π DESCRIPTION π
so what does she actually do? This returns a pointer to struct v4l2_mbus_framefmt for the given pad + stream in the subdev state. that's it. that's the whole vibe. you give her a pad and a stream, she hands you a pointer to the framefmt. slay π
and for the stream-unaware drivers out there β you know, the ones that aren't doing the whole stream thing β the format for the corresponding pad is returned. she's got you either way, fr fr π§
β οΈ but listen: if the pad does not exist, NULL is returned. so please, for the love of everything, check your pointer before you dereference it π that's not a fun crash to debug, trust.
π SEE ALSO π
okay this list is long but I promised I would not skip a single one because every detail matters bestie π starting with the kernel file ./include/media/v4l2-subdev.h and then:
struct v4l2_decode_vbi_line(9)enum v4l2_subdev_io_pin_bits(9)struct v4l2_subdev_io_pin_config(9)struct v4l2_subdev_core_ops(9)struct v4l2_subdev_tuner_ops(9)struct v4l2_subdev_audio_ops(9)struct v4l2_mbus_frame_desc_entry_csi2(9)enum v4l2_mbus_frame_desc_flags(9)struct v4l2_mbus_frame_desc_entry(9)enum v4l2_mbus_frame_desc_type(9)struct v4l2_mbus_frame_desc(9)enum v4l2_subdev_pre_streamon_flags(9)struct v4l2_subdev_video_ops(9)struct v4l2_subdev_vbi_ops(9)struct v4l2_subdev_sensor_ops(9)enum v4l2_subdev_ir_mode(9)struct v4l2_subdev_ir_parameters(9)struct v4l2_subdev_ir_ops(9)struct v4l2_subdev_pad_config(9)struct v4l2_subdev_stream_configs(9)struct v4l2_subdev_krouting(9)struct v4l2_subdev_state(9)struct v4l2_subdev_pad_ops(9)struct v4l2_subdev_ops(9)struct v4l2_subdev_internal_ops(9)struct v4l2_subdev_platform_data(9)struct v4l2_subdev(9)media_entity_to_v4l2_subdev(9)vdev_to_v4l2_subdev(9)struct v4l2_subdev_fh(9)to_v4l2_subdev_fh(9)v4l2_set_subdevdata(9)v4l2_get_subdevdata(9)v4l2_set_subdev_hostdata(9)v4l2_get_subdev_hostdata(9)v4l2_subdev_get_fwnode_pad_1_to_1(9)v4l2_subdev_link_validate_default(9)v4l2_subdev_link_validate(9)v4l2_subdev_has_pad_interdep(9)__v4l2_subdev_state_alloc(9)__v4l2_subdev_state_free(9)v4l2_subdev_init_finalize(9)v4l2_subdev_cleanup(9)v4l2_subdev_state_get_crop(9)v4l2_subdev_state_get_compose(9)v4l2_subdev_state_get_interval(9)v4l2_subdev_get_fmt(9)v4l2_subdev_get_frame_interval(9)v4l2_subdev_set_routing(9)for_each_active_route(9)v4l2_subdev_set_routing_with_fmt(9)v4l2_subdev_routing_find_opposite_end(9)v4l2_subdev_state_get_opposite_stream_format(9)v4l2_subdev_state_xlate_streams(9)enum v4l2_subdev_routing_restriction(9)v4l2_subdev_routing_validate(9)v4l2_subdev_enable_streams(9)v4l2_subdev_disable_streams(9)v4l2_subdev_s_stream_helper(9)__v4l2_subdev_get_frame_desc_passthrough(9)v4l2_subdev_get_frame_desc_passthrough(9)v4l2_subdev_lock_state(9)v4l2_subdev_unlock_state(9)v4l2_subdev_lock_states(9)v4l2_subdev_unlock_states(9)v4l2_subdev_get_unlocked_active_state(9)v4l2_subdev_get_locked_active_state(9)v4l2_subdev_lock_and_get_active_state(9)v4l2_subdev_init(9)v4l2_subdev_call(9)v4l2_subdev_call_state_active(9)v4l2_subdev_call_state_try(9)v4l2_subdev_has_op(9)v4l2_subdev_notify_event(9)v4l2_subdev_is_streaming(9)
like I said. long. but she ate and left no crumbs π
and that's the whole page bestie!! π this lil cutie lives over in ./include/media, dated October 2026, and she goes by v4l2_subdev_...e_get_format(9) if you ever need to find her again. mwah π«Άβ¨
π¦ 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