Skip to content

Commit 0fef16c

Browse files
authored
Merge pull request #707 from w3c/dalecurtis-codec-string-patch
Remove ambiguity around valid codec strings during support checks.
2 parents c462aa4 + 1e0fbe3 commit 0fef16c

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

index.src.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1720,11 +1720,14 @@
17201720
<dfn>Check Configuration Support</dfn> (with |config|) {#config-support}
17211721
------------------------------------------------------------------------
17221722
Run these steps:
1723-
1. If |config| is an {{AudioDecoderConfig}} or {{VideoDecoderConfig}} and the
1723+
1. If the <a>codec string</a> in |config|.codec is not a
1724+
<a>valid codec string</a> or is otherwise unrecognized by the User Agent,
1725+
return `false`.
1726+
2. If |config| is an {{AudioDecoderConfig}} or {{VideoDecoderConfig}} and the
17241727
User Agent can't provide a <a>codec</a> that can decode the exact profile
17251728
(where present), level (where present), and constraint bits (where present)
17261729
indicated by the <a>codec string</a> in |config|.codec, return `false`.
1727-
2. If |config| is an {{AudioEncoderConfig}} or {{VideoEncoderConfig}}:
1730+
3. If |config| is an {{AudioEncoderConfig}} or {{VideoEncoderConfig}}:
17281731
1. If the <a>codec string</a> in |config|.codec contains a profile and the
17291732
User Agent can't provide a <a>codec</a> that can encode the exact
17301733
profile indicated by |config|.codec, return `false`.
@@ -1735,7 +1738,7 @@
17351738
the User Agent can't provide a <a>codec</a> that can produce an encoded
17361739
bitstream at least as constrained as indicated by |config|.codec, return
17371740
`false`.
1738-
3. If the User Agent can provide a <a>codec</a> to support all entries of the
1741+
4. If the User Agent can provide a <a>codec</a> to support all entries of the
17391742
|config|, including applicable default values for keys that are not
17401743
included, return `true`.
17411744

@@ -1749,7 +1752,7 @@
17491752
a best-effort basis given the resources that are available at the time
17501753
of the query.
17511754

1752-
2. Otherwise, return false.
1755+
5. Otherwise, return false.
17531756

17541757
<dfn>Clone Configuration</dfn> (with |config|) {#clone-config}
17551758
--------------------------------------------------------------
@@ -1900,7 +1903,9 @@
19001903

19011904
To check if an {{AudioDecoderConfig}} is a <dfn export>valid AudioDecoderConfig</dfn>,
19021905
run these steps:
1903-
1. If codec is not a <a>valid codec string</a>, return `false`.
1906+
1. If {{AudioDecoderConfig/codec}} is empty after
1907+
[=strip leading and trailing ASCII whitespace|stripping leading and trailing ASCII whitespace=],
1908+
return `false`.
19041909
2. Return `true`.
19051910

19061911
<dl>
@@ -1942,8 +1947,9 @@
19421947

19431948
To check if a {{VideoDecoderConfig}} is a <dfn export>valid VideoDecoderConfig</dfn>,
19441949
run these steps:
1945-
1. If {{VideoDecoderConfig/codec}} is not a <a>valid codec string</a>, return
1946-
`false`.
1950+
1. If {{VideoDecoderConfig/codec}} is empty after
1951+
[=strip leading and trailing ASCII whitespace|stripping leading and trailing ASCII whitespace=],
1952+
return `false`.
19471953
2. If one of {{VideoDecoderConfig/codedWidth}} or
19481954
{{VideoDecoderConfig/codedHeight}} is provided but the other isn't,
19491955
return `false`.
@@ -2043,8 +2049,9 @@
20432049

20442050
To check if an {{AudioEncoderConfig}} is a <dfn>valid AudioEncoderConfig</dfn>,
20452051
run these steps:
2046-
1. If {{AudioEncoderConfig/codec}} is not a <a>valid codec string</a>, return
2047-
`false`.
2052+
1. If {{AudioEncoderConfig/codec}} is empty after
2053+
[=strip leading and trailing ASCII whitespace|stripping leading and trailing ASCII whitespace=],
2054+
return `false`.
20482055
2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding
20492056
registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether
20502057
the extension is a valid extension, return the result of running those steps.
@@ -2098,8 +2105,9 @@
20982105

20992106
To check if a {{VideoEncoderConfig}} is a <dfn>valid VideoEncoderConfig</dfn>,
21002107
run these steps:
2101-
1. If {{VideoEncoderConfig/codec}} is not a <a>valid codec string</a>, return
2102-
`false`.
2108+
1. If {{VideoEncoderConfig/codec}} is empty after
2109+
[=strip leading and trailing ASCII whitespace|stripping leading and trailing ASCII whitespace=],
2110+
return `false`.
21032111
2. If {{VideoEncoderConfig/width}} = 0 or {{VideoEncoderConfig/height}}
21042112
= 0, return `false`.
21052113
3. If {{VideoEncoderConfig/displayWidth}} = 0 or

0 commit comments

Comments
 (0)