webrtc_twcc_receiver (webrtc v0.1.0)
View SourceReceiver side of transport-wide congestion control (draft-holmer-rmcat-transport-wide-cc-extensions-01 §3), as a sans-IO engine.
packet/4 records the arrival time of a packet carrying a transport-wide sequence number. Feedback (#rtcp_twcc{}) is emitted by handle_timeout/2 every interval milliseconds (default 100) after the first unreported arrival, and by flush/2 on demand.
Each feedback message starts right after the highest sequence number of the previous one, so a packet lost between two messages is still reported as not_received. A packet arriving after feedback already covered its sequence number (reordering) is reported in the next message, which then covers everything from it on again, as libwebrtc does: the arrivals already reported are repeated from a bounded history (the sender ignores repeated reports). A gap of more than max_gap (default 1000) sequence numbers is treated as a restart of the sequence: not reported as losses, and packets that much older than reported ones are dropped and counted as late.
Pending arrivals are bounded by max_pending (default 1000): when reached, feedback is due at once; at twice that, new arrivals are dropped and counted until the next feedback.
Summary
Functions
Feedback for every pending arrival, now.
Record that the packet with transport-wide sequence number Seq from Ssrc arrived at Now (milliseconds).
Types
Functions
-spec flush(integer(), state()) -> {[#rtcp_twcc{sender_ssrc :: rtcp_u32(), media_ssrc :: rtcp_u32(), base_seq :: 0..65535, ref_time :: -8388608..8388607, fb_count :: 0..255, packets :: [{0..65535, not_received | -32768..32767}]}], state()}.
Feedback for every pending arrival, now.
Record that the packet with transport-wide sequence number Seq from Ssrc arrived at Now (milliseconds).