pub struct Segmenter { /* private fields */ }Implementations§
Source§impl Segmenter
impl Segmenter
pub fn new(config: SegmenterConfig, description: &MediaDescription) -> Self
Sourcepub fn new_mpegts(
config: SegmenterConfig,
description: &MediaDescription,
) -> Self
pub fn new_mpegts( config: SegmenterConfig, description: &MediaDescription, ) -> Self
Create a live segmenter that emits MPEG-TS segments via the
transmux streaming TS-HLS segmenter. Falls back to fMP4 when the
description lacks a usable AVC/AAC configuration.
Sourcepub fn update_fmtp(&mut self, fmtp_map: &HashMap<u8, Arc<str>>)
pub fn update_fmtp(&mut self, fmtp_map: &HashMap<u8, Arc<str>>)
Update track fmtp parameters (e.g., from a late ANNOUNCE SDP).
If a track’s codec_config has not yet been extracted from the stream,
this also attempts to initialize it from sprop-parameter-sets in the fmtp.
Sourcepub fn set_sequence(&mut self, sequence: u64)
pub fn set_sequence(&mut self, sequence: u64)
Push an AccessUnit into the segmenter. Segments are cut immediately before the first keyframe at or after the target duration, so every new video segment begins at a random access point. Set the next sequence number before the first push. Used when a segmenter is recreated for a long-lived live mount: the playlist’s EXT-X-MEDIA-SEQUENCE must never go backwards.
pub fn push(&mut self, unit: AccessUnit)
Sourcepub fn cut_current(&mut self)
pub fn cut_current(&mut self)
Finalize the current segment at the last sample’s end.
DASH uses this to reap an audio segment when its video counterpart is cut, keeping the two tracks’ segment boundaries close without changing the HLS segmenter’s own keyframe-driven cuts.
Sourcepub fn reset_after_discontinuity(&mut self)
pub fn reset_after_discontinuity(&mut self)
Drop incomplete samples after a transport gap and mark the next segment.