Skip to main content

Module rtp

Module rtp 

Source
Expand description

RTP endpoint (client role): sends synthesized G.711 to remote_addr in paced 20 ms frames, receives on listen, and summarises what arrives per SSRC — one event when a stream starts, one when it ends — rather than per packet, which at 50 packets a second would be a model call every 20 ms.

Re-exports§

pub use actions::RtpClientProtocol;

Modules§

actions
What the model does as an RTP endpoint: stream synthesized G.711 audio to the remote (described, never sampled), report as a sender over RTCP, and hear about the streams that arrive — one event when a stream starts and one when it ends, never one per packet.

Structs§

Tracker
Inbound RTP accounting per SSRC, shared with the RTSP client: a start event for a new stream, and an end event (loss, length, decoded tone and level) once it goes quiet.

Constants§

MAX_ANALYSED_SAMPLES
Decoded samples kept per stream for the tone estimate (ten seconds at 8 kHz).
MAX_FOLLOWUP_DEPTH
A handler chain (answer → event → answer …) stops after this many follow-ups.
MAX_STREAMS
Streams tracked at once; past it new SSRCs are ignored until one ends.
STREAM_IDLE
A stream with nothing for this long has ended.

Functions§

alaw_to_linear
G.711 A-law to linear PCM (ITU-T G.711).
analyse
The dominant frequency of a signal from its zero crossings (with a small hysteresis so quantisation noise around zero does not count), and its RMS level in dBFS.
connect
ulaw_to_linear
G.711 µ-law to linear PCM (ITU-T G.711).