EncodedVideoChunk Class
A chunk of encoded video (https://w3c.github.io/webcodecs/#encodedvideochunk): the input of a VideoDecoder and the output of a VideoEncoder. Its bytes are immutable; it can be posted to a worker (serialized).
public sealed class EncodedVideoChunkConstructors
| Name | Description |
|---|---|
| EncodedVideoChunk(EncodedVideoChunkInit) | Creates a chunk (https://w3c.github.io/webcodecs/#dom-encodedvideochunk-encodedvideochunk): the bytes are copied. |
EncodedVideoChunk(EncodedVideoChunkInit)
EncodedChunks.csCreates a chunk (https://w3c.github.io/webcodecs/#dom-encodedvideochunk-encodedvideochunk): the bytes are copied.
public EncodedVideoChunk(EncodedVideoChunkInit init)Parameters
initEncodedVideoChunkInit- The type, the timestamp and the bytes of the chunk.
Exceptions
DomException- A
DataCloneErrorwhen the transfer list has a detached buffer or a buffer twice.
See also
Properties
| Name | Description |
|---|---|
| ByteLength | Gets the number of encoded bytes. |
| Data | Gets the encoded bytes. |
| Duration | Gets the presentation duration in microseconds, or null. |
| Timestamp | Gets the presentation timestamp in microseconds. |
| Type | Gets the type of the chunk. |
ByteLength
EncodedChunks.csGets the number of encoded bytes.
public uint ByteLength { get; }Data
EncodedChunks.csDuration
EncodedChunks.csGets the presentation duration in microseconds, or null.
public ulong? Duration { get; }Timestamp
EncodedChunks.csGets the presentation timestamp in microseconds.
public long Timestamp { get; }Type
EncodedChunks.csMethods
| Name | Description |
|---|---|
| CopyTo(Span<byte>) | Copies the encoded bytes into a buffer (https://w3c.github.io/webcodecs/#dom-encodedvideochunk-copyto). |
CopyTo(Span<byte>)
EncodedChunks.csCopies the encoded bytes into a buffer (https://w3c.github.io/webcodecs/#dom-encodedvideochunk-copyto).
Parameters
destinationSpan<byte>- The buffer.
Exceptions
TypeErrorException- The buffer is smaller than the chunk.