Skip to content

Commit 8a8838a

Browse files
authored
Merge pull request #722 from wschidol/bugfix/schematronReportisMuted
convert reports into asserts
2 parents c6b6b9f + b36515e commit 8a8838a

File tree

2 files changed

+28
-28
lines changed

2 files changed

+28
-28
lines changed

DASH/mpdvalidator/schematron/ac4-generic.sch

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@
2727
<let name="md_compat" value="$cod[4]"/>
2828

2929
<!-- TS 103190-1, F.1.2.1 -->
30-
<report test="$bs_ver = '00' and @mimeType != ('audio/mp4','video/mp4')">The value of the mimeType attribute shall be set to 'audio/mp4' or 'video/mp4'.</report>
30+
<assert test="$bs_ver != '00' or @mimeType != ('audio/mp4','video/mp4')">The value of the mimeType attribute shall be set to 'audio/mp4' or 'video/mp4'.</assert>
3131
<!-- TS 103190-2, G.2.6 -->
32-
<report test="matches($codecs, 'ac-4\.(01|02)','i') and not(@audioSamplingRate)">@audioSamplingRate shall be set to the sampling frequency derived from the parameters fs_index and
33-
dsi_sf_multiplier, contained in ac4_dsi_v1.</report>
32+
<assert test="not(matches($codecs, 'ac-4\.(01|02)','i')) or @audioSamplingRate">@audioSamplingRate shall be set to the sampling frequency derived from the parameters fs_index and
33+
dsi_sf_multiplier, contained in ac4_dsi_v1.</assert>
3434
<!-- TS 103190-2, G.2.7 -->
35-
<report test="$bs_ver = ('01','02') and @mimeType != 'audio/mp4'">The value of the mimeType attribute shall be set to 'audio/mp4'.</report>
35+
<assert test="$bs_ver != ('01','02') or @mimeType = 'audio/mp4'">The value of the mimeType attribute shall be set to 'audio/mp4'.</assert>
3636
<!-- TS 103190-2, G.2.8 -->
37-
<report test="$bs_ver = ('01','02') and @startWithSAP != '1'">The @startWithSAP value shall be set to '1'.</report>
37+
<assert test="$bs_ver != ('01','02') or @startWithSAP = '1'">The @startWithSAP value shall be set to '1'.</assert>
3838
</rule>
3939
</pattern>
4040

@@ -50,8 +50,8 @@
5050
<title>Role element for AC-4</title>
5151
<rule context="dash:Role[matches(dlb:getNearestCodecString(.), 'ac-4\.00')]">
5252
<!-- TS 103 190-1 F.1.3.1 -->
53-
<report test="@schemeIdUri = 'urn:mpeg:dash:role:2011' and
54-
not(@value = ('main','alternate','commentary','dub'))">The value of Role (role) shall be main, alternate, commentary.</report>
53+
<assert test="@schemeIdUri != 'urn:mpeg:dash:role:2011' or
54+
@value = ('main','alternate','commentary','dub')">The value of Role (role) shall be main, alternate, commentary.</assert>
5555
</rule>
5656
</pattern>
5757

@@ -70,17 +70,17 @@
7070

7171
<!-- AC-4 Representations should contain or inherit exactly one AudioChannelConfiguration descriptor -->
7272
<!-- TS 103 190-1, F.1.2.3 -->
73-
<report test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2014,$NSMPEG_acc)]) &gt; 1" role="warn">
73+
<assert test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2014,$NSMPEG_acc)]) &lt;= 1" role="warn">
7474
<xsl:text>It is recommended to use exactly one AudioChannelConfiguration element with a schemeIdURI of </xsl:text>
7575
<value-of select="$NSDLB_acc2014"/> or <value-of select="$NSMPEG_acc"/>
76-
</report>
76+
</assert>
7777

7878
<!-- TS 103 190-1, F.1.4.1 -->
7979
<assert test="matches(@value,'^[0-9a-fA-F]{4}$')">The value element shall contain a four-digit hexadecimal representation of the 16-bit field which describes
8080
the channel assignment of the referenced AC-4 elementary stream</assert>
8181
<let name="val6" value="concat('00',@value)"/>
8282
<let name="x" value="dlb:dlb2mpg($val6)"/>
83-
<report test="$x != 0">Use &lt;<name/> schemeIdUri="<value-of select="$NSMPEG_acc"/>" value="<value-of select="$x"/>"/&gt;</report>
83+
<assert test="$x = 0">Use &lt;<name/> schemeIdUri="<value-of select="$NSMPEG_acc"/>" value="<value-of select="$x"/>"/&gt;</assert>
8484
</rule>
8585
</pattern>
8686

