Skip to main content

SpliceInfo

Struct SpliceInfo 

Source
pub struct SpliceInfo {
    pub command_type: u8,
    pub pts_adjustment: u64,
    pub pts: Option<u64>,
    pub duration: Option<u64>,
    pub event_id: Option<u32>,
    pub cancel: bool,
    pub out_of_network: bool,
    pub raw: Bytes,
}
Expand description

Parsed view of a splice_info_section, preserving the raw bytes for downstream passthrough alongside the timing fields HLS / DASH renderers need.

Fields§

§command_type: u8

splice_command_type field (one of CMD_*).

§pts_adjustment: u64

pts_adjustment field. Added to every splice_time PTS by the receiving decoder. Surfaced for completeness; the egress renderers usually want the absolute PTS via SpliceInfo::pts.

§pts: Option<u64>

33-bit splice_time PTS extracted from the splice_command, when present and time_specified. None when:

  • the command type has no splice_time (splice_null, splice_schedule, bandwidth_reservation, private_command),
  • the splice_insert is splice_immediate (no pre-roll PTS),
  • splice_insert.cancel_indicator is set,
  • splice_insert is per-component (no program splice_time),
  • splice_time.time_specified_flag is 0 (“immediate”).
§duration: Option<u64>

break_duration from splice_insert when the duration_flag is set. None for time_signal and for splice_insert without duration.

§event_id: Option<u32>

splice_event_id from splice_insert. None for command types other than splice_insert.

§cancel: bool

True when splice_event_cancel_indicator is set on a splice_insert. Egress renderers may emit a cancellation SCTE35-CMD entry.

§out_of_network: bool

True when out_of_network_indicator is set on a splice_insert (signals an ad break out – “going to ad”). Drives the choice of HLS SCTE35-OUT vs SCTE35-IN attribute.

§raw: Bytes

Raw splice_info_section bytes from table_id through CRC_32, preserved for passthrough into HLS DATERANGE SCTE35-* hex attributes and DASH EventStream / Event base64 bodies.

Implementations§

Source§

impl SpliceInfo

Source

pub fn absolute_pts(&self) -> Option<u64>

Absolute PTS of the splice = pts_adjustment + splice_time.pts, when both are available. Wraps modulo 2^33 per SCTE 35.

Trait Implementations§

Source§

impl Clone for SpliceInfo

Source§

fn clone(&self) -> SpliceInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SpliceInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SpliceInfo

Source§

fn eq(&self, other: &SpliceInfo) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for SpliceInfo

Source§

impl StructuralPartialEq for SpliceInfo

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.