STRUCT V4L2_FORMAT_INFO(9)
π struct v4l2_format_info(9) β the Kernel API Manual, bestie edition β¨
okay so you're here for struct v4l2_format_info from the Linux Kernel API Manual (section 9, that's the kernel-API girlies) and honestly? this struct is a whole mood. it's literally the little info card that tells you everything about a V4L2 format β no cap. let's get into it π
β¨ NAME β¨
struct v4l2_format_info β information about a V4L2 format π like, the deets. the lore. the format's whole personality.
πΈ SYNOPSIS πΈ
struct v4l2_format_info {
u32 format;
u8 pixel_enc;
u8 mem_planes;
u8 comp_planes;
u8 bpp[4];
u8 bpp_div[4];
u8 hdiv;
u8 vdiv;
u8 block_w[4];
u8 block_h[4];
bool has_alpha;
};
look at her. eleven fields. main character energy, fr fr π
π¦ Members π¦
okay so this is the part where we go field by field and I tell you what each one is serving π
formatβ the 4CC format identifier (V4L2_PIX_FMT_*). yes babe, four characters, that's the whole name of the format. iconic behavior honestly.pixel_encβ the pixel encoding (peepenum v4l2_pixel_encodingfor more, it's listed above, go look π).mem_planesβ number of memory planes, and yes that includes the alpha plane (so it's1to4, no notes).comp_planesβ number of component planes, also including the alpha plane (1to4again, consistency queen π).bppβ array of per-plane bytes per pixel. literally just the byte count per plane, per pixel, in array form.bpp_divβ array of per-plane bytes per pixel divisors, and the reason she exists is to support fractional pixel sizes π§ so yeah, fractional, not always a clean whole number, and that's fine.hdivβ horizontal chroma subsampling factor. sideways chroma math πvdivβ vertical chroma subsampling factor. up-and-down chroma math π¦block_wβ per-plane macroblock pixel width (optional, so it can ghost you and that's legal π).block_hβ per-plane macroblock pixel height (optional too, same deal π).has_alphaβ does the format embed an alpha component?bool, yes or no, transparency check πβ¨
π₯ SEE ALSO π₯
the whole friend group, in order, no skips:
Kernel file ./include/media/v4l2-common.h v4l2_ctrl_query_fill(9), enum v4l2_i2c_tuner_type(9), v4l2_i2c_new_subdev(9), v4l2_i2c_new_subdev_board(9), v4l2_i2c_subdev_set_name(9), v4l2_i2c_subdev_init(9), v4l2_i2c_subdev_addr(9), v4l2_i2c_tuner_addrs(9), v4l2_i2c_subdev_unregister(9), v4l2_spi_new_subdev(9), v4l2_spi_subdev_init(9), v4l2_spi_subdev_unregister(9), v4l_bound_align_image(9), v4l2_find_nearest_size_conditional(9), v4l2_find_nearest_size(9), v4l2_g_parm_cap(9), v4l2_s_parm_cap(9), enum v4l2_pixel_encoding(9), v4l2_get_link_freq(9), v4l2_get_active_data_lanes(9), v4l2_link_freq_to_bitmap(9), devm_v4l2_sensor_clk_get(9), devm_v4l2_sensor_clk_get_legacy(9) π«Ά
and that's the whole page, bestie. no hidden chapters, no plot twist π
k bye ily, this one came from ./include/media and it's dated October 2026 β go read the source, slay, and hydrate ππ
β¨
π¦ 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