STRUCT V4L2_JPEG_HEADER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ struct v4l2_jpeg_header(9) πŸŽ€

okay so this is the <pink>struct v4l2_jpeg_header</pink> manpage from the Kernel API Manual β€” and yes bestie, the whole thing is literally about one struct: parsed JPEG header. that's it. that's the vibe. πŸ’…


✨ NAME ✨

struct v4l2_jpeg_header β€” parsed JPEG header πŸ–ΌοΈβœ¨


🌸 SYNOPSIS 🌸

struct v4l2_jpeg_header {
    struct v4l2_jpeg_reference sof;
    struct v4l2_jpeg_reference sos;
    unsigned int num_dht;
    struct v4l2_jpeg_reference dht[V4L2_JPEG_MAX_TABLES];
    unsigned int num_dqt;
    struct v4l2_jpeg_reference dqt[V4L2_JPEG_MAX_TABLES];
    struct v4l2_jpeg_frame_header frame;
    struct v4l2_jpeg_scan_header *scan;
    struct v4l2_jpeg_reference *quantization_tables;
    struct v4l2_jpeg_reference *huffman_tables;
    u16 restart_interval;
    size_t ecs_offset;
    enum v4l2_jpeg_app14_tf app14_tf;
 };

like, look at her. she's got range. πŸ‘‘


πŸ¦‹ Members πŸ¦‹

okay bestie, field-by-field, no skips, periodt:

  • sof β€” pointer to frame header and size 🫢
  • sos β€” pointer to scan header and size πŸ’–
  • num_dht β€” number of entries in dht 🌸
  • dht β€” pointers to huffman tables and sizes ✨
  • num_dqt β€” number of entries in dqt πŸŽ€
  • dqt β€” pointers to quantization tables and sizes πŸ’œ
  • frame β€” parsed frame header πŸ‘‘
  • scan β€” pointer to parsed scan header, optional ⭐
  • quantization_tables β€” references to four quantization tables, optional 🌈
  • huffman_tables β€” references to four Huffman tables in DC0, DC1, AC0, AC1 order, optional 🧚
  • restart_interval β€” number of MCU per restart interval, Ri πŸ”
  • ecs_offset β€” buffer offset in bytes to the entropy coded segment πŸ“
  • app14_tf β€” transform flag from app14 data 🏳️

πŸ’€ Description πŸ’€

so here's the tea β˜•: when this struct gets passed to v4l2_jpeg_parse_header, those optional pointers β€” scan, quantization_tables, and huffman_tables β€” must be initialized to NULL or point at valid memory. like, no cap, that's not optional-optional, that's a real requirement. πŸ™ˆ

bestie pls don't hand over a random uninitialized pointer here, that's giving undefined behavior energy and we are not about that life 😭

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/media/v4l2-jpeg.h β€” go read the source, iykyk πŸ“–
  • struct v4l2_jpeg_reference(9)
  • struct v4l2_jpeg_frame_component_spec(9)
  • struct v4l2_jpeg_frame_header(9)
  • struct v4l2_jpeg_scan_component_spec(9)
  • struct v4l2_jpeg_scan_header(9)
  • enum v4l2_jpeg_app14_tf(9)

and that's the whole page, bestie 🫢✨ this one lives in ./include/media, dated October 2026, and it's brought to you by the Kernel API Manual β€” slay, ate, no crumbs. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from