|
1784 | 1784 | constructor(EncodedAudioChunkInit init);
|
1785 | 1785 | readonly attribute EncodedAudioChunkType type;
|
1786 | 1786 | readonly attribute unsigned long long timestamp; // microseconds
|
1787 |
| - readonly attribute ArrayBuffer data; |
| 1787 | + readonly attribute unsigned long byteLength; |
| 1788 | + |
| 1789 | + undefined copyTo(ArrayBufferView dst); |
1788 | 1790 | };
|
1789 | 1791 |
|
1790 | 1792 | dictionary EncodedAudioChunkInit {
|
|
1799 | 1801 | };
|
1800 | 1802 | </xmp>
|
1801 | 1803 |
|
| 1804 | +### Internal Slots ### {#encodedaudiochunk-internal-slots} |
| 1805 | +: <dfn attribute for=EncodedAudioChunk>[[internal data]]</dfn></dt> |
| 1806 | +:: An array of bytes representing the encoded chunk data. |
| 1807 | + |
1802 | 1808 | ### Constructors ###{#encodedaudiochunk-constructors}
|
1803 | 1809 | <dfn constructor for=EncodedAudioChunk title="EncodedAudioChunk(init)">
|
1804 | 1810 | EncodedAudioChunk(init)
|
1805 | 1811 | </dfn>
|
1806 | 1812 | 1. Let |chunk| be a new {{EncodedAudioChunk}} object, initialized as follows
|
1807 |
| - 1. Assign `init.type` to `chunk.type`. |
1808 |
| - 2. Assign `init.timestamp` to `chunk.timestamp`. |
1809 |
| - 3. Assign a copy of `init.data` to `chunk.data`. |
| 1813 | + 1. Assign `init.type` to {{EncodedAudioChunk/type}}. |
| 1814 | + 2. Assign `init.timestamp` to {{EncodedAudioChunk/timestamp}}. |
| 1815 | + 3. Assign a copy of `init.data` to {{EncodedAudioChunk/[[internal data]]}}. |
| 1816 | + 4. Assign `init.data.byteLength` to {{EncodedAudioChunk/byteLength}}; |
1810 | 1817 | 5. Return |chunk|.
|
1811 | 1818 |
|
1812 | 1819 | ### Attributes ###{#encodedaudiochunk-attributes}
|
1813 |
| -<dl> |
1814 |
| - <dt><dfn attribute for=EncodedAudioChunk>type</dfn></dt> |
1815 |
| - <dd>Describes whether the chunk is a key frame.</dd> |
| 1820 | +: <dfn attribute for=EncodedAudioChunk>type</dfn> |
| 1821 | +:: Describes whether the chunk is a key frame. |
1816 | 1822 |
|
1817 |
| - <dt><dfn attribute for=EncodedAudioChunk>timestamp</dfn></dt> |
1818 |
| - <dd>The presentation timestamp, given in microseconds.</dd> |
| 1823 | +: <dfn attribute for=EncodedAudioChunk>timestamp</dfn> |
| 1824 | +:: The presentation timestamp, given in microseconds. |
1819 | 1825 |
|
1820 |
| - <dt><dfn attribute for=EncodedAudioChunk>data</dfn></dt> |
1821 |
| - <dd>A sequence of bytes containing encoded audio data.</dd> |
1822 |
| -</dl> |
| 1826 | +: <dfn attribute for=EncodedAudioChunk>byteLength</dfn> |
| 1827 | +:: The byte length of {{EncodedAudioChunk/[[internal data]]}}. |
| 1828 | + |
| 1829 | +### Methods ###{#encodedaudiochunk-methods} |
| 1830 | +: <dfn method for=EncodedAudioChunk>copyTo(dst)</dfn> |
| 1831 | +:: When invoked, run these steps: |
| 1832 | + 1. If {{EncodedAudioChunk/byteLength}} is greater than |
| 1833 | + |dst|.`byteLength`, |
| 1834 | + throw a {{TypeError}}. |
| 1835 | + 2. Copy the {{EncodedAudioChunk/[[internal data]]}} into |dst|. |
1823 | 1836 |
|
1824 | 1837 | EncodedVideoChunk Interface{#encodedvideochunk-interface}
|
1825 | 1838 | -----------------------------------------------------------
|
|
1830 | 1843 | readonly attribute EncodedVideoChunkType type;
|
1831 | 1844 | readonly attribute unsigned long long timestamp; // microseconds
|
1832 | 1845 | readonly attribute unsigned long long? duration; // microseconds
|
1833 |
| - readonly attribute ArrayBuffer data; |
| 1846 | + readonly attribute unsigned long byteLength; |
| 1847 | + |
| 1848 | + undefined copyTo(ArrayBufferView dst); |
1834 | 1849 | };
|
1835 | 1850 |
|
1836 | 1851 | dictionary EncodedVideoChunkInit {
|
|
1846 | 1861 | };
|
1847 | 1862 | </xmp>
|
1848 | 1863 |
|
| 1864 | +### Internal Slots ### {#encodedvideochunk-internal-slots} |
| 1865 | +: <dfn attribute for=EncodedVideoChunk>[[internal data]]</dfn></dt> |
| 1866 | +:: An array of bytes representing the encoded chunk data. |
| 1867 | + |
1849 | 1868 | ### Constructors ###{#encodedvideochunk-constructors}
|
1850 | 1869 | <dfn constructor for=EncodedVideoChunk title="EncodedVideoChunk(init)">
|
1851 | 1870 | EncodedVideoChunk(init)
|
1852 | 1871 | </dfn>
|
1853 | 1872 | 1. Let |chunk| be a new {{EncodedVideoChunk}} object, initialized as follows
|
1854 |
| - 1. Assign `init.type` to `chunk.type`. |
1855 |
| - 2. Assign `init.timestamp` to `chunk.timestamp`. |
| 1873 | + 1. Assign `init.type` to {{EncodedVideoChunk/type}}. |
| 1874 | + 2. Assign `init.timestamp` to {{EncodedVideoChunk/timestamp}}. |
1856 | 1875 | 3. If duration is present in init, assign `init.duration` to
|
1857 |
| - `chunk.duration`. Otherwise, assign null to `chunk.duration`. |
1858 |
| -2. Assign a copy of `init.data` to `chunk.data`. |
| 1876 | + {{EncodedVideoChunk/duration}}. Otherwise, assign `null` to |
| 1877 | + {{EncodedVideoChunk/duration}}. |
| 1878 | + 4. Assign a copy of `init.data` to {{EncodedVideoChunk/[[internal data]]}}. |
| 1879 | + 5. Assign `init.data.byteLength` to {{EncodedVideoChunk/byteLength}}; |
1859 | 1880 | 3. Return |chunk|.
|
1860 | 1881 |
|
1861 | 1882 | ### Attributes ###{#encodedvideochunk-attributes}
|
1862 |
| -<dl> |
1863 |
| - <dt><dfn attribute for=EncodedVideoChunk>type</dfn></dt> |
1864 |
| - <dd>Describes whether the chunk is a key frame or not.</dd> |
| 1883 | +: <dfn attribute for=EncodedVideoChunk>type</dfn> |
| 1884 | +:: Describes whether the chunk is a key frame or not. |
1865 | 1885 |
|
1866 |
| - <dt><dfn attribute for=EncodedVideoChunk>timestamp</dfn></dt> |
1867 |
| - <dd>The presentation timestamp, given in microseconds.</dd> |
| 1886 | +: <dfn attribute for=EncodedVideoChunk>timestamp</dfn> |
| 1887 | +:: The presentation timestamp, given in microseconds. |
1868 | 1888 |
|
1869 |
| - <dt><dfn attribute for=EncodedVideoChunk>duration</dfn></dt> |
1870 |
| - <dd>The presentation duration, given in microseconds.</dd> |
| 1889 | +: <dfn attribute for=EncodedVideoChunk>duration</dfn> |
| 1890 | +:: The presentation duration, given in microseconds. |
1871 | 1891 |
|
1872 |
| - <dt><dfn attribute for=EncodedVideoChunk>data</dfn></dt> |
1873 |
| - <dd>A sequence of bytes containing encoded video data.</dd> |
1874 |
| -</dl> |
| 1892 | +: <dfn attribute for=EncodedVideoChunk>byteLength</dfn> |
| 1893 | +:: The byte length of {{EncodedVideoChunk/[[internal data]]}}. |
| 1894 | + |
| 1895 | +### Methods ###{#encodedvideochunk-methods} |
| 1896 | +: <dfn method for=EncodedVideoChunk>copyTo(dst)</dfn> |
| 1897 | +:: When invoked, run these steps: |
| 1898 | + 1. If {{EncodedVideoChunk/byteLength}} is greater than |
| 1899 | + |dst|.`byteLength`, |
| 1900 | + throw a {{TypeError}}. |
| 1901 | + 2. Copy the {{EncodedVideoChunk/[[internal data]]}} into |dst|. |
1875 | 1902 |
|
1876 | 1903 |
|
1877 | 1904 | Raw Media Interfaces {#raw-media-interfaces}
|
|
3530 | 3557 | This concern is mitigated by ensuring that input and output interfaces are
|
3531 | 3558 | immutable.
|
3532 | 3559 |
|
3533 |
| -ISSUE: EncodedVideoChunk and EncodedAudioChunk currently expose a mutable |
3534 |
| -data. See <a href="https://github.com/w3c/webcodecs/issues/80">#80</a>. |
3535 |
| - |
3536 | 3560 | Privacy Considerations{#privacy-considerations}
|
3537 | 3561 | ===============================================
|
3538 | 3562 | The primary privacy impact is an increased ability to fingerprint users by
|
|
0 commit comments