Skip to main content
Version: 20 Mar 2024

Sink

Class that represents a audio sink used by the MLWebRTC API.

Inherited by:
UnityEngine.XR.MagicLeap.MLWebRTC.AudioSink,
UnityEngine.XR.MagicLeap.MLWebRTC.VideoSink,
UnityEngine.XR.MagicLeap.MLWebRTC.VideoSink

Public Fields

Stream

Gets or sets the reference to the stream.


public MLWebRTC.MediaStream Stream { get; set; }

TypeDescription
MLWebRTC.MediaStreamClass that represents a media stream object.

Type

Gets the type of the sink.


public MediaStream.Track.Type Type { get; set; }

TypeDescription
MediaStream.Track.TypeDefines the types of tracks that can exist.

Public Methods

abstract MLResult Destroy

Abstract method for destroying the sink.

public virtual abstract 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.

Reimplemented by: Destroy, Destroy


Protected Methods

InvalidateHandle

Used to invalidate handle by inherited classes.

protected void InvalidateHandle()

SetTrack

Abstract method for setting the sink's track.

protected virtual abstract MLResult SetTrack(
MLWebRTC.MediaStream.Track track
)

Parameters

TypeNameDescription
MLWebRTC.MediaStream.TracktrackThe track to set the sink to.

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.

Reimplemented by: SetTrack


Sink

Initializes a new instance of the Sink class.

protected Sink()

Sink

Initializes a new instance of the Sink class.

protected Sink(
ulong handle
)

Parameters

TypeNameDescription
ulonghandleThe handle of the sink.