pub struct Mpd {
pub profiles: String,
pub mpd_type: MpdType,
pub media_presentation_duration: Option<Duration>,
pub minimum_update_period: Option<Duration>,
pub availability_start_time: Option<String>,
pub time_shift_buffer_depth: Option<Duration>,
pub periods: Vec<Period>,
}Expand description
A parsed MPD document (ISO/IEC 23009-1 §5.3.1) — the root of
Mpd::parse’s output, and the structural inverse of
crate::dash::DashPackager’s rendered XML output.
Fields§
§profiles: StringMPD@profiles (§5.3.1.2).
mpd_type: MpdTypeMPD@type (§5.3.1.2 Table 3); Static when the attribute is absent
(the spec default).
media_presentation_duration: Option<Duration>MPD@mediaPresentationDuration (VOD only, §5.3.1.2 Table 3).
minimum_update_period: Option<Duration>MPD@minimumUpdatePeriod (live only, §5.3.1.2 Table 3).
availability_start_time: Option<String>MPD@availabilityStartTime (live only, §5.3.1.2 Table 3) — kept as the
raw ISO-8601 UTC string (no wall-clock parsing in this no_std crate).
time_shift_buffer_depth: Option<Duration>MPD@timeShiftBufferDepth (live only, §5.3.1.2 Table 3).
periods: Vec<Period>The document’s Period elements, in document order.
Implementations§
Source§impl Mpd
impl Mpd
Sourcepub fn parse(xml: &str) -> Result<Mpd, DashParseError>
pub fn parse(xml: &str) -> Result<Mpd, DashParseError>
Parse an MPD document (ISO/IEC 23009-1 §5.3) into this structural
model — the inverse of crate::dash::DashPackager’s rendered XML
output.
§SegmentTemplate inheritance
SegmentTemplate is an inheritable property along the
Period > AdaptationSet > Representation chain (§5.3.9.1). This
parser resolves that inheritance eagerly: after parsing each
AdaptationSet, every Representation whose own segment_template
is None is given a clone of the AdaptationSet-level one (if any) —
so Representation::segment_template is always the effective
template a caller should use, regardless of which element actually
declared it in the source XML.