Class AbstractHttpSource
Provides an abstract base class for HTTP-based media sources supporting various streaming protocols.
public abstract class AbstractHttpSource : INetworkSource, IMediaSource, IReferenceable, IDisposable, INetworkEndPoint
- Inheritance
-
AbstractHttpSource
- Implements
- Derived
- Inherited Members
Constructors
AbstractHttpSource()
Create new instance of AbstractHttpSource
public AbstractHttpSource()
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 abstract 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. Always returns true.
public bool IsNetworkSource { get; }
Property Value
Parameters
Gets or sets the source parameters.
public abstract SourceParameters Parameters { get; set; }
Property Value
PublishingPath
Gets or sets the publishing point name extracted from the source URI or by other protocol-specific means.
public string PublishingPath { get; set; }
Property Value
ReceivedUri
Gets or sets the source URI when present (protocol-dependent).
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 that occurred on disconnection.
public ExtendedSocketError SocketError { get; }
Property Value
State
Gets the current source state.
public virtual MediaState State { get; protected set; }
Property Value
StreamCount
Gets the number of streams in the source.
public abstract int StreamCount { get; }
Property Value
UniqueId
Gets or sets the unique identifier of the source.
public Guid UniqueId { get; set; }
Property Value
Uri
Gets or sets the URI to be opened. Custom parameters are extracted and removed during assignment.
public string Uri { get; set; }
Property Value
UserHeaders
Gets the collection of user-defined HTTP headers to include in requests.
public LockableCollection<LockableHeader> UserHeaders { get; }
Property Value
Methods
AddRef()
Add reference
public void AddRef()
Dispose()
Disposes used resources
public void Dispose()
GetMediaType(int)
Gets the media type for the specified stream.
public abstract MediaType GetMediaType(int streamIndex)
Parameters
streamIndexintThe zero-based index of the stream.
Returns
- MediaType
The media type of the stream.
Open()
Meaningless for current class because it's supposed that object is created if source media for this class is ready
public void Open()
Release()
Release reference. If reference count becomes 0 then Dispose() method is called. Calling object must not use current object after this call.
public void Release()
SetDesiredOutputType(int, MediaType)
Sets the desired output media type for the specified stream.
public abstract Task SetDesiredOutputType(int streamIndex, MediaType mediaType)
Parameters
streamIndexintThe zero-based index of the stream.
mediaTypeMediaTypeThe desired output media type.
Returns
- Task
A task representing the asynchronous operation.
Start()
Start the source
public virtual void Start()
Stop()
Stop the source
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 for processing.
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