STRUCT DVB_DEMUX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct dvb_demux(9)

okay bestie, so this is struct dvb_demux β€” it represents a digital TV demux, and it is literally the main character of the DVB demux world. Let's get into it ✨


✨ SYNOPSIS ✨

struct dvb_demux {
    struct dmx_demux dmx;
    void *priv;
    int filternum;
    int feednum;
    int (*start_feed)(struct dvb_demux_feed *feed);
    int (*stop_feed)(struct dvb_demux_feed *feed);
    int (*write_to_decoder)(struct dvb_demux_feed *feed, const u8 *buf,
size_t len);
    u32 (*check_crc32)(struct dvb_demux_feed *feed, const u8 *buf,
size_t len);
    void (*memcopy)(struct dvb_demux_feed *feed, u8 *dst, const u8 *src,
size_t len);
    int users;
  #define MAX_DVB_DEMUX_USERS 10;
    struct dvb_demux_filter *filter;
    struct dvb_demux_feed *feed;
    struct list_head frontend_list;
    struct dvb_demux_feed *pesfilter[DMX_PES_OTHER];
    u16 pids[DMX_PES_OTHER];
  #define DMX_MAX_PID 0x2000;
    struct list_head feed_list;
    u8 tsbuf[204];
    int tsbufp;
    struct mutex mutex;
    spinlock_t lock;
    uint8_t *cnt_storage;
    ktime_t speed_last_time;
    uint32_t speed_pkts_cnt;
};

πŸŽ€ Members πŸŽ€

okay so every field is about to get its moment, no skipping, we're doing all of them πŸ’–

  • dmx β€” the embedded struct dmx_demux that carries the demux capabilities and callbacks. it's the whole reason this thing can demux at all, so yeah, kind of a big deal πŸ‘‘
  • priv β€” private data, and it's optional β€” a DVB driver can use it if it wants. no pressure, no cap 🫢
  • filternum β€” maximum amount of DVB filters.
  • feednum β€” maximum amount of DVB feeds.
  • start_feed β€” callback routine that gets called to start a DVB feed. go little feed go ✨
  • stop_feed β€” callback routine that gets called to stop a DVB feed. bye bestie 😭
  • write_to_decoder β€” callback routine that gets called when a new TS packet arrives, but only if the feed is TS and it's routed to an A/V decoder. and ngl it's used only on av7110-av.c β€” that's it, one file, iconic behavior πŸ’…
  • check_crc32 β€” callback routine to check CRC. if you don't initialize it, dvb_demux just uses an internal one. it's giving self-sufficient 🌸
  • memcopy β€” callback routine to memcopy received data. if you don't initialize it, dvb_demux defaults to memcpy. defaults really said "i got you" πŸ¦‹
  • users β€” counter for the number of demux opened file descriptors. currently it's limited to 10 users. ten. that's the whole capacity. MAX_DVB_DEMUX_USERS said what she said πŸ’€
  • filter β€” pointer to struct dvb_demux_filter.
  • feed β€” pointer to struct dvb_demux_feed.
  • frontend_list β€” a struct list_head with the frontends used by the demux.
  • pesfilter β€” array of struct dvb_demux_feed with the PES types that will be filtered. it's sized DMX_PES_OTHER, which is right there in the synopsis, don't come for me πŸ“
  • pids β€” list of filtered program IDs.
  • feed_list β€” a struct list_head with feeds.
  • tsbuf β€” temporary buffer used internally to store TS packets. u8 tsbuf[204], yes the 204 is real.
  • tsbufp β€” temporary buffer index, used internally.
  • mutex β€” pointer to struct mutex used to protect feed set logic. lock it down, queen πŸ”’
  • lock β€” pointer to spinlock_t, used to protect buffer handling.
  • cnt_storage β€” buffer used for TS/TEI continuity check.
  • speed_last_time β€” ktime_t used for TS speed check.
  • speed_pkts_cnt β€” packets count used for TS speed check. ⚑

quick vibe check bestie: the members block above keeps mutex and lock described as pointers, and write_to_decoder described as being used only on av7110-av.c β€” both of those are straight from the source, so don't @ me, I'm just the messenger πŸ™ˆ

🌈 SEE ALSO 🌈

Kernel file ./include/media/dvb_demux.h, plus the whole friend group:


and that's the whole page, bestie, you ate that πŸ«ΆπŸ’œ

this lil beauty lives in ./include/media, dated October 2026, and it's filed under struct dvb_demux(9) β€” periodt. ⭐

πŸ“¦ where this page comes from