pub struct CcFeedbackRecorder { /* private fields */ }Expand description
Records packet arrivals per stream and builds feedback reports from them.
Implementations§
Source§impl CcFeedbackRecorder
impl CcFeedbackRecorder
Sourcepub fn add_packet(
&mut self,
arrival: Instant,
ssrc: u32,
sequence_number: u16,
ecn: Ecn,
)
pub fn add_packet( &mut self, arrival: Instant, ssrc: u32, sequence_number: u16, ecn: Ecn, )
Note that a packet of ssrc arrived at arrival.
Sourcepub fn build_report(
&mut self,
now: Instant,
sender_ssrc: u32,
report_timestamp: u32,
max_size: usize,
) -> CcFeedbackReport
pub fn build_report( &mut self, now: Instant, sender_ssrc: u32, report_timestamp: u32, max_size: usize, ) -> CcFeedbackReport
Build one feedback report for what has not been reported yet, within max_size bytes.
What does not fit stays in the recorder for the next call:
build_reports is the form that sends all of it.
Sourcepub fn build_reports(
&mut self,
now: Instant,
sender_ssrc: u32,
report_timestamp: u32,
max_size: usize,
) -> Vec<CcFeedbackReport>
pub fn build_reports( &mut self, now: Instant, sender_ssrc: u32, report_timestamp: u32, max_size: usize, ) -> Vec<CcFeedbackReport>
Build the feedback for everything not reported yet, as one report or, when it does not
fit max_size bytes, as several (RFC 8888 section 3.1: a feedback packet too large for
the path MTU is split into multiple feedback packets).
The first report carries a block for every stream, the ones with nothing new included;
the following ones only the streams that still have something to say. At most
MAX_REPORTS_PER_CALL reports are built: what is left after that goes out next time.
Sourcepub fn remove_stream(&mut self, ssrc: u32)
pub fn remove_stream(&mut self, ssrc: u32)
Forget a stream entirely.