Class AggregatedNetworkSource
Represents a network source that aggregates multiple media sources into a single virtual source.
public class AggregatedNetworkSource : INetworkSource, IMediaSource, IReferenceable, IDisposable, INetworkEndPoint
- Inheritance
-
AggregatedNetworkSource
- Implements
- Inherited Members
Constructors
AggregatedNetworkSource()
Initializes a new instance of the AggregatedNetworkSource class.
public AggregatedNetworkSource()
Properties
Accept
Gets or sets a value indicating whether the source is accepted.
public bool Accept { get; set; }
Property Value
Capabilities
Gets the list of capabilities supported by this source.
public List<SourceCapability> Capabilities { get; }
Property Value
EndPoint
Gets the connected endpoint information.
public IPProtoEndPoint EndPoint { get; }
Property Value
IsDisposed
Gets a value indicating whether this object has been disposed and can no longer be used.
public bool IsDisposed { get; }
Property Value
IsNetworkSource
Gets a value indicating whether this is a network source rather than a local source.
public bool IsNetworkSource { get; }
Property Value
Parameters
Gets or sets the source configuration parameters.
public SourceParameters Parameters { get; set; }
Property Value
PublishingPath
Gets or sets the publishing point name extracted from the source URI or by other means.
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
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 number of streams in the source.
public int StreamCount { get; }
Property Value
UniqueId
Gets or sets the unique identifier for this source.
public Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the source URI.
public string Uri { get; set; }
Property Value
Remarks
Setting this property is not supported and will throw NotSupportedException.
Methods
AddRef()
Adds a reference to this object.
public void AddRef()
AddSource(IMediaSource)
Adds a media source to the aggregated source.
public void AddSource(IMediaSource source)
Parameters
sourceIMediaSourceThe media source to add.
Remarks
At least one media source must be added before starting the aggregated source. Typically, one video and/or one audio source should be added. Multiple video or audio sources are supported, but whether they all appear in the output depends on the sink implementation.
Exceptions
- Exception
Thrown if the aggregated source is already running.
Dispose()
Releases all resources used by this aggregated network source.
public void Dispose()
GetMediaType(int)
Gets the media type of the specified stream.
public MediaType GetMediaType(int streamIndex)
Parameters
streamIndexintThe index of the stream 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 all aggregated sources.
public void Open()
Release()
Releases a reference to this object.
public void Release()
Remarks
If the reference count reaches zero, Dispose() is called automatically. The caller must not use this object after calling this method.
SetDesiredOutputType(int, MediaType)
Sets the desired output media type for the specified stream.
public Task SetDesiredOutputType(int streamIndex, MediaType mediaType)
Parameters
streamIndexintThe index of the stream to set the desired output type for.
mediaTypeMediaTypeThe desired media type.
Returns
Exceptions
- NotImplementedException
This method is not implemented for aggregated sources.
Start()
Starts all aggregated sources and begins pushing media data.
public void Start()
Stop()
Stops all aggregated sources.
public void Stop()
Events
Error
Occurs when an error is encountered.
public event EventHandler<ErrorEventArgs> Error
Event Type
NewSample
Occurs when a new sample is ready to be consumed.
public event EventHandler<NewSampleEventArgs> NewSample
Event Type
NewStream
Occurs when a new stream is created or stream information becomes available.
public event EventHandler<NewStreamEventArgs> NewStream
Event Type
StateChanged
Occurs when the source state changes.
public event EventHandler<MediaState> StateChanged