@@ -90,19 +90,19 @@
9090
<!-- check that only specified schemeIdUris are used -->
9191
<!-- TS 103 190-2, G.2.5 -->
9292
<rule context="dash:AudioChannelConfiguration[matches(dlb:getNearestCodecString(.),'ac-4\.(01|02)')][not(@schemeIdUri = ($NSDLB_acc2015,$NSMPEG_acc))]">
93-
<report test="true()" role="warn">
93+
<assert test="false()" role="warn">
9494
Unspecified schemeIdUri in AudioChannelConfiguration element
95-
</report>
95+
</assert>
9696
</rule>
9797

9898
<rule context="dash:AudioChannelConfiguration[matches(dlb:getNearestCodecString(.),'ac-4\.(01|02)')][@schemeIdUri eq $NSDLB_acc2015]">
9999
<!-- TS 103 190-2, G.2.5 -->
100100
<!-- AC-4 Representations should contain or inherit exactly one AudioChannelConfiguration descriptor -->
101-
<report test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2015,$NSMPEG_acc)]) &gt; 1" role="warn">
101+
<assert test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2015,$NSMPEG_acc)]) &lt;= 1" role="warn">
102102
<xsl:text>It is recommended to use exactly one AudioChannelConfiguration element with a schemeIdURI of </xsl:text>
103103
<xsl:text></xsl:text>
104104
<value-of select="$NSDLB_acc2015"/> or <value-of select="$NSMPEG_acc"/>
105-
</report>
105+
</assert>
106106

107107
<!-- TS 103 190-2, G.3.1 -->
108108
<!-- AudioChannelConfiguration descriptors with schemeIDUri tag:dolby.com,2014:dash:audio_channel_configuration:2011 shall be of certain format -->
@@ -111,18 +111,18 @@
111111

112112
<!-- TS 103 190-2, G.2.5 -->
113113
<let name="x" value="dlb:dlb2mpg(@value)"/>
114-
<report test="$x != 0">For all AC-4 channel configurations that are mappable to the MPEG channel configuration scheme, the scheme described by
115-
@schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" shall be used</report>
114+
<assert test="$x = 0">For all AC-4 channel configurations that are mappable to the MPEG channel configuration scheme, the scheme described by
115+
@schemeIdUri="urn:mpeg:mpegB:cicp:ChannelConfiguration" shall be used</assert>
116116
</rule>
117117

118118
<rule context="dash:AudioChannelConfiguration[matches(dlb:getNearestCodecString(.),'ac-4\.(01|02)')][@schemeIdUri eq $NSMPEG_acc]">
119119
<!-- TS 103 190-2, G.2.5 -->
120120
<!-- AC-4 Representations should contain or inherit exactly one AudioChannelConfiguration descriptor -->
121-
<report test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2015,$NSMPEG_acc)]) &gt; 1" role="warn">
121+
<assert test="count(ancestor::*/dash:AudioChannelConfiguration[@schemeIdUri = ($NSDLB_acc2015,$NSMPEG_acc)]) &lt;= 1" role="warn">
122122
<xsl:text>It is recommended to use exactly one AudioChannelConfiguration element with a schemeIdURI of </xsl:text>
123123
<xsl:text></xsl:text>
124124
<value-of select="$NSDLB_acc2015"/> or <value-of select="$NSMPEG_acc"/>
125-
</report>
125+
</assert>
126126

127127
<!-- TS 103 190-2, G.3.2 -->
128128
<!-- AudioChannelConfiguration descriptors with schemeIDUri urn:mpeg:mpegB:cicp:ChannelConfiguration shall be of certain format -->

DASH/mpdvalidator/schematron/dvb-dash.sch

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
<!-- Check the conformance of AdaptationSet -->
1313
<rule context="dash:MPD[$dvbdash-profile-2017 = tokenize(@profiles,' ')]/dash:Period/dash:AdaptationSet[dlb:isAdaptationSetAudio(.)][not(dlb:isAuxiliaryStream(.))]/dash:Representation">
1414
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=28" -->
15-
<report test="@mimeType != ancestor::dash:AdaptationSet/dash:Representation/@mimeType">@mimeType shall be common between all Representations in an Adaptation Set</report>
15+
<assert test="@mimeType = ancestor::dash:AdaptationSet/dash:Representation/@mimeType">@mimeType shall be common between all Representations in an Adaptation Set</assert>
1616
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=28" -->
17-
<report test="@codecs != ancestor::dash:AdaptationSet/dash:Representation/@codecs" role="warn">@codecs should be common between all Representations in an Adaptation Set</report>
17+
<assert test="@codecs = ancestor::dash:AdaptationSet/dash:Representation/@codecs" role="warn">@codecs should be common between all Representations in an Adaptation Set</assert>
1818
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=28" -->
19-
<report test="@audioSamplingRate != ancestor::dash:AdaptationSet/dash:Representation/@audioSamplingRate" role="warn">@audioSamplingRate should be common between all Representations in an Adaptation Set</report>
19+
<assert test="@audioSamplingRate = ancestor::dash:AdaptationSet/dash:Representation/@audioSamplingRate" role="warn">@audioSamplingRate should be common between all Representations in an Adaptation Set</assert>
2020
</rule>
2121
<rule context="dash:MPD[$dvbdash-profile-2017 = tokenize(@profiles,' ')]/dash:Period/dash:AdaptationSet[dlb:isAdaptationSetAudio(.)][not(dlb:isAuxiliaryStream(.))]/dash:Representation/dash:AudioChannelConfiguration">
2222
<let name="siu" value="@schemeIdUri"/>
2323
<let name="val" value="@value"/>
2424
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=28" -->
25-
<report test="$val != ancestor::dash:AdaptationSet/dash:Representation/dash:AudioChannelConfiguration[@schemeIdUri = $siu]/@value" role="warn">audioChannelConfiguration should be common between all Representations in an Adaptation Set</report>
25+
<assert test="$val = ancestor::dash:AdaptationSet/dash:Representation/dash:AudioChannelConfiguration[@schemeIdUri = $siu]/@value" role="warn">audioChannelConfiguration should be common between all Representations in an Adaptation Set</assert>
2626
</rule>
2727
<rule context="dash:MPD[$dvbdash-profile-2017 = tokenize(@profiles,' ')]/dash:Period/dash:AdaptationSet[dlb:isAdaptationSetAudio(.)][dlb:isAuxiliaryStream(.)]">
2828
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=37" -->
29-
<report test="dash:AudioChannelConfiguration or dash:Role or dash:Accessibility or @lang">All Adaptation Sets that refer to Auxiliary Audio streams may not contain the @lang attribute and Role,
30-
Accessibility, AudioChannelConfiguration descriptors</report>
29+
<assert test="not(dash:AudioChannelConfiguration or dash:Role or dash:Accessibility or @lang)">All Adaptation Sets that refer to Auxiliary Audio streams may not contain the @lang attribute and Role,
30+
Accessibility, AudioChannelConfiguration descriptors</assert>
3131
</rule>
3232
</pattern>
3333

@@ -43,15 +43,15 @@
4343

4444
<!-- If there is more than one preselection in this bundle, at least one must be main -->
4545
<!-- see="https://www.etsi.org/deliver/etsi_ts/103200_103299/103285/01.02.01_60/ts_103285v010201p.pdf#page=37" -->
46-
<report test="count(../dash:Preselection[$bundleID = tokenize(@preselectionComponents,' ')]) &gt; 1 and not(../dash:Preselection[$bundleID = tokenize(@preselectionComponents,' ')]/dash:Role[@schemeIdUri='urn:mpeg:dash:role:2011'][@value='main'])">If there is more than one audio Preselection associated with an audio bundle, at least one of the Preselection
47-
elements shall be tagged with an @value set to "main".</report>
46+
<assert test="count(../dash:Preselection[$bundleID = tokenize(@preselectionComponents,' ')]) &lt;= 1 or ../dash:Preselection[$bundleID = tokenize(@preselectionComponents,' ')]/dash:Role[@schemeIdUri='urn:mpeg:dash:role:2011'][@value='main']">If there is more than one audio Preselection associated with an audio bundle, at least one of the Preselection
47+
elements shall be tagged with an @value set to "main".</assert>
4848

4949
<!-- ISO/IEC 23009-1, 3rd edition, clause 5.3.11.3 -->
50-
<report test="some $x in tokenize(@preselectionComponents,' ') satisfies not($x = preceding-sibling::dash:AdaptationSet/@id)"
50+
<assert test="every $x in tokenize(@preselectionComponents,' ') satisfies $x = preceding-sibling::dash:AdaptationSet/@id"
5151
diagnostics="preselID">
5252
@preselectionComponents specifies the ids of the contained Adaptation Sets or Content Components that belong to this Preselection
5353
as white space separated list in processing order.
54-
</report>
54+
</assert>
5555
</rule>
5656
</pattern>
5757
<diagnostics>

0 commit comments

Comments
 (0)