|
169 | 169 | AudioDecoder Interface {#audiodecoder-interface}
|
170 | 170 | ================================================
|
171 | 171 |
|
172 |
| -<pre class='idl'> |
173 |
| -<xmp> |
| 172 | +<xmp class='idl'> |
174 | 173 | [Exposed=(Window,DedicatedWorker)]
|
175 | 174 | interface AudioDecoder {
|
176 | 175 | constructor(AudioDecoderInit init);
|
|
194 | 193 |
|
195 | 194 | callback AudioFrameOutputCallback = undefined(AudioFrame output);
|
196 | 195 | </xmp>
|
197 |
| -</pre> |
198 | 196 |
|
199 | 197 | Internal Slots {#audiodecoder-internal-slots}
|
200 | 198 | ---------------------------------------------
|
|
398 | 396 | VideoDecoder Interface {#videodecoder-interface}
|
399 | 397 | ================================================
|
400 | 398 |
|
401 |
| -<pre class='idl'> |
402 |
| -<xmp> |
| 399 | +<xmp class='idl'> |
403 | 400 | [Exposed=(Window,DedicatedWorker)]
|
404 | 401 | interface VideoDecoder {
|
405 | 402 | constructor(VideoDecoderInit init);
|
|
423 | 420 |
|
424 | 421 | callback VideoFrameOutputCallback = undefined(VideoFrame output);
|
425 | 422 | </xmp>
|
426 |
| -</pre> |
427 | 423 |
|
428 | 424 | Internal Slots {#videodecoder-internal-slots}
|
429 | 425 | ---------------------------------------------
|
|
645 | 641 | AudioEncoder Interface {#audioencoder-interface}
|
646 | 642 | ================================================
|
647 | 643 |
|
648 |
| -<pre class='idl'> |
649 |
| -<xmp> |
| 644 | +<xmp class='idl'> |
650 | 645 | [Exposed=(Window,DedicatedWorker)]
|
651 | 646 | interface AudioEncoder {
|
652 | 647 | constructor(AudioEncoderInit init);
|
|
670 | 665 |
|
671 | 666 | callback EncodedAudioChunkOutputCallback = undefined(EncodedAudioChunk output);
|
672 | 667 | </xmp>
|
673 |
| -</pre> |
674 | 668 |
|
675 | 669 | Internal Slots {#audioencoder-internal-slots}
|
676 | 670 | ---------------------------------------------
|
|
885 | 879 | VideoEncoder Interface {#videoencoder-interface}
|
886 | 880 | ================================================
|
887 | 881 |
|
888 |
| -<pre class='idl'> |
889 |
| -<xmp> |
| 882 | +<xmp class='idl'> |
890 | 883 | [Exposed=(Window,DedicatedWorker)]
|
891 | 884 | interface VideoEncoder {
|
892 | 885 | constructor(VideoEncoderInit init);
|
|
910 | 903 |
|
911 | 904 | callback EncodedVideoChunkOutputCallback = undefined(EncodedVideoChunk output, VideoDecoderConfig? output_config);
|
912 | 905 | </xmp>
|
913 |
| -</pre> |
914 | 906 |
|
915 | 907 | Internal Slots {#videoencoder-internal-slots}
|
916 | 908 | ---------------------------------------------
|
|
1217 | 1209 | ------------------------------------------------------
|
1218 | 1210 |
|
1219 | 1211 | ### AudioDecoderSupport ### {#audio-decoder-support}
|
1220 |
| -<pre class='idl'> |
1221 |
| -<xmp> |
| 1212 | +<xmp class='idl'> |
1222 | 1213 | dictionary AudioDecoderSupport {
|
1223 | 1214 | boolean supported;
|
1224 | 1215 | AudioDecoderConfig config;
|
1225 | 1216 | };
|
1226 | 1217 | </xmp>
|
1227 |
| -</pre> |
1228 | 1218 |
|
1229 | 1219 | <dl>
|
1230 | 1220 | <dt><dfn dict-member for=AudioDecoderSupport>supported</dfn></dt>
|
|
1240 | 1230 | </dl>
|
1241 | 1231 |
|
1242 | 1232 | ### VideoDecoderSupport ### {#video-decoder-support}
|
1243 |
| -<pre class='idl'> |
1244 |
| -<xmp> |
| 1233 | +<xmp class='idl'> |
1245 | 1234 | dictionary VideoDecoderSupport {
|
1246 | 1235 | boolean supported;
|
1247 | 1236 | VideoDecoderConfig config;
|
1248 | 1237 | };
|
1249 | 1238 | </xmp>
|
1250 |
| -</pre> |
1251 | 1239 |
|
1252 | 1240 | <dl>
|
1253 | 1241 | <dt><dfn dict-member for=VideoDecoderSupport>supported</dfn></dt>
|
|
1263 | 1251 | </dl>
|
1264 | 1252 |
|
1265 | 1253 | ### AudioEncoderSupport ### {#audio-encoder-support}
|
1266 |
| -<pre class='idl'> |
1267 |
| -<xmp> |
| 1254 | +<xmp class='idl'> |
1268 | 1255 | dictionary AudioEncoderSupport {
|
1269 | 1256 | boolean supported;
|
1270 | 1257 | AudioEncoderConfig config;
|
1271 | 1258 | };
|
1272 | 1259 | </xmp>
|
1273 |
| -</pre> |
1274 | 1260 |
|
1275 | 1261 | <dl>
|
1276 | 1262 | <dt><dfn dict-member for=AudioEncoderSupport>supported</dfn></dt>
|
|
1286 | 1272 | </dl>
|
1287 | 1273 |
|
1288 | 1274 | ### VideoEncoderSupport ### {#video-encoder-support}
|
1289 |
| -<pre class='idl'> |
1290 |
| -<xmp> |
| 1275 | +<xmp class='idl'> |
1291 | 1276 | dictionary VideoEncoderSupport {
|
1292 | 1277 | boolean supported;
|
1293 | 1278 | VideoEncoderConfig config;
|
1294 | 1279 | };
|
1295 | 1280 | </xmp>
|
1296 |
| -</pre> |
1297 | 1281 |
|
1298 | 1282 | <dl>
|
1299 | 1283 | <dt><dfn dict-member for=VideoEncoderSupport>supported</dfn></dt>
|
|
1331 | 1315 |
|
1332 | 1316 | AudioDecoderConfig{#audio-decoder-config}
|
1333 | 1317 | -----------------------------------------
|
1334 |
| -<pre class='idl'> |
1335 |
| -<xmp> |
| 1318 | +<xmp class='idl'> |
1336 | 1319 | dictionary AudioDecoderConfig {
|
1337 | 1320 | required DOMString codec;
|
1338 | 1321 | required unsigned long sampleRate;
|
1339 | 1322 | required unsigned long numberOfChannels;
|
1340 | 1323 | BufferSource description;
|
1341 | 1324 | };
|
1342 | 1325 | </xmp>
|
1343 |
| -</pre> |
1344 | 1326 |
|
1345 | 1327 | To check if an {{AudioDecoderConfig}} is a <dfn>valid AudioDecoderConfig</dfn>,
|
1346 | 1328 | run these steps:
|
|
1370 | 1352 |
|
1371 | 1353 | VideoDecoderConfig{#video-decoder-config}
|
1372 | 1354 | -----------------------------------------
|
1373 |
| -<pre class='idl'> |
1374 |
| -<xmp> |
| 1355 | +<xmp class='idl'> |
1375 | 1356 | dictionary VideoDecoderConfig {
|
1376 | 1357 | required DOMString codec;
|
1377 | 1358 | BufferSource description;
|
|
1386 | 1367 | HardwareAcceleration hardwareAcceleration = "allow";
|
1387 | 1368 | };
|
1388 | 1369 | </xmp>
|
1389 |
| -</pre> |
1390 | 1370 |
|
1391 | 1371 | To check if a {{VideoDecoderConfig}} is a <dfn>valid VideoDecoderConfig</dfn>,
|
1392 | 1372 | run these steps:
|
|
1475 | 1455 |
|
1476 | 1456 | AudioEncoderConfig{#audio-encoder-config}
|
1477 | 1457 | -----------------------------------------
|
1478 |
| -<pre class='idl'> |
1479 |
| -<xmp> |
| 1458 | +<xmp class='idl'> |
1480 | 1459 | dictionary AudioEncoderConfig {
|
1481 | 1460 | required DOMString codec;
|
1482 | 1461 | unsigned long sampleRate;
|
1483 | 1462 | unsigned long numberOfChannels;
|
1484 | 1463 | };
|
1485 | 1464 | </xmp>
|
1486 |
| -</pre> |
1487 | 1465 |
|
1488 | 1466 | NOTE: Codec-specific extensions to {{AudioEncoderConfig}} may be defined by the
|
1489 | 1467 | registrations in the [[WEBCODECS-CODEC-REGISTRY]].
|
|
1508 | 1486 |
|
1509 | 1487 | VideoEncoderConfig{#video-encoder-config}
|
1510 | 1488 | -----------------------------------------
|
1511 |
| -<pre class='idl'> |
1512 |
| -<xmp> |
| 1489 | +<xmp class='idl'> |
1513 | 1490 | dictionary VideoEncoderConfig {
|
1514 | 1491 | required DOMString codec;
|
1515 | 1492 | unsigned long long bitrate;
|
|
1520 | 1497 | HardwareAcceleration hardwareAcceleration = "allow";
|
1521 | 1498 | };
|
1522 | 1499 | </xmp>
|
1523 |
| -</pre> |
1524 | 1500 |
|
1525 | 1501 | NOTE: Codec-specific extensions to {{VideoEncoderConfig}} may be defined by the
|
1526 | 1502 | registrations in the [[WEBCODECS-CODEC-REGISTRY]].
|
|
1606 | 1582 |
|
1607 | 1583 | Hardware Acceleration{#hardware-acceleration}
|
1608 | 1584 | ---------------------------------------------
|
1609 |
| -<pre class='idl'> |
1610 |
| -<xmp> |
| 1585 | +<xmp class='idl'> |
1611 | 1586 | enum HardwareAcceleration {
|
1612 | 1587 | "allow",
|
1613 | 1588 | "deny",
|
1614 | 1589 | "require",
|
1615 | 1590 | };
|
1616 | 1591 | </xmp>
|
1617 |
| -</pre> |
1618 | 1592 |
|
1619 | 1593 | When supported, hardware acceleration offloads encoding or decoding to
|
1620 | 1594 | specialized hardware.
|
|
1686 | 1660 | VideoEncoderEncodeOptions{#video-encoder-options}
|
1687 | 1661 | -------------------------------------------------
|
1688 | 1662 |
|
1689 |
| -<pre class='idl'> |
1690 |
| -<xmp> |
| 1663 | +<xmp class='idl'> |
1691 | 1664 | dictionary VideoEncoderEncodeOptions {
|
1692 | 1665 | boolean keyFrame = false;
|
1693 | 1666 | };
|
1694 | 1667 | </xmp>
|
1695 |
| -</pre> |
1696 | 1668 |
|
1697 | 1669 | <dl>
|
1698 | 1670 | <dt><dfn dict-member for=VideoEncoderEncodeOptions>keyFrame</dfn></dt>
|
|
1706 | 1678 |
|
1707 | 1679 | CodecState{#codec-state}
|
1708 | 1680 | ------------------------
|
1709 |
| -<pre class='idl'> |
1710 |
| -<xmp> |
| 1681 | +<xmp class='idl'> |
1711 | 1682 | enum CodecState {
|
1712 | 1683 | "unconfigured",
|
1713 | 1684 | "configured",
|
1714 | 1685 | "closed"
|
1715 | 1686 | };
|
1716 | 1687 | </xmp>
|
1717 |
| -</pre> |
1718 | 1688 |
|
1719 | 1689 | <dl>
|
1720 | 1690 | <dt><dfn enum-value for=CodecState>unconfigured</dfn></dt>
|
|
1733 | 1703 |
|
1734 | 1704 | WebCodecsErrorCallback{#error-callback}
|
1735 | 1705 | ---------------------------------------
|
1736 |
| -<pre class='idl'> |
1737 |
| -<xmp> |
| 1706 | +<xmp class='idl'> |
1738 | 1707 | callback WebCodecsErrorCallback = undefined(DOMException error);
|
1739 | 1708 | </xmp>
|
1740 |
| -</pre> |
1741 | 1709 |
|
1742 | 1710 |
|
1743 | 1711 | Encoded Media Interfaces (Chunks) {#encoded-media-interfaces}
|
|
1746 | 1714 |
|
1747 | 1715 | EncodedAudioChunk Interface {#encodedaudiochunk-interface}
|
1748 | 1716 | ------------------------------------------------------------
|
1749 |
| -<pre class='idl'> |
1750 |
| -<xmp> |
| 1717 | +<xmp class='idl'> |
1751 | 1718 | [Exposed=(Window,DedicatedWorker)]
|
1752 | 1719 | interface EncodedAudioChunk {
|
1753 | 1720 | constructor(EncodedAudioChunkInit init);
|
|
1767 | 1734 | "delta",
|
1768 | 1735 | };
|
1769 | 1736 | </xmp>
|
1770 |
| -</pre> |
1771 | 1737 |
|
1772 | 1738 | ### Constructors ###{#encodedaudiochunk-constructors}
|
1773 | 1739 | <dfn constructor for=EncodedAudioChunk title="EncodedAudioChunk(init)">
|
|
1793 | 1759 |
|
1794 | 1760 | EncodedVideoChunk Interface{#encodedvideochunk-interface}
|
1795 | 1761 | -----------------------------------------------------------
|
1796 |
| -<pre class='idl'> |
1797 |
| -<xmp> |
| 1762 | +<xmp class='idl'> |
1798 | 1763 | [Exposed=(Window,DedicatedWorker)]
|
1799 | 1764 | interface EncodedVideoChunk {
|
1800 | 1765 | constructor(EncodedVideoChunkInit init);
|
|
1816 | 1781 | "delta",
|
1817 | 1782 | };
|
1818 | 1783 | </xmp>
|
1819 |
| -</pre> |
1820 | 1784 |
|
1821 | 1785 | ### Constructors ###{#encodedvideochunk-constructors}
|
1822 | 1786 | <dfn constructor for=EncodedVideoChunk title="EncodedVideoChunk(init)">
|
|
1854 | 1818 | AudioFrame Interface {#audioframe-interface}
|
1855 | 1819 | ---------------------------------------------
|
1856 | 1820 |
|
1857 |
| -<pre class='idl'> |
1858 |
| -<xmp> |
| 1821 | +<xmp class='idl'> |
1859 | 1822 | [Exposed=(Window,DedicatedWorker)]
|
1860 | 1823 | interface AudioFrame {
|
1861 | 1824 | constructor(AudioFrameInit init);
|
|
1869 | 1832 | required AudioBuffer buffer;
|
1870 | 1833 | };
|
1871 | 1834 | </xmp>
|
1872 |
| -</pre> |
1873 | 1835 |
|
1874 | 1836 | ### Internal Slots ###{#audioframe-internal-slots}
|
1875 | 1837 | <dl>
|
|
1919 | 1881 | VideoFrame Interface {#videoframe-interface}
|
1920 | 1882 | --------------------------------------------
|
1921 | 1883 |
|
1922 |
| -<pre class='idl'> |
1923 |
| -<xmp> |
| 1884 | +<xmp class='idl'> |
1924 | 1885 | [Exposed=(Window,DedicatedWorker)]
|
1925 | 1886 | interface VideoFrame {
|
1926 | 1887 | constructor(ImageBitmap imageBitmap, optional VideoFrameInit frameInit = {});
|
|
1961 | 1922 | unsigned long long timestamp;
|
1962 | 1923 | };
|
1963 | 1924 | </xmp>
|
1964 |
| -</pre> |
1965 | 1925 |
|
1966 | 1926 | ### Internal Slots ###{#videoframe-internal-slots}
|
1967 | 1927 | <dl>
|
|
2209 | 2169 | it possible to efficiently add an alpha plane to an existing {{VideoFrame}}.
|
2210 | 2170 |
|
2211 | 2171 |
|
2212 |
| -<pre class='idl'> |
2213 |
| -<xmp> |
| 2172 | +<xmp class='idl'> |
| 2173 | +[Exposed=(Window,DedicatedWorker)] |
2214 | 2174 | interface Plane {
|
2215 | 2175 | readonly attribute unsigned long stride;
|
2216 | 2176 | readonly attribute unsigned long rows;
|
|
2225 | 2185 | required unsigned long rows;
|
2226 | 2186 | };
|
2227 | 2187 | </xmp>
|
2228 |
| -</pre> |
2229 | 2188 |
|
2230 | 2189 | ### Internal Slots ###{#plane-internal-slots}
|
2231 | 2190 | <dl>
|
|
2269 | 2228 | http://www.fourcc.org/pixel-format/yuv-i420/</a> for a more complete
|
2270 | 2229 | description.
|
2271 | 2230 |
|
2272 |
| -<pre class='idl'> |
2273 |
| -<xmp> |
| 2231 | +<xmp class='idl'> |
2274 | 2232 | enum PixelFormat {
|
2275 | 2233 | "I420"
|
2276 | 2234 | };
|
2277 | 2235 | </xmp>
|
2278 |
| -</pre> |
2279 | 2236 |
|
2280 | 2237 | <dl>
|
2281 | 2238 | <dt><dfn enum-value for=PixelFormat>I420</dfn></dt>
|
|
0 commit comments