STRUCT RBSP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ struct rbsp(9) β€” a Kernel API Manual moment πŸ’œ

okay bestie, so this is a page from the Kernel API Manual, and it's literally all about struct rbsp β€” the state object for handling a raw byte sequence payload. iykyk πŸŽ€


✨ NAME ✨

struct rbsp β€” the state object for handling a raw byte sequence payload. that's it, that's the vibe. 🌸


✨ SYNOPSIS ✨

here's the icon itself, no cap, copy it exactly:

struct rbsp {
    u8 *data;
    size_t size;
    unsigned int pos;
    unsigned int num_consecutive_zeros;
    struct nal_rbsp_ops *ops;
    int error;
 };

🫢 Members 🫢

okay so let's meet the cast, main character energy each and every one:

  • data β€” pointer to the data of the rbsp. it's giving "here's where the actual bytes live." πŸ’…
  • size β€” maximum size of the data of the rbsp. the ceiling, the limit, the "don't go past this" of it all.
  • pos β€” current bit position inside the rbsp. yes, bit position β€” we're not playing around with bytes here, we're counting bits, periodt. ⭐
  • num_consecutive_zeros β€” number of zeros before pos. keeping track of the zero streak like a little scorekeeper πŸŽ€
  • ops β€” per datatype functions for interacting with the rbsp. the little toolbox of function pointers. πŸ”₯
  • error β€” an error occurred while handling the rbsp. so if this is set, something went sideways 😭 (not me being dramatic, it literally means an error happened).

πŸ¦‹ Description πŸ¦‹

so this struct is passed around the various parsing functions and tracks the current position within the raw byte sequence payload. literally its whole job β€” it's the little cart that follows the parser around keeping track of where we are πŸ’–

the ops field is the clever bit, and i'm obsessed: it allows you to separate the operation β€” i.e., reading/writing a value from/to that rbsp β€” from the structure of the NAL unit. this is what allows you to have a single function for iterating the NAL unit, while ops has function pointers for handling each type in the rbsp. one iterator to rule them all, and the type-specific behaviour lives in ops. slay. πŸ‘‘


🌈 SEE ALSO 🌈

  • Kernel file ./drivers/media/platform/allegro-dvt/nal-rbsp.h β€” go read it, bestie, it's right there 🧚

that's the whole page! source is ./drivers/media/platform/alleg... and it's dated October 2026 β€” so like, from the future, iconic πŸ’œβœ¨ see you in the next man page, mwah πŸŽ€

πŸ“¦ where this page comes from