#[non_exhaustive]pub struct TimedEvent {
pub id: Option<u32>,
pub kind: EventKind,
pub at: Option<MediaTime>,
pub duration: Option<MediaDuration>,
pub source: SourcePayload,
}Expand description
The canonical event passed between format adapters.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: Option<u32>Event id (splice_event_id / emsg id).
kind: EventKindAbstract meaning.
at: Option<MediaTime>Media-timeline instant; None = immediate / determined by insertion point.
duration: Option<MediaDuration>Event duration, if known.
source: SourcePayloadLossless original.
Implementations§
Source§impl TimedEvent
impl TimedEvent
Sourcepub fn new(kind: EventKind, source: SourcePayload) -> Self
pub fn new(kind: EventKind, source: SourcePayload) -> Self
Build a canonical event from its required meaning and source, leaving
id/at/duration unset (set them with Self::with_id /
Self::with_at / Self::with_duration as applicable).
Sourcepub fn with_duration(self, duration: MediaDuration) -> Self
pub fn with_duration(self, duration: MediaDuration) -> Self
Attach the event duration.
Sourcepub fn from_scte35(section: &SpliceInfoSection<'_>, raw: &[u8]) -> Result<Self>
pub fn from_scte35(section: &SpliceInfoSection<'_>, raw: &[u8]) -> Result<Self>
Build from a parsed SCTE-35 section, retaining raw verbatim.
Every pts_time is shifted by the section’s pts_adjustment (SCTE 35
§9.6.1: “the value of pts_adjustment shall be added to the
pts_time… modulo 2^33”) via broadcast_common::clock33::add
before it becomes TimedEvent::at — the section itself is not
mutated, only the value this crate derives from it.
Trait Implementations§
Source§impl Clone for TimedEvent
impl Clone for TimedEvent
Source§impl Debug for TimedEvent
impl Debug for TimedEvent
Source§impl<'de> Deserialize<'de> for TimedEvent
Available on crate feature serde only.
impl<'de> Deserialize<'de> for TimedEvent
serde only.Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for TimedEvent
Source§impl PartialEq for TimedEvent
impl PartialEq for TimedEvent
Source§impl Serialize for TimedEvent
Available on crate feature serde only.
impl Serialize for TimedEvent
serde only.