Class ExternalVideoTrackSource
Video source for WebRTC video tracks based on a custom source of video frames managed by the user and external to the WebRTC implementation.
This class is used to inject into the WebRTC engine a video track whose frames are produced by a user-managed source the WebRTC engine knows nothing about, like programmatically generated frames, including frames not strictly of video origin like a 3D rendered scene, or frames coming from a specific capture device not supported natively by WebRTC. This class serves as an adapter for such video frame sources.
Inherited Members
Namespace: Microsoft.MixedReality.WebRTC
Assembly: Microsoft.MixedReality.WebRTC.dll
Syntax
public class ExternalVideoTrackSource : VideoTrackSource, IVideoSource, IDisposable, VideoTrackSourceInterop.IVideoSource
Fields
| Improve this Doc View Source_frameRequestCallbackArgsHandle
GC handle to frame request callback args keeping the delegate alive while the callback is registered with the native implementation.
Declaration
protected IntPtr _frameRequestCallbackArgsHandle
Field Value
Type | Description |
---|---|
IntPtr |
Properties
| Improve this Doc View SourceFrameEncoding
Video encoding indicating the kind of frames the source is producing.
Declaration
public override VideoEncoding FrameEncoding { get; }
Property Value
Type | Description |
---|---|
VideoEncoding |
Overrides
Methods
| Improve this Doc View SourceCompleteFrameRequest(UInt32, Int64, Argb32VideoFrame)
Complete the current request by providing a video frame for it. This must be used if the video track source was created with CreateFromArgb32Callback(Argb32VideoFrameRequestDelegate).
Declaration
public void CompleteFrameRequest(uint requestId, long timestampMs, in Argb32VideoFrame frame)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | requestId | The original request ID. |
Int64 | timestampMs | The video frame timestamp. |
Argb32VideoFrame | frame | The video frame used to complete the request. |
CompleteFrameRequest(UInt32, Int64, I420AVideoFrame)
Complete the current request by providing a video frame for it. This must be used if the video track source was created with CreateFromI420ACallback(I420AVideoFrameRequestDelegate).
Declaration
public void CompleteFrameRequest(uint requestId, long timestampMs, in I420AVideoFrame frame)
Parameters
Type | Name | Description |
---|---|---|
UInt32 | requestId | The original request ID. |
Int64 | timestampMs | The video frame timestamp. |
I420AVideoFrame | frame | The video frame used to complete the request. |
CreateFromArgb32Callback(Argb32VideoFrameRequestDelegate)
Create a new external video track source from a given user callback providing ARGB32-encoded frames.
Declaration
public static ExternalVideoTrackSource CreateFromArgb32Callback(Argb32VideoFrameRequestDelegate frameCallback)
Parameters
Type | Name | Description |
---|---|---|
Argb32VideoFrameRequestDelegate | frameCallback | The callback that will be used to request frames for tracks. |
Returns
Type | Description |
---|---|
ExternalVideoTrackSource | The newly created track source. |
CreateFromI420ACallback(I420AVideoFrameRequestDelegate)
Create a new external video track source from a given user callback providing I420A-encoded frames.
Declaration
public static ExternalVideoTrackSource CreateFromI420ACallback(I420AVideoFrameRequestDelegate frameCallback)
Parameters
Type | Name | Description |
---|---|---|
I420AVideoFrameRequestDelegate | frameCallback | The callback that will be used to request frames for tracks. |
Returns
Type | Description |
---|---|
ExternalVideoTrackSource | The newly created track source. |
Dispose()
Declaration
public override void Dispose()
Overrides
| Improve this Doc View SourceToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String |