Class VideoFrame
A decoded picture in I420: full-size luma, and both chroma planes at half the width and height, rounded up; each plane tightly packed.
Inherited Members
Namespace: Uniform.Matrix.Video
Assembly: Uniform.Matrix.Video.dll
Syntax
public sealed class VideoFrame
Constructors
| Edit this page View SourceVideoFrame(int, int, byte[], byte[], byte[])
Create a picture of width by height pixels from its planes.
Declaration
public VideoFrame(int width, int height, byte[] y, byte[] u, byte[] v)
Parameters
| Type | Name | Description |
|---|---|---|
| int | width | |
| int | height | |
| byte[] | y | |
| byte[] | u | |
| byte[] | v |
Properties
| Edit this page View SourceChromaHeight
Height of the chroma planes.
Declaration
public int ChromaHeight { get; }
Property Value
| Type | Description |
|---|---|
| int |
ChromaWidth
Width of the chroma planes.
Declaration
public int ChromaWidth { get; }
Property Value
| Type | Description |
|---|---|
| int |
Height
Height in pixels.
Declaration
public int Height { get; }
Property Value
| Type | Description |
|---|---|
| int |
Mirrored
Whether to show the picture mirrored, as a preview of one's own front camera is, like a mirror.
Declaration
public bool Mirrored { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Rotation
Clockwise rotation in degrees that shows the picture upright, 0, 90, 180 or 270, e.g. from a phone held upright, whose camera sees sideways.
Declaration
public int Rotation { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
U
Blue-difference chroma, ChromaWidth bytes per row.
Declaration
public byte[] U { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
V
Red-difference chroma, ChromaWidth bytes per row.
Declaration
public byte[] V { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
Width
Width in pixels.
Declaration
public int Width { get; }
Property Value
| Type | Description |
|---|---|
| int |
Y
Luma, Width bytes per row.
Declaration
public byte[] Y { get; }
Property Value
| Type | Description |
|---|---|
| byte[] |
Methods
| Edit this page View SourceCopyToBgra(Span<byte>, int)
Write the picture as 32-bit BGRA, opaque, into destination of stride bytes per row, converting from BT.601 limited range as WebRTC video is.
Declaration
public void CopyToBgra(Span<byte> destination, int stride)
Parameters
| Type | Name | Description |
|---|---|---|
| Span<byte> | destination | At least Height rows. |
| int | stride | Bytes per row, at least 4 × Width. |
Rotated(int)
Return the picture turned degrees clockwise, 0, 90, 180 or 270, e.g. by its Rotation to send it upright where the receiver is not told the rotation; the result has no rotation of its own.
Declaration
public VideoFrame Rotated(int degrees)
Parameters
| Type | Name | Description |
|---|---|---|
| int | degrees |
Returns
| Type | Description |
|---|---|
| VideoFrame |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | When |