STRUCT VIDTV_MUX(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ STRUCT VIDTV_MUX(9) ✨

okay so bestie, welcome to the Kernel API Manual β€” we're doing a deep dive on struct vidtv_mux, which is described as a muxer abstraction that's loosely based in libavcodec/mpegtsenc.c. Loosely! Like, spiritually. vibe-wise. πŸ’…


πŸŽ€ NAME πŸŽ€

struct vidtv_mux β€” a muxer abstraction loosely based in libavcodec/mpegtsenc.c


✨ SYNOPSIS ✨

struct vidtv_mux {
    struct dvb_frontend *fe;
    struct device *dev;
    struct vidtv_mux_timing timing;
    u32 mux_rate_kbytes_sec;
    unsigned long pid_ctx[1 << (( 3) - 1)];
    void (*on_new_packets_available_cb)(void *priv, u8 *buf, u32 npackets);
    u8 *mux_buf;
    u32 mux_buf_sz;
    u32 mux_buf_offset;
    struct vidtv_channel  *channels;
    struct vidtv_mux_si si;
    u64 num_streamed_pcr;
    u64 num_streamed_si;
    struct work_struct mpeg_thread;
    bool streaming;
    u16 pcr_pid;
    u16 transport_stream_id;
    u16 network_id;
    char *network_name;
    void *priv;
 };

🌸 MEMBERS 🌸

  • fe β€” the frontend structure, and guess who allocated it? the muxer. her house, her rules 🫢
  • dev β€” a pointer to struct device.
  • timing β€” keeps track of all the timing-related info. the clock girlie ⏰
  • mux_rate_kbytes_sec β€” the bit rate for the TS, in kbytes.
  • pid_ctx β€” a hash table that keeps track of per-PID metadata. lowkey the backbone of the whole operation.
  • on_new_packets_available_cb β€” a callback that lets everyone know fresh TS packets are ready. it's giving "notify your besties" energy πŸ””
  • mux_buf β€” a pointer to a buffer for this muxer. TS packets get stored in there and then passed on to the bridge driver. iconic little staging area ✨
  • mux_buf_sz β€” the size for mux_buf.
  • mux_buf_offset β€” the current offset into mux_buf. she knows exactly where she's at, always πŸ’…
  • channels β€” the channels associated with this muxer.
  • si β€” keeps track of the PSI context.
  • num_streamed_pcr β€” number of PCR packets streamed. count 'em πŸ”₯
  • num_streamed_si β€” the number of PSI packets streamed. also counted, also slaying.
  • mpeg_thread β€” the thread responsible for the muxer loop. main character energy fr fr πŸ‘‘
  • streaming β€” whether mpeg_thread is running or not. the vibe check flag.
  • pcr_pid β€” the TS PID used for the PSI packets. and listen: all channels will share the same PCR. no cap, everybody shares. 🀝
  • transport_stream_id β€” the transport stream ID.
  • network_id β€” the network ID.
  • network_name β€” the network name.
  • priv β€” private data. mind your business πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./drivers/media/test-drivers/vidtv/vidtv_mux.h
  • struct vidtv_mux_timing(9)
  • struct vidtv_mux_si(9)
  • struct vidtv_mux_pid_ctx(9)
  • struct vidtv_mux_init_args(9)

and that's the whole page, bestie!! go read ./drivers/media/test-drivers/vidtv/vidtv_mux.h and live your truth 🌈

mwah πŸ’– β€” this little love letter came from ./drivers/media/test-drivers/v..., dropped in October 2026, and it's part of the Kernel API Manual. periodt. πŸŽ€

πŸ“¦ where this page comes from