STRUCT DMX_SECTION_FEED(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct dmx_section_feed(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” we're doing a whole deep-dive on struct dmx_section_feed and honestly? it's giving "small struct, big responsibilities" energy πŸ‘‘


✨ NAME ✨

struct dmx_section_feed β€” the structure that holds a section feed filter. that's it, that's the vibe. πŸŽ€


🌸 SYNOPSIS 🌸

struct dmx_section_feed {
    int is_filtering;
    struct dmx_demux *parent;
    void *priv;
    int check_crc;
    int (*set)(struct dmx_section_feed *feed, u16 pid, int check_crc);
    int (*allocate_filter)(struct dmx_section_feed *feed, struct dmx_section_filter **filter);
    int (*release_filter)(struct dmx_section_feed *feed, struct dmx_section_filter *filter);
    int (*start_filtering)(struct dmx_section_feed *feed);
    int (*stop_filtering)(struct dmx_section_feed *feed);
};

like, look at all those function pointers β€” she's basically a little remote control for filtering 🫢


πŸ¦‹ Members πŸ¦‹

  • is_filtering β€” gets set to non-zero when filtering is actively in progress. it's the "am I busy rn" flag πŸ’…
  • parent β€” pointer to struct dmx_demux. her mom, basically. 🌈
  • priv β€” pointer to private data of the API client. not for us to peek at, iykyk πŸ™ˆ
  • check_crc β€” if it's non-zero, the CRC values of filtered sections get checked. accuracy queen ✨
  • set β€” sets the section filter. literally what it says on the tin
  • allocate_filter β€” this function is used to allocate a section filter on the demux. important: it should only be called when no filtering is in progress on this section feed ⚠️. and if a filter can't be allocated, the function fails with -ENOSPC. no cap.
  • release_filter β€” this one releases all the resources of a previously allocated section filter. also important: don't call it while filtering is in progress on this section feed 🚫. and after you call this function, the caller should not try to dereference the filter pointer. like, she's gone, let her go πŸ’€
  • start_filtering β€” starts section filtering πŸš€
  • stop_filtering β€” stops section filtering πŸ›‘

πŸ’… Description πŸ’…

A TS feed is typically mapped to a hardware PID filter on the demux chip. that's the whole setup 🧚

Using this API, the client can set the filtering properties to start/stop filtering TS packets on a particular TS feed. so you're basically the main character telling the packets who gets through and who doesn't πŸ‘‘


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/media/demux.h, enum ts_filter_type(9), struct dmx_ts_feed(9), struct dmx_section_filter(9), dmx_ts_cb(9), dmx_section_cb(9), enum dmx_frontend_source(9), struct dmx_frontend(9), enum dmx_demux_caps(9), DMX_FE_ENTRY(9), struct dmx_demux(9) β€” go read the whole friend group, they're all iconic πŸ’œ


fr fr though β€” the -ENOSPC failure on allocate_filter and the "don't dereference after release_filter" rule are the real ones. no cap, don't skip them 😭

that's the whole page bestie!! πŸ“ sourced from ./include/media and dated October 2026 β€” mwah, slay, bye πŸ’‹πŸ’–

πŸ“¦ where this page comes from