dmx_ts_cb(9)
π dmx_ts_cb β the DVB demux TS filter callback prototype, bestie
okay so this is a page straight out of the Kernel API Manual (dmx_ts_cb(9)), and it's literally about the callback function prototype for the DVB demux TS filter. strap in, it's giving kernel-core but make it cute π
β¨ NAME β¨
dmx_ts_cb β DVB demux TS filter callback function prototype. that's it, that's the whole name, and honestly? iconic.
π SYNOPSIS π
int dmx_ts_cb (const u8 *buffer1 , size_t buffer1_length , const u8
*buffer2 , size_t buffer2_length , struct dmx_ts_feed *source , u32
*buffer_flags );
yes bestie, that's six whole parameters. let's meet them π«Ά
πΈ ARGUMENTS πΈ
buffer1β pointer to the start of the filtered TS packets. like, where the good stuff begins π¦buffer1_lengthβ length of the TS data inbuffer1. the size tag, basically πbuffer2β pointer to the tail of the filtered TS packets, orNULL. it's optional and it knows it πbuffer2_lengthβ length of the TS data inbuffer2.sourceβ indicates which TS feed is the source of the callback. who sent this? main character identification πbuffer_flagsβ address where buffer flags are stored. those are used to report discontinuity users via the DVB memory mapped API, as defined byenum dmx_buffer_flags. keys to the whole vibe check, ngl.
π DESCRIPTION π
okay so this function callback prototype, provided by the client of the demux API, is called from the demux code. lowkey important. the function is only called when filtering on a TS feed has been enabled using the start_filtering function at the dmx_demux. any TS packets that match the filter settings are copied to a circular buffer, and the filtered TS packets are delivered to the client using this callback function. it is expected that the buffer1 and buffer2 callback parameters point to addresses within the circular buffer, but other implementations are also possible. and listen β the called party should not try to free the memory the buffer1 and buffer2 parameters point to. do not do it. hands off. π«
when this function is called, the buffer1 parameter typically points to the start of the first undelivered TS packet within a circular buffer. the buffer2 buffer parameter is normally NULL, except when the received TS packets have crossed the last address of the circular buffer and "wrapped" to the beginning of the buffer. in the latter case the buffer1 parameter would contain an address within the circular buffer, while the buffer2 parameter would contain the first address of the circular buffer. the way that circular buffer wraps around... it's giving loop-de-loop π
the number of bytes delivered with this function (i.e. buffer1_length + buffer2_length) is usually equal to the value of callback_length parameter given in the set function, with one exception: if a timeout occurs before receiving callback_length bytes of TS data, any undelivered packets are immediately delivered to the client by calling this function. the timeout duration is controlled by the set function in the TS Feed API. periodt. β°
if a TS packet is received with errors that could not be fixed by the TS-level forward error correction (FEC), the Transport_error_indicator flag of the TS packet header should be set. the TS packet should not be discarded, as the error can possibly be corrected by a higher layer protocol. bestie, don't throw it away, someone upstairs might fix it, fr fr π
if the called party is slow in processing the callback, it is possible that the circular buffer eventually fills up. if this happens, the demux driver should discard any TS packets received while the buffer is full and return -EOVERFLOW. π yeah. it happens. the buffer said "no more".
the type of data returned to the callback can be selected by the dmx_ts_feed.set function. the type parameter decides if the raw TS packet (TS_PACKET) or just the payload (TS_PACKET|TS_PAYLOAD_ONLY) should be returned. if additionally the TS_DECODER bit is set the stream will also be sent to the hardware MPEG decoder. the range of possibilities... we love options β¨
π return values π
0, on success; π-EOVERFLOW, on buffer overflow. π
π₯ SEE ALSO π₯
- Kernel file
./include/media/demux.h enum ts_filter_type(9)struct dmx_ts_feed(9)struct dmx_section_filter(9)struct dmx_section_feed(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)
the whole friend group, honestly. go read them too, iykyk π
and that's the page, bestie!! this one ships out of ./include/media, version stamped October 2026, filed under dmx_ts_cb(9) β mwah, go slay those TS packets π
ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms