Skip to content

Commit

Permalink
make profile check compile with supplied schematron implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
wschidol committed Jun 28, 2022
1 parent 62fcc56 commit 25331dc
Showing 1 changed file with 52 additions and 46 deletions.
98 changes: 52 additions & 46 deletions DASH/mpdvalidator/schematron/schematron.sch
Original file line number Diff line number Diff line change
@@ -1,15 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:dash="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding='xslt2' schemaVersion='ISO19757-3'>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:dash="urn:mpeg:dash:schema:mpd:2011" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:cenc="urn:mpeg:cenc:2013" xmlns:dlb="http://www.dolby.com/ns/2019/dash-if" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" queryBinding='xslt2' schemaVersion='ISO19757-3'>
<ns prefix="dash" uri="urn:mpeg:dash:schema:mpd:2011"/>
<ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
<ns prefix="xsi" uri="http://www.w3.org/2001/XMLSchema-instance"/>
<ns prefix="xs" uri="http://www.w3.org/2001/XMLSchema"/>
<ns prefix="xsl" uri="http://www.w3.org/1999/XSL/Transform"/>
<ns prefix="cenc" uri="urn:mpeg:cenc:2013"/>
<ns prefix="dlb" uri="http://www.dolby.com/ns/2019/dash-if"/>

<!-- include some helper functions for codec specific assertions, needed for DVB DASH assertions -->
<extends href="helper-functions.sch"/>

<xsl:function name="dlb:supported-profiles">
<profiles xmlns="http://www.dolby.com/ns/2019/dash-if">
<profile uri='urn:mpeg:dash:profile:isoff-on-demand:2011'>On-Demand profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-ext-on-demand:2014'>extended On-Demand profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-live:2011'>live profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-ext-live:2014'>extended live profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-main:2011'>main profile</profile>
<profile uri='urn:mpeg:dash:profile:full:2011'>full profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-common:2014'>common profile</profile>
<profile uri='urn:mpeg:dash:profile:isoff-broadcast:2015'>broadcast profile</profile>
<profile uri='urn:mpeg:dash:profile:mp2t-main:2011'>mp2t-main profile</profile>
<profile uri='urn:mpeg:dash:profile:mp2t-simple:2011'>mp2t-simple profile</profile>
<profile uri='http://dashif.org/guidelines/dash264'>DASH-IF profile</profile>
<profile uri='http://dashif.org/guidelines/dash264#sd'>DASH-IF SD profile</profile>
<profile uri='http://dashif.org/guidelines/dash264#hd'>DASH-IF HD profile</profile>
<profile uri='http://dashif.org/guidelines/dash264main'>DASH-IF main profile</profile>
<profile uri='http://dashif.org/guidelines/dash264high'>DASH-IF high profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-simple'>DASH-IF IOP simple profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-main'>DASH-IF IOP main profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-ondemand'>DASH-IF IOP on demand profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-mixed'>DASH-IF IOP mixed on demand profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#ec-3'>DASH-IF multichannel audio extension with Enhanced AC-3</profile>
<profile uri='http://dashif.org/guidelines/dashif#mlpa'>DASH-IF multichannel extension with Dolby TrueHD</profile>
<profile uri='http://dashif.org/guidelines/dashif#ac-4'>Dolby AC-4 profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#dtsc'>DASH-IF multichannel extension with DTS Digital Surround</profile>
<profile uri='http://dashif.org/guidelines/dashif#dtsh'>DASH-IF multichannel audio extension with DTS-HD High Resolution and DTS-HD Master Audio</profile>
<profile uri='http://dashif.org/guidelines/dashif#dtse'>DASH-IF multichannel audio extension with DTS Express</profile>
<profile uri='http://dashif.org/guidelines/dashif#dtsl'>DASH-IF multichannel audio extension with DTS-HD Lossless profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#mps'>DASH-IF multichannel audio extension with MPEG Surround profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#heaac-mc51'>DASH-IF multichannel audio extension with HEAACv2 Level 4 profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#heaac-mc71'>DASH-IF multichannel audio extension with HEAACv2 Level 6 profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#mpeg-h-3da'>multichannel audio extension with MPEG-H 3D Audio profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#cxha'>DASH-IF audio extension with USAC profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-uhd#4k'>DASH-IF UHD HEVC 4K profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-uhd#hdr-pq10'>DASH-IF HEVC HDR PQ10 profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#vp9'>VP9-HD profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-uhd#vp9'>VP9-UHD profile</profile>
<profile uri='http://dashif.org/guidelines/dashif#vp9-hdr'>VP9-HDR profile</profile>
<profile uri='http://dashif.org/guidelines/dash-if-uhd#vp9-hdr'>VP9-HDR profile</profile>
<profile uri='urn:dvb:dash:profile:dvb-dash:2014'>DVB-DASH 2014 profile</profile>
<profile uri='urn:dvb:dash:profile:dvb-dash:2017'>DVB-DASH 2017 profile</profile>
<profile uri='urn:hbbtv:dash:profile:isoff-live:2012'>HbbTV 1.5 profile</profile>
</profiles>
</xsl:function>
<xsl:function name="dlb:dquote">"</xsl:function>

<title>Schema for validating MPDs</title>
<pattern>
<title>MPD element</title>
Expand All @@ -27,54 +74,13 @@
<assert test="if (not(@mediaPresentationDuration) and not(@minimumUpdatePeriod)) then false() else true()">If mediaPresentationDuration is not defined for the MPD minimumUpdatePeriod shall be defined or vice versa.</assert>
<!-- R1.7 -->

<xsl:variable name="supported-profiles">
<x uri='urn:mpeg:dash:profile:isoff-on-demand:2011'>On-Demand profile</x>
<x uri='urn:mpeg:dash:profile:isoff-ext-on-demand:2014'>extended On-Demand profile</x>
<x uri='urn:mpeg:dash:profile:isoff-live:2011'>live profile</x>
<x uri='urn:mpeg:dash:profile:isoff-ext-live:2014'>extended live profile</x>
<x uri='urn:mpeg:dash:profile:isoff-main:2011'>main profile</x>
<x uri='urn:mpeg:dash:profile:full:2011'>full profile</x>
<x uri='urn:mpeg:dash:profile:isoff-common:2014'>common profile</x>
<x uri='urn:mpeg:dash:profile:isoff-broadcast:2015'>broadcast profile</x>
<x uri='urn:mpeg:dash:profile:mp2t-main:2011'>mp2t-main profile</x>
<x uri='urn:mpeg:dash:profile:mp2t-simple:2011'>mp2t-simple profile</x>
<x uri='http://dashif.org/guidelines/dash264'>DASH-IF profile</x>
<x uri='http://dashif.org/guidelines/dash264#sd'>DASH-IF SD profile</x>
<x uri='http://dashif.org/guidelines/dash264#hd'>DASH-IF HD profile</x>
<x uri='http://dashif.org/guidelines/dash264main'>DASH-IF main profile</x>
<x uri='http://dashif.org/guidelines/dash264high'>DASH-IF high profile</x>
<x uri='http://dashif.org/guidelines/dash-if-simple'>DASH-IF IOP simple profile</x>
<x uri='http://dashif.org/guidelines/dash-if-main'>DASH-IF IOP main profile</x>
<x uri='http://dashif.org/guidelines/dash-if-ondemand'>DASH-IF IOP on demand profile</x>
<x uri='http://dashif.org/guidelines/dash-if-mixed'>DASH-IF IOP mixed on demand profile</x>
<x uri='http://dashif.org/guidelines/dashif#ec-3'>DASH-IF multichannel audio extension with Enhanced AC-3</x>
<x uri='http://dashif.org/guidelines/dashif#mlpa'>DASH-IF multichannel extension with Dolby TrueHD</x>
<x uri='http://dashif.org/guidelines/dashif#ac-4'>Dolby AC-4 profile</x>
<x uri='http://dashif.org/guidelines/dashif#dtsc'>DASH-IF multichannel extension with DTS Digital Surround</x>
<x uri='http://dashif.org/guidelines/dashif#dtsh'>DASH-IF multichannel audio extension with DTS-HD High Resolution and DTS-HD Master Audio</x>
<x uri='http://dashif.org/guidelines/dashif#dtse'>DASH-IF multichannel audio extension with DTS Express</x>
<x uri='http://dashif.org/guidelines/dashif#dtsl'>DASH-IF multichannel audio extension with DTS-HD Lossless profile</x>
<x uri='http://dashif.org/guidelines/dashif#mps'>DASH-IF multichannel audio extension with MPEG Surround profile</x>
<x uri='http://dashif.org/guidelines/dashif#heaac-mc51'>DASH-IF multichannel audio extension with HEAACv2 Level 4 profile</x>
<x uri='http://dashif.org/guidelines/dashif#heaac-mc71'>DASH-IF multichannel audio extension with HEAACv2 Level 6 profile</x>
<x uri='http://dashif.org/guidelines/dashif#mpeg-h-3da'>multichannel audio extension with MPEG-H 3D Audio profile</x>
<x uri='http://dashif.org/guidelines/dashif#cxha'>DASH-IF audio extension with USAC profile</x>
<x uri='http://dashif.org/guidelines/dash-if-uhd#4k'>DASH-IF UHD HEVC 4K profile</x>
<x uri='http://dashif.org/guidelines/dash-if-uhd#hdr-pq10'>DASH-IF HEVC HDR PQ10 profile</x>
<x uri='http://dashif.org/guidelines/dashif#vp9'>VP9-HD profile</x>
<x uri='http://dashif.org/guidelines/dash-if-uhd#vp9'>VP9-UHD profile</x>
<x uri='http://dashif.org/guidelines/dashif#vp9-hdr'>VP9-HDR profile</x>
<x uri='http://dashif.org/guidelines/dash-if-uhd#vp9-hdr'>VP9-HDR profile</x>
<x uri='urn:dvb:dash:profile:dvb-dash:2014'>DVB-DASH 2014 profile</x>
<x uri='urn:dvb:dash:profile:dvb-dash:2017'>DVB-DASH 2017 profile</x>
<x uri='urn:hbbtv:dash:profile:isoff-live:2012'>HbbTV 1.5 profile</x>
</xsl:variable>
<xsl:variable name="DQUOTE">"</xsl:variable>
<let name="supported-profiles" value="dlb:supported-profiles()"/>
<let name="DQUOTE" value="dlb:dquote()"/>
<!-- build a human-readable list of supported profiles -->
<let name="supported-profiles-helper" value="for $x in $supported-profiles/x return concat('the ',$x,' -',$DQUOTE,$x/@uri,$DQUOTE)"/>
<let name="supported-profiles-helper" value="for $x in $supported-profiles/dlb:profile return concat('the ',$x,' -',$DQUOTE,$x/@uri,$DQUOTE)"/>
<let name="supported-profiles-docstring" value="string-join($supported-profiles-helper,', ')"/>
<!-- assert that all profiles are in the list of supported profiles -->
<assert test="if (not(@profiles) or (every $t in tokenize(@profiles,',') satisfies $t = $supported-profiles/x/@uri)) then true() else false()">An unknown profile string "<value-of select="@profiles"/>"(other than <value-of select="$supported-profiles-docstring"/>) found.</assert>
<assert test="if (not(@profiles) or (every $t in tokenize(@profiles,',') satisfies $t = $supported-profiles/dlb:profile/@uri)) then true() else false()">An unknown profile string "<value-of select="@profiles"/>" (other than <value-of select="$supported-profiles-docstring"/>) found.</assert>
<!-- R1.8 -->
<assert test="if (not(contains(@profiles, 'urn:mpeg:dash:profile:isoff-on-demand:2011')) or not(@type) or @type='static') then true() else false()">For On-Demand profile, the MPD @type shall be "static".</assert>
<!-- R1.9 -->
Expand Down

0 comments on commit 25331dc

Please sign in to comment.