pub struct Quality {
pub loss: f64,
pub cumulative_lost: i64,
pub jitter: Duration,
pub round_trip: Option<Duration>,
pub mos: f64,
}Expand description
How a call is going.
Fields§
§loss: f64Loss since the last report, as a fraction between 0 and 1.
cumulative_lost: i64Packets lost since the stream began. Signed, because duplicates can make it go down.
jitter: DurationInterarrival jitter (RFC 3550 §6.4.1).
round_trip: Option<Duration>The most recent round-trip time, if a report has come back with one.
mos: f64An estimated mean opinion score. See Quality::mos for what it is and is not.
Implementations§
Source§impl Quality
impl Quality
Sourcepub fn mos(loss: f64, jitter: Duration, round_trip: Option<Duration>) -> f64
pub fn mos(loss: f64, jitter: Duration, round_trip: Option<Duration>) -> f64
Estimate a mean opinion score from loss, jitter and round-trip time.
This is an estimate, not a measurement. A real MOS comes from people listening. What
this computes is the ITU-T G.107 E-model’s transmission rating R, converted to a score
by G.107’s own formula, from impairment terms that are the common simplification rather
than the full model: delay is folded into one term, and loss is charged at a flat rate
that is roughly right for G.711 and wrong for a codec with packet loss concealment.
It is worth having anyway, because it collapses three numbers that trade against each other into one that can be compared between calls. It is not worth reporting to four decimal places, and sipx does not.
Sourcepub fn score_from_rating(rating: f64) -> f64
pub fn score_from_rating(rating: f64) -> f64
G.107’s own conversion from the transmission rating R to a score.
Exact, unlike the impairment terms feeding it: this part is the standard’s formula.