STRUCT V4L2_SUBDEV_VIDEO_OPS(9)
π struct v4l2_subdev_video_ops(9) β Kernel API Manual π
okay so welcome to the Kernel API Manual, bestie πΈ β this page is all about struct v4l2_subdev_video_ops, the callback collection that gets used when a v4l device was opened in video mode. yes that's the whole vibe. let's get into it β¨
β¨ NAME β¨
struct v4l2_subdev_video_ops β Callbacks used when v4l device was opened in video mode. π₯
π¦ SYNOPSIS π¦
struct v4l2_subdev_video_ops {
int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
int (*g_std)(struct v4l2_subdev *sd, v4l2_std_id *norm);
int (*s_std)(struct v4l2_subdev *sd, v4l2_std_id norm);
int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std);
int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
int (*g_tvnorms)(struct v4l2_subdev *sd, v4l2_std_id *std);
int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
int (*s_stream)(struct v4l2_subdev *sd, int enable);
int (*s_rx_buffer)(struct v4l2_subdev *sd, void *buf, unsigned int *size);
int (*pre_streamon)(struct v4l2_subdev *sd, u32 flags);
int (*post_streamoff)(struct v4l2_subdev *sd);
};
π«Ά Members π«Ά
s_routingβ sees_routinginaudio_ops, except this version is for video devices. same energy, video edition πs_crystal_freqβ sets the frequency of the crystal used to generate the clocks in Hz. an extraflagsfield allows device specific configuration regarding clock frequency dividers, etc. If not used, then setflagsto0. If the frequency is not supported, then-EINVALis returned. classic. πg_stdβ callback forVIDIOC_G_STDioctl handler code.s_stdβ callback forVIDIOC_S_STDioctl handler code.s_std_outputβ setv4l2_std_idfor video OUTPUT devices. This is ignored by video input devices. rude but ok πg_std_outputβ get current standard for video OUTPUT devices. This is ignored by video input devices.querystdβ callback forVIDIOC_QUERYSTDioctl handler code.g_tvnormsβ getv4l2_std_idwith all standards supported by the video CAPTURE device. This is ignored by video output devices.g_tvnorms_outputβ getv4l2_std_idwith all standards supported by the video OUTPUT device. This is ignored by video capture devices.g_input_statusβ get input status. Same as thestatusfield in thestruct v4l2_input. iykyk πs_streamβ start (enabled == 1) or stop (enabled == 0) streaming on the sub-device. Failure on stop will remove any resources acquired in streaming start, while the error code is still returned by the driver. The caller shall track the subdev state, and shall not start or stop an already started or stopped subdev. Also seecall_s_streamwrapper inv4l2-subdev.c. βs_rx_bufferβ set a host allocated memory buffer for the subdev. The subdev can adjustsizeto a lower value and must not write more data to the buffer starting atdatathan the original value ofsize. girl, respect the bounds π₯pre_streamonβ May be called before streaming is actually started, to help initialising the bus. Current usage is to set a CSI-2 transmitter to LP-11 or LP-111 mode before streaming. Seeenum v4l2_subdev_pre_streamon_flags. π§post_streamoffβ Called after streaming is stopped, but if and only ifpre_streamonwas called earlier. the way that these two are literally a matched set π
π Description π
This callback is DEPRECATED. π¨
New drivers should instead implement v4l2_subdev_pad_ops.enable_streams and v4l2_subdev_pad_ops.disable_streams operations, and use v4l2_subdev_s_stream_helper for the v4l2_subdev_video_ops.s_stream operation to support legacy users.
Drivers should also not call the .s_stream subdev operation directly, but use the v4l2_subdev_enable_streams and v4l2_subdev_disable_streams helpers.
pre_streamon shall return error if it cannot perform the operation as indicated by the flags argument. In particular, -EACCES indicates lack of support for the operation. The caller shall call post_streamoff for each successful call of pre_streamon. no cap, that's the contract π
π SEE ALSO π
Kernel file ./include/media/v4l2-subdev.h β plus the whole girliepop extended universe πΈ:
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_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_format(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)
and that's the page, bestie π β brought to you straight out of ./include/media, October 2026 edition, main character manual energy only β¨π«Άπ
π¦ 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