Class VideoReceiver
Decodes the video a peer connection receives, on its own task, and gives the pictures in PictureDecoded.
Implements
Inherited Members
Namespace: Uniform.Matrix.Calls
Assembly: Uniform.Matrix.Calls.dll
Syntax
public sealed class VideoReceiver : IAsyncDisposable
Remarks
A platform decoder that gives too few pictures at first is replaced by the C# one. A device that cannot keep up, by its decode times or by falling behind, asks the sender for less with a REMB, and for full quality again once it has room. Frames queue as they arrive. When decoding falls behind by Uniform.Matrix.Calls.VideoReceiver.MaxQueued frames, or a frame does not decode, the frames up to the next keyframe are skipped and the peer is asked for one, as inter frames only decode after the frames before them.
Constructors
| Edit this page View SourceVideoReceiver(IMediaConnection, ILogger, IVideoDecoder?)
Start decoding the video of connection.
Declaration
public VideoReceiver(IMediaConnection connection, ILogger logger, IVideoDecoder? decoder = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IMediaConnection | connection | A connection that receives video. |
| ILogger | logger | Logger of decoding failures. |
| IVideoDecoder | decoder | The decoder, e.g. the platform's hardware one; the C# Vp8Decoder when null. |
Fields
| Edit this page View SourceFallbackBitrate
The bitrate asked of a sender that this device cannot keep up with, which senders of this app meet with 320x240 at 10 pictures per second.
Declaration
public const long FallbackBitrate = 200000
Field Value
| Type | Description |
|---|---|
| long |
FullBitrate
The bitrate asked again once this device has room, for full quality.
Declaration
public const long FullBitrate = 1500000
Field Value
| Type | Description |
|---|---|
| long |
Properties
| Edit this page View SourceAverageDecodeTime
Average time to decode a frame so far, e.g. to see whether a device keeps up.
Declaration
public TimeSpan AverageDecodeTime { get; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
Decoded
Pictures decoded so far.
Declaration
public long Decoded { get; }
Property Value
| Type | Description |
|---|---|
| long |
Skipped
Frames skipped so far, because decoding fell behind or a frame did not decode.
Declaration
public long Skipped { get; }
Property Value
| Type | Description |
|---|---|
| long |
Methods
| Edit this page View SourceDisposeAsync()
Stop decoding.
Declaration
public ValueTask DisposeAsync()
Returns
| Type | Description |
|---|---|
| ValueTask |
Events
| Edit this page View SourcePictureDecoded
Raised with each decoded picture, on the decoding task; a handler should be quick, e.g. keep the newest picture to show.
Declaration
public event Action<VideoFrame>? PictureDecoded
Event Type
| Type | Description |
|---|---|
| Action<VideoFrame> |