Table of Contents

Class WebRtcClientSource

Namespace
VAST.WebRTC
Assembly
VAST.WebRTC.dll

Represents a WebRTC client-side media source that receives audio and video streams via WebRTC.

public class WebRtcClientSource : INetworkSource, IMediaSource, IReferenceable, IDisposable, INetworkEndPoint
Inheritance
WebRtcClientSource
Implements
Inherited Members

Constructors

WebRtcClientSource()

Initializes a new instance of the WebRtcClientSource class.

public WebRtcClientSource()

Properties

Accept

Gets or sets a value indicating whether the source connection is accepted.

public bool Accept { get; set; }

Property Value

bool

Capabilities

Gets the list of source capabilities.

public List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

EndPoint

Gets the connected endpoint information.

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

IceServers

Gets or sets the ICE server configuration string.

public string IceServers { get; set; }

Property Value

string

IsAudioExpected

Gets or sets a value indicating whether an audio stream is expected to be received.

public bool IsAudioExpected { get; set; }

Property Value

bool

IsDisposed

Gets a value indicating whether this instance has been disposed.

public bool IsDisposed { get; }

Property Value

bool

IsNetworkSource

Gets a value indicating whether this is a network source. Always returns true.

public bool IsNetworkSource { get; }

Property Value

bool

IsVideoExpected

Gets or sets a value indicating whether a video stream is expected to be received.

public bool IsVideoExpected { get; set; }

Property Value

bool

OurPeerId

Gets or sets the local WebRTC peer identifier.

public long OurPeerId { get; set; }

Property Value

long

Parameters

Gets or sets the source parameters.

public SourceParameters Parameters { get; set; }

Property Value

SourceParameters

PublishingPath

Gets or sets the publishing point name extracted from the source URI.

public string PublishingPath { get; set; }

Property Value

string

ReceivedUri

Gets or sets the source URI when present.

public string ReceivedUri { get; set; }

Property Value

string

RefCount

Gets the current reference count of the object.

public int RefCount { get; }

Property Value

int

RemotePeerId

Gets or sets the remote WebRTC peer identifier.

public long RemotePeerId { get; set; }

Property Value

long

Signalling

Gets or sets the signalling interface used for WebRTC peer communication.

public IWebRtcSignalling Signalling { get; set; }

Property Value

IWebRtcSignalling

SocketError

Gets the socket error received on disconnection.

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Gets the current source state.

public MediaState State { get; }

Property Value

MediaState

StreamCount

Gets the total stream count of the source.

public int StreamCount { get; }

Property Value

int

UniqueId

Gets or sets the unique source identifier.

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the URI. Maps to ReceivedUri.

public string Uri { get; set; }

Property Value

string

Methods

AddRef()

Increments the reference count of the object.

public void AddRef()

Dispose()

Releases all resources used by the WebRtcClientSource class.

public void Dispose()

GetMediaType(int)

Gets the media type of the specified stream.

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

The stream index to get the media type for.

Returns

MediaType

The media type of the requested stream, or null if the index is out of range.

Open()

Opens the WebRTC client source and initializes the native WebRTC session.

public void Open()

ProcessPeerMessage(long, string)

Processes a signalling message received from the specified peer.

public void ProcessPeerMessage(long peerId, string message)

Parameters

peerId long

The identifier of the peer that sent the message.

message string

The signalling message content.

Release()

Decrements the reference count. If the reference count reaches 0, the Dispose() method is called. The caller must not use this object after this call.

public void Release()

SetDesiredOutputType(int, MediaType)

Sets the desired output media type of the specified stream. Not implemented.

public Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The stream index to set the desired output media type for.

mediaType MediaType

The desired media type.

Returns

Task

A task representing the asynchronous operation.

Start()

Starts the source and begins the native WebRTC session.

public void Start()

Stop()

Stops the source and releases the native WebRTC session.

public void Stop()

Events

Error

Occurs when an error is encountered during source operations.

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

Occurs when a new media sample is ready.

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

Occurs when a new media stream has been created.

public event EventHandler<NewStreamEventArgs> NewStream

Event Type

EventHandler<NewStreamEventArgs>

StateChanged

Occurs when the source state changes.

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>