Class WebRtcClientSource
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
Capabilities
Gets the list of source capabilities.
public List<SourceCapability> Capabilities { get; }
Property Value
EndPoint
Gets the connected endpoint information.
public IPProtoEndPoint EndPoint { get; }
Property Value
IceServers
Gets or sets the ICE server configuration string.
public string IceServers { get; set; }
Property Value
IsAudioExpected
Gets or sets a value indicating whether an audio stream is expected to be received.
public bool IsAudioExpected { get; set; }
Property Value
IsDisposed
Gets a value indicating whether this instance has been disposed.
public bool IsDisposed { get; }
Property Value
IsNetworkSource
Gets a value indicating whether this is a network source. Always returns true.
public bool IsNetworkSource { get; }
Property Value
IsVideoExpected
Gets or sets a value indicating whether a video stream is expected to be received.
public bool IsVideoExpected { get; set; }
Property Value
OurPeerId
Gets or sets the local WebRTC peer identifier.
public long OurPeerId { get; set; }
Property Value
Parameters
Gets or sets the source parameters.
public SourceParameters Parameters { get; set; }
Property Value
PublishingPath
Gets or sets the publishing point name extracted from the source URI.
public string PublishingPath { get; set; }
Property Value
ReceivedUri
Gets or sets the source URI when present.
public string ReceivedUri { get; set; }
Property Value
RefCount
Gets the current reference count of the object.
public int RefCount { get; }
Property Value
RemotePeerId
Gets or sets the remote WebRTC peer identifier.
public long RemotePeerId { get; set; }
Property Value
Signalling
Gets or sets the signalling interface used for WebRTC peer communication.
public IWebRtcSignalling Signalling { get; set; }
Property Value
SocketError
Gets the socket error received on disconnection.
public ExtendedSocketError SocketError { get; }
Property Value
State
Gets the current source state.
public MediaState State { get; }
Property Value
StreamCount
Gets the total stream count of the source.
public int StreamCount { get; }
Property Value
UniqueId
Gets or sets the unique source identifier.
public Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the URI. Maps to ReceivedUri.
public string Uri { get; set; }
Property Value
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
streamIndexintThe stream index to get the media type for.
Returns
- MediaType
The media type of the requested stream, or
nullif 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
peerIdlongThe identifier of the peer that sent the message.
messagestringThe 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
streamIndexintThe stream index to set the desired output media type for.
mediaTypeMediaTypeThe 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
NewSample
Occurs when a new media sample is ready.
public event EventHandler<NewSampleEventArgs> NewSample
Event Type
NewStream
Occurs when a new media stream has been created.
public event EventHandler<NewStreamEventArgs> NewStream
Event Type
StateChanged
Occurs when the source state changes.
public event EventHandler<MediaState> StateChanged