webrtc_ccfb_receiver (webrtc v0.1.0)

View Source

Receiver side of RTP Control Protocol feedback for congestion control (RFC 8888), as a sans-IO engine.

packet/5 records the arrival time and ECN mark of an RTP packet. Every interval milliseconds (default 100) after the first unreported arrival, handle_timeout/2 emits one #rtcp_ccfb{} with, per source, the run of sequence numbers from the first one not reported yet to the highest received: each received packet with its ECN codepoint and its arrival time offset before the report timestamp (1/1024 s, 0x1FFE for that much or more), the others as not received (RFC 8888 §3.1). A source reports at most MAX_PER_SOURCE packets per message; older ones are skipped. At most MAX_SOURCES sources are tracked.

Summary

Functions

Packet Seq of Ssrc arrived at Now (ms) with ECN codepoint Ecn (0 not-ECT, 1 ECT(1), 2 ECT(0), 3 CE).

Types

rtcp_u32/0

-type rtcp_u32() :: 0..4294967295.

state/0

-opaque state()

Functions

handle_timeout(Now, Rx)

-spec handle_timeout(integer(), state()) ->
                        {[#rtcp_ccfb{sender_ssrc :: rtcp_u32(),
                                     reports ::
                                         [{rtcp_u32(), 0..65535, [not_received | {0..3, 0..8191}]}],
                                     timestamp :: rtcp_u32()}],
                         state()}.

new(Opts)

-spec new(map()) -> state().

next_timeout(Rx)

-spec next_timeout(state()) -> integer() | infinity.

packet(Ssrc, Seq, Ecn, Now, Rx)

-spec packet(0..4294967295, 0..65535, 0..3, integer(), state()) -> state().

Packet Seq of Ssrc arrived at Now (ms) with ECN codepoint Ecn (0 not-ECT, 1 ECT(1), 2 ECT(0), 3 CE).

stats(Rx)

-spec stats(state()) -> map().