Table of Contents

Class AbstractHttpSource

Namespace
VAST.HTTP
Assembly
VAST.Common.dll

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

bool

Capabilities

Gets the list of source capabilities.

public abstract List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

EndPoint

Gets the connected endpoint information.

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

IsDisposed

Gets a value indicating whether this object has been disposed and can no longer be used.

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

Parameters

Gets or sets the source parameters.

public abstract SourceParameters Parameters { get; set; }

Property Value

SourceParameters

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

string

ReceivedUri

Gets or sets the source URI when present (protocol-dependent).

public string ReceivedUri { get; set; }

Property Value

string

RefCount

Gets the current reference count of the object.

public int RefCount { get; }

Property Value

int

SocketError

Gets the socket error that occurred on disconnection.

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Gets the current source state.

public virtual MediaState State { get; protected set; }

Property Value

MediaState

StreamCount

Gets the number of streams in the source.

public abstract int StreamCount { get; }

Property Value

int

UniqueId

Gets or sets the unique identifier of the source.

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

Gets or sets the URI to be opened. Custom parameters are extracted and removed during assignment.

public string Uri { get; set; }

Property Value

string

UserHeaders

Gets the collection of user-defined HTTP headers to include in requests.

public LockableCollection<LockableHeader> UserHeaders { get; }

Property Value

LockableCollection<LockableHeader>

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

streamIndex int

The 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

streamIndex int

The zero-based index of the stream.

mediaType MediaType

The 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

EventHandler<ErrorEventArgs>

NewSample

Occurs when a new media sample is ready for processing.

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>