Skip to main content

Module ogg_sink

Module ogg_sink 

Source
Expand description

Ogg Opus fan-out on a Unix socket: every consumer that connects receives the stream’s OpusHead and OpusTags pages, then one page per encoded packet, so the socket reads as a standard Ogg Opus stream (ffmpeg -i unix:<path>, the pixelflux recorder).

The tap never perturbs the capture: the capture thread only hands each page to a bounded per-consumer channel drained by that consumer’s writer thread, and a consumer that falls behind is dropped rather than waited on.

Structs§

Client 🔒
OggSink
One Ogg Opus stream served to every consumer of a Unix socket.
OpusHead
What OpusHead tells a decoder; mapping is (streams, coupled, table) for channel mapping family 1, absent for family 0 (mono and stereo).

Constants§

ACCEPT_POLL_INTERVAL 🔒
CLIENT_QUEUE_CAP 🔒
Per-consumer backlog: two seconds of 20 ms packets before a consumer is dropped.
CRC_POLY 🔒
The Ogg page checksum’s polynomial, applied to the whole page with the field zeroed.
WRITE_TIMEOUT 🔒

Functions§

crc32 🔒
header_pages 🔒
The identification and comment headers as the stream’s first two pages.
page 🔒
One page carrying one packet: the lacing table splits it into 255-byte segments, a final short segment (empty when the length is a multiple of 255) closing it.