Class LocalVideoTrack
Video track sending to the remote peer video frames originating from a local track source.
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public class LocalVideoTrack : LocalMediaTrack, IVideoSource
Properties
| Improve this Doc View SourceEnabled
Enabled status of the track. If enabled, send local video frames to the remote peer as expected. If disabled, send only black frames instead.
Declaration
public bool Enabled { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Remarks
Reading the value of this property after the track has been disposed is valid, and returns
false
. Writing to this property after the track has been disposed throws an exception.
FrameEncoding
Video encoding indicating the kind of frames the source is producing.
Declaration
public VideoEncoding FrameEncoding { get; }
Property Value
Type | Description |
---|---|
VideoEncoding |
Source
Video track source this track is pulling its video frames from.
Declaration
public VideoTrackSource Source { get; }
Property Value
Type | Description |
---|---|
VideoTrackSource |
Methods
| Improve this Doc View SourceCreateFromSource(VideoTrackSource, LocalVideoTrackInitConfig)
Create a video track from an existing video track source.
This does not add the track to any peer connection. Instead, the track must be added manually to a video transceiver to be attached to a peer connection and transmitted to a remote peer.
Declaration
public static LocalVideoTrack CreateFromSource(VideoTrackSource source, LocalVideoTrackInitConfig initConfig)
Parameters
Type | Name | Description |
---|---|---|
VideoTrackSource | source | The track source which provides the raw video frames to the newly created track. |
LocalVideoTrackInitConfig | initConfig | Configuration to initialize the track being created. |
Returns
Type | Description |
---|---|
LocalVideoTrack | Asynchronous task completed once the track is created. |
Dispose()
Remove the track from the associated Transceiver (if there is one) and release the corresponding resources.
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |
Overrides
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.