Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 5thEdition elements and test data #31

Merged
merged 2 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Ed5Amd1 element `<SelectionInfo>` inside mixed XML type `<Event>`

### Fixed

- Updated the G16 example
- Avoid escaping XML tab and newline in text to align with DASHSchema test content
- Handle text inside `<Event>`element

### Chore

Expand Down
19 changes: 18 additions & 1 deletion mpd/mpd.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,31 @@ type EventStreamType struct {
Events []*EventType `xml:"Event"`
}

// EventType is Event.
// EventType is Event. This has settings mixed="true" in the schema, so it can either
// have charData or child elements or both.
type EventType struct {
XMLName xml.Name `xml:"Event"`
PresentationTime uint64 `xml:"presentationTime,attr,omitempty"` // default is 0
Duration uint64 `xml:"duration,attr,omitempty"`
Id uint32 `xml:"id,attr"`
ContentEncoding ContentEncodingType `xml:"contentEncoding,attr,omitempty"`
MessageData string `xml:"messageData,attr,omitempty"`
Value string `xml:",chardata"`
SelectionInfo *SelectionInfoType `xml:"SelectionInfo"`
}

// SelectionInfoType is SelectionInfo
type SelectionInfoType struct {
SelectionInfo string `xml:"selectionInfo,attr,omitempty"`
ContactURL string `xml:"contactURL,attr"`
Selection []*SelectionType `xml:"Selection"`
}

// SelectionType is Selection
type SelectionType struct {
DataEncoding string `xml:"dataEncoding,attr,omitempty"`
Parameter string `xml:"parameter,attr"`
Data string `xml:"data,attr,omitempty"`
}

// InitializationSetType is Initialization Set.
Expand Down
27 changes: 27 additions & 0 deletions mpd/testdata/schema-mpds/example_G23.mpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<MPD
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
availabilityStartTime="1970-01-01T00:00:00Z" maxSegmentDuration="PT6S"
minBufferTime="PT2S" minimumUpdatePeriod="PT5M"
profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2019-03-12T01:17:30Z"
timeShiftBufferDepth="PT8M20S" type="dynamic">
<Period id="p0" start="PT0S">
<BaseURL>http://liveserver.com/live/live1/</BaseURL>
<EventStream schemeIdUri="urn:mpeg:dash:event:insertion:2022"
value="replace" timescale="1000">
<Event duration="60000" id="0">
http://acmeadsertver.com/preroll.mpd
</Event>
</EventStream>
<AdaptationSet contentType="video" maxHeight="1920" maxWidth="1080"
mimeType="video/mp4" par="16:9" segmentAlignment="true" startWithSAP="1">
<SegmentTemplate duration="2" initialization="$RepresentationID$/init.mp4"
media="$RepresentationID$/$Number$.m4s" startNumber="0" />
<Representation id="V300" bandwidth="300000" codecs="avc1.64001e"
frameRate="60/2" />
<Representation id="V600" bandwidth="600000" codecs="avc1.64001e"
frameRate="60/2" />
</AdaptationSet>
</Period>
</MPD>
28 changes: 28 additions & 0 deletions mpd/testdata/schema-mpds/example_G24.mpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<MPD
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
availabilityStartTime="1970-01-01T00:00:00Z" maxSegmentDuration="PT6S"
minBufferTime="PT2S" minimumUpdatePeriod="PT5M"
profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2019-03-12T01:17:30Z"
timeShiftBufferDepth="PT8M20S" type="dynamic">
<Period id="p0" start="PT0S">
<BaseURL>http://liveserver.com/live/live1/</BaseURL>
<EventStream schemeIdUri="urn:mpeg:dash:event:insertion:2022"
value="replace" timescale="1000">
<Event presentationTime="60000" duration="10000000" id="0">
http://acmeadsertver.com/preroll.mpd
</Event>
</EventStream>
<AdaptationSet contentType="video" maxHeight="1920" maxWidth="1080"
mimeType="video/mp4" par="16:9" segmentAlignment="true" startWithSAP="1">
<SegmentTemplate duration="2" initialization="$RepresentationID$/init.mp4"
media="$RepresentationID$/$Number$.m4s" startNumber="0" />
<Representation id="V300" bandwidth="300000" codecs="avc1.64001e"
frameRate="60/2" />
<Representation id="V600" bandwidth="600000" codecs="avc1.64001e"
frameRate="60/2" />
</AdaptationSet>
</Period>
</MPD>
28 changes: 28 additions & 0 deletions mpd/testdata/schema-mpds/example_G25.mpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<MPD
xmlns="urn:mpeg:dash:schema:mpd:2011"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
availabilityStartTime="1970-01-01T00:00:00Z" maxSegmentDuration="PT6S"
minBufferTime="PT2S" minimumUpdatePeriod="PT5M"
profiles="urn:mpeg:dash:profile:isoff-live:2011" publishTime="2019-03-12T01:17:30Z"
timeShiftBufferDepth="PT8M20S" type="dynamic">
<Period id="p0" start="PT0S">
<BaseURL>http://liveserver.com/live/live1/</BaseURL>
<EventStream schemeIdUri="urn:mpeg:dash:event:insertion:2022"
value="insert" timescale="1000">
<Event presentationTime="60000" id="0"
duration="120000">http://acmeadsertver.com/preroll.mpd</Event>
</EventStream>
<AdaptationSet contentType="video" maxHeight="1920" maxWidth="1080"
mimeType="video/mp4" par="16:9" segmentAlignment="true" startWithSAP="1">
<SegmentTemplate duration="2" initialization="$RepresentationID$/init.mp4"
media="$RepresentationID$/$Number$.m4s" startNumber="0" />
<Representation id="V300" bandwidth="300000" codecs="avc1.64001e"
frameRate="60/2" />
<Representation id="V600" bandwidth="600000" codecs="avc1.64001e"
frameRate="60/2" />
</AdaptationSet>
</Period>
</MPD>

