pub struct CongestionControlHandle { /* private fields */ }Expand description
The application’s end of the congestion controller: the estimate, pulled when the encoder wants it, and the limits only the application knows.
§Inputs from signalling
The engine’s SDP layer does not feed these yet; an application that negotiates them passes them on:
b=AS:<kbit/s>andb=TIAS:<bit/s>of the remote description (RFC 8866 section 5.8, RFC 3890):set_session_bitrate_limit.b=AScounts IP and UDP headers,b=TIASdoes not; the caller converts.- a selected candidate pair change:
notify_path_change. The engine’s peer connection tells the interceptor of its own pair changes (PathChanged); this is for a change it cannot see.
TMMBR and REMB arrive as RTCP and are read by the interceptor itself.
Implementations§
Source§impl CongestionControlHandle
impl CongestionControlHandle
Sourcepub fn target_bitrate(&self) -> f64
pub fn target_bitrate(&self) -> f64
The current target, in bits per second.
Before any feedback (has_feedback false) this is the
estimator’s start (300 kbit/s for the default Gcc), within the floor
and ceiling and any limit already given (b=AS / b=TIAS, REMB, TMMBR): never zero,
never a measurement.
Sourcepub fn stats(&self) -> EstimatorStats
pub fn stats(&self) -> EstimatorStats
What the estimator says about itself.
For Gcc, before any feedback: delay_based_bitrate and
loss_based_bitrate are already Some (both halves start at the start value), so they
do not tell whether feedback arrived; packet_loss is None until a feedback batch or a
receiver report’s loss was folded in, and round_trip_time until feedback or a receiver
report implied a round-trip time. Use has_feedback.
Sourcepub fn has_feedback(&self) -> bool
pub fn has_feedback(&self) -> bool
Whether the target comes from the path yet: true once the estimator was given
feedback (feedback_reports above zero), false while
target_bitrate is still the start value it was built with.
Sourcepub fn feedback_reports(&self) -> u64
pub fn feedback_reports(&self) -> u64
How many feedback batches the estimator has been given: each RTCP packet carrying per-packet congestion control feedback (transport-wide congestion control or RFC 8888) that reported packets this controller sent, and, while no such feedback has arrived, each receiver report block whose fraction lost was used instead (draft-ietf-rmcat-gcc-02 section 7). Counts from the controller’s start; a path change does not reset it.
Sourcepub fn set_session_bitrate_limit(&self, bits_per_second: Option<f64>)
pub fn set_session_bitrate_limit(&self, bits_per_second: Option<f64>)
The bit rate the remote description allows this endpoint to send (b=AS, b=TIAS), in
bits per second of RTP; None when it names none.
Sourcepub fn set_min_bitrate(&self, bits_per_second: Option<f64>)
pub fn set_min_bitrate(&self, bits_per_second: Option<f64>)
A floor for the target, in bits per second; None leaves the estimator’s own.
Sourcepub fn notify_path_change(&self)
pub fn notify_path_change(&self)
The network path changed: the estimator starts over from its current target.
Sourcepub fn remb_limit(&self) -> Option<f64>
pub fn remb_limit(&self) -> Option<f64>
The limit the receiver’s last REMB set, while it is in force.
Sourcepub fn tmmbr_limit(&self) -> Option<f64>
pub fn tmmbr_limit(&self) -> Option<f64>
The limit the TMMBR bounding set puts on this sender, while there is one.