VideoSink
Class that represents a video sink used by the MLWebRTC API. Video sinks are fed data by media sources and produces frames to render. More...
Detailed Description
public class VideoSink : Sink
Details*
Class that represents a source used by the MLWebRTC API.
Public Methods
bool AcquireNextAvailableFrame
public bool AcquireNextAvailableFrame(
out Frame newFrame
)
Parameters
Type | Name | Description |
---|---|---|
out Frame | newFrame | Struct representing a captured camera frame. |
VideoSink Create
Creates an initialized VideoSink object.
public static VideoSink Create(
out MLResult result
)
Parameters
Type | Name | Description |
---|---|---|
out MLResult | result | The MLResult object of the inner platform call(s). |
Returns: An initialized VideoSink object.
override MLResult Destroy
Destroys the video sink.
public virtual override MLResult Destroy()
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent.
Reimplements: Destroy
bool IsNewFrameAvailable
public bool IsNewFrameAvailable()
delegate void OnDestroySinkDelegate
public delegate void OnDestroySinkDelegate(
VideoSink videoSink
)
Parameters
Type | Name | Description |
---|---|---|
VideoSink | videoSink | Class that represents a video sink used by the MLWebRTC API. Video sinks are fed data by media sources and produces frames to render. |
delegate void OnFrameResolutionChangedDelegate
public delegate void OnFrameResolutionChangedDelegate(
uint newWidth,
uint newHeight
)
Parameters
Type | Name | Description |
---|---|---|
uint | newWidth | |
uint | newHeight |
delegate void OnStreamChangedDelegate
public delegate void OnStreamChangedDelegate(
MediaStream stream
)
Parameters
Type | Name | Description |
---|---|---|
MediaStream | stream | Class that represents a media stream object. |
void ReleaseFrame
public void ReleaseFrame()
MLResult SetStream
Sets the stream of the video sink sink.
public MLResult SetStream(
MediaStream stream
)
Parameters
Type | Name | Description |
---|---|---|
MediaStream | stream | The stream to use. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent.
Protected Methods
SetTrack
Sets the track of the video sink.
protected override MLResult SetTrack(
MediaStream.Track track
)
Parameters
Type | Name | Description |
---|---|---|
MediaStream.Track | track | The track to use. |
Returns: MLResult.Result will be MLResult.Code.Ok if destroying all handles was successful. MLResult.Result will be MLResult.Code.WebRTCResultInstanceNotCreated if MLWebRTC instance was not created. MLResult.Result will be MLResult.Code.WebRTCResultMismatchingHandle if an incorrect handle was sent.
Public Events
OnDestroySink
public OnDestroySinkDelegate OnDestroySink()
OnFrameResolutionChanged
public OnFrameResolutionChangedDelegate OnFrameResolutionChanged()
OnStreamChanged
public OnStreamChangedDelegate OnStreamChanged()