49 changes: 49 additions & 0 deletions mpd/testdata/schema-mpds/example_G26.mpd
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<MPD
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="urn:mpeg:dash:schema:mpd:2011"
xsi:schemaLocation="urn:mpeg:dash:schema:mpd:2011 DASH-MPD.xsd"
type="dynamic"
minBufferTime="PT2S"
profiles="urn:mpeg:dash:profile:isoff-live:2011">
<BaseURL>http://cdn1.example.com/</BaseURL>
<BaseURL>http://cdn2.example.com/</BaseURL>
<Period>
<EventStream schemeIdUri="urn:mpeg:dash:nonlinearplayback:2020"
value="urn:xapp:2020:userinterface1">
<Event presentationTime="30" duration="30" id="0">
<SelectionInfo
selectionInfo="What do you like to happen next?"
contactURL="http://cdn.com/content_xyz/">
<Selection parameter="1" data="Bill kills Alice"/>
<Selection parameter="2" data="Bill kisses Alice"/>
<Selection parameter="3" data="Bill frames Alice"/>
<Selection parameter="blue" data="Bill kisses Alice"/>
<Selection parameter="red" data="Bill frames Alice"/>
<Selection parameter="default"/>
</SelectionInfo>
</Event>
</EventStream>
<!-- Audio -->
<AdaptationSet mimeType="audio/mp4" codecs="mp4a.40" lang="en" subsegmentAlignment="true" subsegmentStartsWithSAP="1">
<Representation id="1" bandwidth="64000">
<BaseURL>7657412348.mp4</BaseURL>
</Representation>
</AdaptationSet>
<!-- Video -->
<AdaptationSet mimeType="video/mp4" codecs="avc1.4d0228" subsegmentAlignment="true" subsegmentStartsWithSAP="2">
<Representation id="1" bandwidth="1024000" width="640" height="480">
<BaseURL>562465736.mp4</BaseURL>
</Representation>
<Representation id="2" bandwidth="1384000" width="640" height="480">
<BaseURL>41325645.mp4</BaseURL>
</Representation>
<Representation id="3" bandwidth="1536000" width="1280" height="720">
<BaseURL>89045625.mp4</BaseURL>
</Representation>
<Representation id="4" bandwidth="2048000" width="1280" height="720">
<BaseURL>23536745734.mp4</BaseURL>
</Representation>
</AdaptationSet>
</Period>
</MPD>
Loading
Loading