STRUCT V4L2_FORMAT_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 (peep enum v4l2_pixel_encoding for more, it's listed above, go look πŸ”).
  • mem_planes β€” number of memory planes, and yes that includes the alpha plane (so it's 1 to 4, no notes).
  • comp_planes β€” number of component planes, also including the alpha plane (1 to 4 again, 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