STRUCT V4L2_SUBDEV_VBI_OPS(9)
π NAME π
Okay so welcome to the Kernel API Manual, bestie β this is the page for struct v4l2_subdev_vbi_ops(9), and it's literally the set of callbacks used when a v4l device was opened in video mode via the vbi device node. That's the whole vibe. π¦
β¨ SYNOPSIS β¨
struct v4l2_subdev_vbi_ops {
int (*decode_vbi_line)(struct v4l2_subdev *sd, struct v4l2_decode_vbi_line *vbi_line);
int (*s_vbi_data)(struct v4l2_subdev *sd, const struct v4l2_sliced_vbi_data *vbi_data);
int (*g_vbi_data)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_data *vbi_data);
int (*g_sliced_vbi_cap)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_cap *cap);
int (*s_raw_fmt)(struct v4l2_subdev *sd, struct v4l2_vbi_format *fmt);
int (*g_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt);
};
π Members π
decode_vbi_lineβ so if your video decoder supports sliced VBI, you have to implement this ioctl, no skipping. Fieldpof thestruct v4l2_decode_vbi_linegets set to the start of the VBI data that the decoder generated, and then the driver parses that sliced VBI data and sets the other fields in the struct to match. The pointerpgets updated to point at the start of the payload, which you can copy verbatim into thedatafield ofstruct v4l2_sliced_vbi_data. And if no valid VBI data was found? Thetypefield is set to0on return. Iconic behaviour honestly. β¨s_vbi_dataβ this one's for generating VBI signals on a video signal.struct v4l2_sliced_vbi_datagets filled with the data packets that should be output. Heads up though: if you set thelinefield to0, then that VBI signal is disabled β periodt. And if no valid VBI data was found, thetypefield is set to0on return.g_vbi_dataβ used to obtain the sliced VBI packet from a readback register. Not all video decoders support this, and that's fine, we don't judge. But if no data is available because the readback register contains invalid or erroneous data,-EIOis returned. π«Ά Also don't forget: you must fill in the'id'member and the'field'member (that's how you determine whether CC data from the first or second field should be obtained).g_sliced_vbi_capβ the callback for theVIDIOC_G_SLICED_VBI_CAPioctl handler code. That's it, that's the job. πs_raw_fmtβ setup the video encoder/decoder for raw VBI.g_sliced_fmtβ retrieve the current sliced VBI settings.s_sliced_fmtβ setup the sliced VBI settings.
π SEE ALSO π
Kernel file ./include/media/v4l2-subdev.h, plus a whole friend group of friends β 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_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).
And the function besties: 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).
Then the state getters: 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).
Streaming squad: 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).
Locking lowkey the main character: 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).
And finally: 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). π
Ngl bestie, -EIO is not a vibe, but at least now you know exactly when it's coming. π«‘
Okay that's the whole page, mwah π β this one lives in ./include/media, it's dated October 2026, it's part of the Kernel API Manual, and it's titled struct v4l2_subdev_vbi_ops(9). Go slay your VBI callbacks, ily, bye! πβ¨π
π¦ 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