pub struct TransitionPlan {
pub at_pts: u64,
pub pts_rebase_offset: i128,
pub discontinuity: bool,
}Expand description
The computed plan for joining from into to at Self::at_pts.
Fields§
§at_pts: u64The channel-timeline instant the join happens at — to’s
planned_start.
pts_rebase_offset: i128Add this to one of to’s own PTS values to place it on the shared
channel timeline (see Self::rebase). i128 so it can hold the
full possible difference of two u64 instants without clamping —
this crate never silently narrows a rebase computation. May be
negative when to’s own clock numbering starts after the channel
instant it is joining at (an unusual but not-impossible schedule).
discontinuity: boolWhether from and to carry different
CodecConfigIds — a discontinuity
that must be signalled downstream (init-segment change / new codec
config), never something this crate transcodes or conforms away.
Implementations§
Source§impl TransitionPlan
impl TransitionPlan
Sourcepub fn plan(from: &ScheduleEntry, to: &ScheduleEntry) -> Self
pub fn plan(from: &ScheduleEntry, to: &ScheduleEntry) -> Self
Plan the transition from from into to. to.planned_start is the
channel-timeline instant the join happens at; the rebase offset is
derived so that to.source_start_pts, once rebased, lands exactly on
that instant.
Sourcepub fn rebase(&self, source_pts: u64) -> Option<u64>
pub fn rebase(&self, source_pts: u64) -> Option<u64>
Map one of to’s own PTS values onto the shared channel timeline
(source_pts + pts_rebase_offset).
Returns None rather than wrapping if the rebased instant would fall
outside u64’s range (e.g. a source PTS before the source’s own
declared start, rebasing to before the join instant) — this crate
never silently produces a timeline instant that doesn’t correspond to
the input.
Trait Implementations§
Source§impl Clone for TransitionPlan
impl Clone for TransitionPlan
Source§fn clone(&self) -> TransitionPlan
fn clone(&self) -> TransitionPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more