Skip to main content

Segmenter

Struct Segmenter 

Source
pub struct Segmenter { /* private fields */ }

Implementations§

Source§

impl Segmenter

Source

pub fn new(config: SegmenterConfig, description: &MediaDescription) -> Self

Source

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.

Source

pub fn subscribe(&self) -> Receiver<Segment>

Subscribe to completed segments.

Source

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.

Source

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.

Source

pub fn push(&mut self, unit: AccessUnit)

Source

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.

Source

pub fn reset_after_discontinuity(&mut self)

Drop incomplete samples after a transport gap and mark the next segment.

Source

pub fn flush(&mut self)

Flush any remaining samples as a final segment.

Auto Trait Implementations§

§

impl !Freeze for Segmenter

§

impl Forget for Segmenter

§

impl Move for Segmenter

§

impl RefUnwindSafe for Segmenter

§

impl Send for Segmenter
where Arc<str>: Send, RawVecInner: Send, Bytes: Send, RawTable<(u8, usize)>: Send, Arc<Shared<Segment>>: Send, NonZero<usize>: Send, NonZero<u32>: Send, &'static str: Send, BoxRaw<[u8]>: Send, BoxRaw<TencWire>: Send, Arc<DisplayInfo>: Send, Arc<SampleProtection>: Send, BoxRaw<SegmentOut>: Send, RawTable<(u8, TrackId)>: Send, RawTable<(u8, u32)>: Send,

§

impl Sync for Segmenter
where Arc<str>: Sync, RawVecInner: Sync, Bytes: Sync, RawTable<(u8, usize)>: Sync, Arc<Shared<Segment>>: Sync, NonZero<usize>: Sync, NonZero<u32>: Sync, BoxRaw<[u8]>: Sync, BoxRaw<TencWire>: Sync, Arc<DisplayInfo>: Sync, Arc<SampleProtection>: Sync, BoxRaw<SegmentOut>: Sync, RawTable<(u8, TrackId)>: Sync, RawTable<(u8, u32)>: Sync,

§

impl Unpin for Segmenter

§

impl UnsafeUnpin for Segmenter

§

impl UnwindSafe for Segmenter

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more