Class TsSource
Provides a transport stream UDP source that receives media data over a UDP connection.
public class TsSource : INetworkSource, IMediaSource, IReferenceable, IDisposable, INetworkEndPoint
- Inheritance
-
TsSource
- Implements
- Inherited Members
Constructors
TsSource()
Initializes a new instance of the TsSource class.
public TsSource()
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 source capabilities
public List<SourceCapability> Capabilities { get; }
Property Value
EndPoint
Gets the connected end point information.
public IPProtoEndPoint EndPoint { get; }
Property Value
IsDisposed
Gets a value indicating whether the object is already disposed and cannot be used anymore.
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
Parameters
Gets or sets source parameters
public SourceParameters Parameters { get; set; }
Property Value
PublishingPath
Gets or sets the publishing point name extracted from the source URI or by any other means (depends on the protocol).
public string PublishingPath { get; set; }
Property Value
ReceivedUri
Gets or sets the source URI when present (depends on the protocol).
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 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
URI to be opened to pull data from
public string Uri { get; set; }
Property Value
Methods
AddRef()
Adds a reference to the object.
public void AddRef()
Dispose()
Releases all resources used by the TsSource 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 source using the specified URI and establishes a UDP connection.
public void Open()
Release()
Releases a reference to the object.
If the reference count becomes 0 then the Dispose() method is called.
The calling object must not use the current object after this call.
public void Release()
SetDesiredOutputType(int, MediaType)
Sets the desired output media type of the specified stream. Not supported by this source.
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
This method always throws NotImplementedException.
Start()
Starts media pushing from the UDP source.
public void Start()
Stop()
Stops media pushing and closes the source.
public void Stop()
Events
Error
Occurs when an error has occurred during source operation.
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 stream has been created.
public event EventHandler<NewStreamEventArgs> NewStream
Event Type
StateChanged
Occurs when the source state has changed.
public event EventHandler<MediaState> StateChanged