|
1720 | 1720 | <dfn>Check Configuration Support</dfn> (with |config|) {#config-support}
|
1721 | 1721 | ------------------------------------------------------------------------
|
1722 | 1722 | 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 |
1724 | 1727 | User Agent can't provide a <a>codec</a> that can decode the exact profile
|
1725 | 1728 | (where present), level (where present), and constraint bits (where present)
|
1726 | 1729 | 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}}: |
1728 | 1731 | 1. If the <a>codec string</a> in |config|.codec contains a profile and the
|
1729 | 1732 | User Agent can't provide a <a>codec</a> that can encode the exact
|
1730 | 1733 | profile indicated by |config|.codec, return `false`.
|
|
1735 | 1738 | the User Agent can't provide a <a>codec</a> that can produce an encoded
|
1736 | 1739 | bitstream at least as constrained as indicated by |config|.codec, return
|
1737 | 1740 | `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 |
1739 | 1742 | |config|, including applicable default values for keys that are not
|
1740 | 1743 | included, return `true`.
|
1741 | 1744 |
|
|
1749 | 1752 | a best-effort basis given the resources that are available at the time
|
1750 | 1753 | of the query.
|
1751 | 1754 |
|
1752 |
| -2. Otherwise, return false. |
| 1755 | +5. Otherwise, return false. |
1753 | 1756 |
|
1754 | 1757 | <dfn>Clone Configuration</dfn> (with |config|) {#clone-config}
|
1755 | 1758 | --------------------------------------------------------------
|
|
1900 | 1903 |
|
1901 | 1904 | To check if an {{AudioDecoderConfig}} is a <dfn export>valid AudioDecoderConfig</dfn>,
|
1902 | 1905 | 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`. |
1904 | 1909 | 2. Return `true`.
|
1905 | 1910 |
|
1906 | 1911 | <dl>
|
|
1942 | 1947 |
|
1943 | 1948 | To check if a {{VideoDecoderConfig}} is a <dfn export>valid VideoDecoderConfig</dfn>,
|
1944 | 1949 | 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`. |
1947 | 1953 | 2. If one of {{VideoDecoderConfig/codedWidth}} or
|
1948 | 1954 | {{VideoDecoderConfig/codedHeight}} is provided but the other isn't,
|
1949 | 1955 | return `false`.
|
|
2043 | 2049 |
|
2044 | 2050 | To check if an {{AudioEncoderConfig}} is a <dfn>valid AudioEncoderConfig</dfn>,
|
2045 | 2051 | 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`. |
2048 | 2055 | 2. If the {{AudioEncoderConfig}} has a codec-specific extension and the corresponding
|
2049 | 2056 | registration in the [[WEBCODECS-CODEC-REGISTRY]] defines steps to check whether
|
2050 | 2057 | the extension is a valid extension, return the result of running those steps.
|
|
2098 | 2105 |
|
2099 | 2106 | To check if a {{VideoEncoderConfig}} is a <dfn>valid VideoEncoderConfig</dfn>,
|
2100 | 2107 | 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`. |
2103 | 2111 | 2. If {{VideoEncoderConfig/width}} = 0 or {{VideoEncoderConfig/height}}
|
2104 | 2112 | = 0, return `false`.
|
2105 | 2113 | 3. If {{VideoEncoderConfig/displayWidth}} = 0 or
|
|
0 commit comments