pub struct EmsgBox<'a> {
pub scheme_id_uri: &'a str,
pub value: &'a str,
pub timescale: u32,
pub presentation_time: PresentationTime,
pub event_duration: u32,
pub id: u32,
pub message_data: &'a [u8],
}Expand description
A parsed/owned MPEG-DASH Event Message Box (emsg).
Holds the typed FullBox body fields plus borrowed views of the two
null-terminated UTF-8 strings and the opaque message_data. The box size
and version are not stored: size is recomputed on serialize and
version is derived from PresentationTime, so the round-trip is driven
entirely from the typed fields (no raw passthrough).
Fields§
§scheme_id_uri: &'a strscheme_id_uri (Table 6-2): the URI defining the event scheme. Stored
without the wire 0x00 terminator.
value: &'a strvalue (Table 6-2): scheme-specific value, or the empty string when the
scheme defines none. Stored without the wire 0x00 terminator.
timescale: u32timescale (Table 6-2, u32): ticks per second for the time fields;
equal to the mdhd timescale of the Representation.
presentation_time: PresentationTimeThe presentation-time field — selects the box version (v0 delta vs v1
absolute).
event_duration: u32event_duration (Table 6-2, u32): event duration in timescale units.
id: u32id (Table 6-2, u32): unique identifier distinguishing events with the
same scheme_id_uri/value and detecting repetitions.
message_data: &'a [u8]message_data[] (Table 6-2): the opaque scheme-specific payload (the
remaining bytes of the box). Empty when the scheme needs none.
Implementations§
Source§impl<'a> EmsgBox<'a>
impl<'a> EmsgBox<'a>
Sourcepub fn version(&self) -> EmsgVersion
pub fn version(&self) -> EmsgVersion
The version of this box, derived from Self::presentation_time.
Sourcepub fn is_scte35(&self) -> bool
pub fn is_scte35(&self) -> bool
true if scheme_id_uri names a SCTE 35 scheme (urn:scte:scte35...),
in which case Self::message_data carries a SCTE 35
splice_info_section (SCTE 214-1 / ANSI/SCTE 35 — see crate root).
Sourcepub fn serialized_len(&self) -> usize
pub fn serialized_len(&self) -> usize
Total serialized size in bytes (the size field value).
Sourcepub fn parse(data: &'a [u8]) -> Result<Self>
pub fn parse(data: &'a [u8]) -> Result<Self>
Parse an emsg box from the start of data. Requires the full box
(size bytes) to be present; trailing bytes beyond size are ignored.
Sourcepub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
pub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>
Serialize the box into out, recomputing the size field and writing
flags = 0. Returns the number of bytes written.