Struct I420AVideoFrame
Single video frame encoded in I420A format (triplanar YUV with optional alpha plane). See e.g. https://wiki.videolan.org/YUV/#I420 for details.
The I420 format uses chroma downsampling in both directions, resulting in 12 bits per pixel. With the optional alpha plane, the size increases to 20 bits per pixel.
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public ref struct I420AVideoFrame
Remarks
The use of ref struct is an optimization to avoid heap allocation on each frame while
having a nicer-to-use container to pass a frame accross methods.
The alpha plane is generically supported in this data structure, but actual support in the video tracks depend on the underlying implementation and the video codec used, and is generally not available.
Fields
| Improve this Doc View SourcedataA
Optional pointer to the alpha plane buffer, if any, or null if the frame has no alpha plane.
Declaration
public IntPtr dataA
Field Value
| Type | Description |
|---|---|
| IntPtr |
dataU
Pointer to the U plane buffer.
Declaration
public IntPtr dataU
Field Value
| Type | Description |
|---|---|
| IntPtr |
dataV
Pointer to the V plane buffer.
Declaration
public IntPtr dataV
Field Value
| Type | Description |
|---|---|
| IntPtr |
dataY
Pointer to the Y plane buffer.
Declaration
public IntPtr dataY
Field Value
| Type | Description |
|---|---|
| IntPtr |
height
Frame height, in pixels.
Declaration
public uint height
Field Value
| Type | Description |
|---|---|
| UInt32 |
strideA
Stride in bytes between rows of the A plane, if present.
Declaration
public int strideA
Field Value
| Type | Description |
|---|---|
| Int32 |
strideU
Stride in bytes between rows of the U plane.
Declaration
public int strideU
Field Value
| Type | Description |
|---|---|
| Int32 |
strideV
Stride in bytes between rows of the V plane.
Declaration
public int strideV
Field Value
| Type | Description |
|---|---|
| Int32 |
strideY
Stride in bytes between rows of the Y plane.
Declaration
public int strideY
Field Value
| Type | Description |
|---|---|
| Int32 |
width
Frame width, in pixels.
Declaration
public uint width
Field Value
| Type | Description |
|---|---|
| UInt32 |
Methods
| Improve this Doc View SourceCopyTo(Byte[])
Copy the frame content to a Byte[] buffer as a contiguous block of memory containing the Y, U, and V planes one after another, and the alpha plane at the end if present.
Declaration
public void CopyTo(byte[] buffer)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte[] | buffer | The destination buffer to copy the frame to. |