Table of Contents

Class HlsClientSource

Namespace
VAST.HLS
Assembly
VAST.HLS.dll

Represents an HLS (HTTP Live Streaming) client source that downloads and parses HLS playlists and media segments, implementing IInteractiveMediaSource for interactive playback control and IDiscardable for stream discard support.

public class HlsClientSource : AbstractHttpSource, INetworkSource, INetworkEndPoint, IInteractiveMediaSource, IMediaSource, IReferenceable, IDisposable, IDiscardable
Inheritance
HlsClientSource
Implements
Inherited Members

Constructors

HlsClientSource()

Initializes a new instance of the HlsClientSource class.

public HlsClientSource()

Properties

AllowAdaptiveStreamSwitch

Gets or sets whether to apply automatic adaptive stream switching in the source. Makes sense only when IsAdaptiveStreamSwitchSupported returns true.

public bool AllowAdaptiveStreamSwitch { get; set; }

Property Value

bool

AllowEos

Gets or sets whether source will stop on end of stream.

public bool AllowEos { get; set; }

Property Value

bool

Available

Gets whether source actually supports exposed IInteractiveMediaSource for currently opened URI.

public bool Available { get; }

Property Value

bool

CanPause

Gets whether source is capable of pausing

public bool CanPause { get; }

Property Value

bool

CanSeek

Gets whether source is capable of seeking

public bool CanSeek { get; }

Property Value

bool

Capabilities

Gets the list of source capabilities

public override List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

DiscardMode

Gets or sets the discard mode that controls how streams are filtered for output. Can only be changed before the source is started.

public DiscardMode DiscardMode { get; set; }

Property Value

DiscardMode

DiscardState

Gets current discard state of all original streams. The number of elements is equal to OriginalStreamCount. Can return empty list if source is not opened yet, is stopped or errored.

public List<bool> DiscardState { get; }

Property Value

List<bool>

Duration

Gets source duration if applicable, otherwise 0

public TimeSpan Duration { get; }

Property Value

TimeSpan

IsAdaptiveStreamSwitchSupported

Gets whether adaptive stream switching supported by the source.

public bool IsAdaptiveStreamSwitchSupported { get; }

Property Value

bool

IsChangeable

Gets whether source is changeable, i.e. duration will change in time

public bool IsChangeable { get; }

Property Value

bool

IsMonitor

Gets or sets whether source is monitoring file changes

public bool IsMonitor { get; set; }

Property Value

bool

Loop

Gets or sets whether playback should be an endless loop. If value is true then seek and pause are not available.

public bool Loop { get; set; }

Property Value

bool

OriginalStreamCount

Gets the total number of original streams before discard filtering is applied.

public int OriginalStreamCount { get; }

Property Value

int

Parameters

Gets or sets source parameters

public override SourceParameters Parameters { get; set; }

Property Value

SourceParameters

PlaybackRate

Gets or sets playback rate (if applicable). If value is 1 then normal playback pace is maintained. If value is more than 1 then it means fast forward playback with possible I-frames only stream if supported by source. If value is in (0..1) range then it means slow motion playback. If value is less or equal to -1 then it means rewind playback with possible I-frames only stream if supported by source. If value is double.MaxValue then source pushes samples as quickly as possible, without considering sample timestamps and playback time.

public double PlaybackRate { get; set; }

Property Value

double

Position

Gets or sets source playback position if seek is supported

public TimeSpan Position { get; set; }

Property Value

TimeSpan

StreamCount

Gets the number of output streams currently available.

public override int StreamCount { get; }

Property Value

int

Methods

Discard(Dictionary<int, bool>)

Applies discard flags for selected streams. This is a smooth discard request which should not produce any interruptions in playback.

public void Discard(Dictionary<int, bool> values)

Parameters

values Dictionary<int, bool>

Map of stream index to discard value

GetMediaType(int)

Gets the media type of the specified output stream.

public override MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

The zero-based output stream index to get the media type for.

Returns

MediaType

The MediaType of the requested stream, or null if the index is out of range.

GetMediaTypeAndIndices(int)

Gets media type of the specified stream and all indices

public NewStreamEventArgs GetMediaTypeAndIndices(int streamIndex)

Parameters

streamIndex int

Stream index to get media type for

Returns

NewStreamEventArgs

Media type and all indices of requested stream

GetOriginalMediaType(int)

Gets media type of the specified original stream

public MediaType GetOriginalMediaType(int streamIndex)

Parameters

streamIndex int

Original stream index to get media type for

Returns

MediaType

Media type of requested stream

Pause()

Pauses pushing of media data

public void Pause()

QueueRequiredAction(ActionRequiredEventArgs)

Queues required action for further processing

public void QueueRequiredAction(ActionRequiredEventArgs e)

Parameters

e ActionRequiredEventArgs

Required action

SetDesiredOutputType(int, MediaType)

Sets the desired output type for the specified stream. Not supported by this source.

public override Task SetDesiredOutputType(int streamIndex, MediaType mediaType)

Parameters

streamIndex int

The stream index.

mediaType MediaType

The desired media type.

Returns

Task

This method always throws NotImplementedException.

Start()

Starts or resumes playback of the source. For VOD and event sources that are already started, this queues a play action instead of restarting.

public override void Start()

Events

SourceChanged

Source has changed, i.e. duration and frame tables have to be updated. Not applicable for current source.

public event EventHandler SourceChanged

Event Type

EventHandler