Class VideoTrackSource
Video source for WebRTC video tracks.
The video source is not bound to any peer connection, and can therefore be shared by multiple video tracks from different peer connections. This is especially useful to share local video capture devices (microphones) amongst multiple peer connections when building a multi-peer experience with a mesh topology (one connection per pair of peers).
The user owns the video track source, and is in charge of keeping it alive until after all tracks using it are destroyed, and then dispose of it. The behavior of disposing of the track source while a track is still using it is undefined. The Tracks property contains the list of tracks currently using the source.
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public abstract class VideoTrackSource : object, IVideoSource
Properties
| Improve this Doc View SourceEnabled
Enabled status of the source. True until the object is disposed.
Declaration
public bool Enabled { get; }
Property Value
Type | Description |
---|---|
Boolean |
FrameEncoding
Video encoding indicating the kind of frames the source is producing.
Declaration
public abstract VideoEncoding FrameEncoding { get; }
Property Value
Type | Description |
---|---|
VideoEncoding |
Name
A name for the video track source, used for logging and debugging.
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Tracks
List of local video tracks this source is providing raw video frames to.
Declaration
public IReadOnlyList<LocalVideoTrack> Tracks { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<LocalVideoTrack> |
Methods
| Improve this Doc View SourceDispose()
Declaration
public virtual void Dispose()
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Events
| Improve this Doc View SourceArgb32VideoFrameReady
Event that occurs when a new video frame is available from the source, either because the source produced it locally (VideoTrackSource, LocalVideoTrack) or because it received it from the remote peer (RemoteVideoTrack).
Declaration
public event Argb32VideoFrameDelegate Argb32VideoFrameReady
Event Type
Type | Description |
---|---|
Argb32VideoFrameDelegate |
Remarks
The event delivers to the handlers an ARGB32-encoded video frame.
This event is invoked on the WebRTC worker thread. Handlers can be added/removed safely while the event is invoked, but access to any resource used by its handlers must be synchronized manually. Note that a handler might be invoked (at most once) after it has been removed from the event.
I420AVideoFrameReady
Event that occurs when a new video frame is available from the source, either because the source produced it locally (VideoTrackSource, LocalVideoTrack) or because it received it from the remote peer (RemoteVideoTrack).
Declaration
public event I420AVideoFrameDelegate I420AVideoFrameReady
Event Type
Type | Description |
---|---|
I420AVideoFrameDelegate |
Remarks
The event delivers to the handlers an I420-encoded video frame.
This event is invoked on the WebRTC worker thread. Handlers can be added/removed safely while the event is invoked, but access to any resource used by its handlers must be synchronized manually. Note that a handler might be invoked (at most once) after it has been removed from the event.