pub struct Segmenter {
pub lost_frames: u64,
pub restarts: u64,
/* private fields */
}Expand description
Assigns packets of one stream to segments and sample indices, one packet at a time.
The rules use only the packets seen so far, so the exporter and live readers place packets identically. A new segment starts after a silence of more than a second, after a jump in the sequence counter that the elapsed time does not explain, and, for streams without a counter, after a step in the band’s clock or a burst of packets.
Fields§
§lost_frames: u64Frames missing inside segments (counted from sequence numbers).
restarts: u64Sequence counter restarts that followed a stream-start command.
Implementations§
Source§impl Segmenter
impl Segmenter
Sourcepub fn push(
&mut self,
arrival: f64,
device_time: u32,
sequence: Option<u8>,
samples: usize,
forced: bool,
after_start: bool,
) -> Placed
pub fn push( &mut self, arrival: f64, device_time: u32, sequence: Option<u8>, samples: usize, forced: bool, after_start: bool, ) -> Placed
Places the next packet. arrival is in seconds, sequence is the frame counter if the
stream has one, samples the number of samples in the packet. forced starts a new
segment regardless (an undecodable frame came before this one). after_start says a
stream-start command was written within the last second, which explains a counter restart.