Table of Contents

Class RtspInteractiveSource

Namespace
VAST.RTSP
Assembly
VAST.RTSP.dll

Represents an interactive RTSP source that supports seeking, pausing, and playback rate control.

public class RtspInteractiveSource : INetworkSource, INetworkEndPoint, IInteractiveMediaSource, IMediaSource, IReferenceable, IDisposable
Inheritance
RtspInteractiveSource
Implements
Inherited Members

Constructors

RtspInteractiveSource()

Initializes a new instance of the RtspInteractiveSource class.

public RtspInteractiveSource()

Properties

Accept

Whether source is accepted or not

public bool Accept { get; set; }

Property Value

bool

AllowAudio

Gets or sets whether audio stream(s) should be processed by the source. If set to false then all audio tracks are discarded.

public bool AllowAudio { 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

AudioTranscoding

Gets or sets whether the audio output should be transcoded. By default output is always transcoded for compatibility.

public MediaTranscodingMode AudioTranscoding { get; set; }

Property Value

MediaTranscodingMode

Available

Gets whether source actually supports exposed IInteractiveMediaSource for currently opened URI. Always true for this class.

public bool Available { get; }

Property Value

bool

CacheFolder

Gets or sets cache folder to be used to store chunks received from a source. If not specified then file cache is not used.

public string CacheFolder { get; set; }

Property Value

string

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 List<SourceCapability> Capabilities { get; }

Property Value

List<SourceCapability>

Duration

Gets source duration if applicable, otherwise 0

public TimeSpan Duration { get; }

Property Value

TimeSpan

EndPoint

Connected end point info

public IPProtoEndPoint EndPoint { get; }

Property Value

IPProtoEndPoint

GetUri

Gets or sets the delegate used to obtain a URI for a given seek position.

public RtspInteractiveSource.GetUriDelegate GetUri { get; set; }

Property Value

RtspInteractiveSource.GetUriDelegate

IsChangeable

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

public bool IsChangeable { get; }

Property Value

bool

IsDisposed

Can be used to check whether object is already disposed and can't be used anymore

public bool IsDisposed { get; }

Property Value

bool

IsMonitor

Gets or sets whether source is monitoring file changes

public bool IsMonitor { get; set; }

Property Value

bool

IsNetworkSource

Whether it's a network or local source.

public bool IsNetworkSource { get; }

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

MaxVideoFramerate

Gets or sets maximum framerate of a video output. Default value null means no limit.

public Rational MaxVideoFramerate { get; set; }

Property Value

Rational

MaxVideoHeight

Gets or sets maximum height of a video output. Default value 0 means no limit.

public int MaxVideoHeight { get; set; }

Property Value

int

MaxVideoWidth

Gets or sets maximum width of a video output. Default value 0 means no limit.

public int MaxVideoWidth { get; set; }

Property Value

int

Parameters

Gets or sets source parameters

public 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

PublishingPath

Publishing point name extracted from the source URI or by any other means (depends on the protocol)

public string PublishingPath { get; set; }

Property Value

string

ReceivedUri

Source URI when present (depends on the protocol)

public string ReceivedUri { get; set; }

Property Value

string

RefCount

Gets current reference count of the object

public int RefCount { get; }

Property Value

int

SocketError

Socket error got on disconnection

public ExtendedSocketError SocketError { get; }

Property Value

ExtendedSocketError

State

Current source state

public MediaState State { get; }

Property Value

MediaState

StreamCount

Total stream count of the source

public int StreamCount { get; }

Property Value

int

UniqueId

Unique source id

public Guid UniqueId { get; set; }

Property Value

Guid

Uri

URI to be opened to pull data from

public string Uri { get; set; }

Property Value

string

UseAbsoluteTimestamps

Gets or sets whether to use absolute timestamps instead of relative ones. Default value is false.

public bool UseAbsoluteTimestamps { get; set; }

Property Value

bool

VideoTranscoding

Gets or sets whether the video output should be transcoded. By default output is always transcoded for compatibility.

public MediaTranscodingMode VideoTranscoding { get; set; }

Property Value

MediaTranscodingMode

Methods

AddRef()

Add reference

public void AddRef()

Dispose()

Releases all resources used by the RtspInteractiveSource class.

public void Dispose()

GetMediaType(int)

Gets media type of the stream

public MediaType GetMediaType(int streamIndex)

Parameters

streamIndex int

Stream index to get media type for

Returns

MediaType

Media type of requested stream

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

Open()

Open source using specified URI

public void Open()

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

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 desired output media type of the specified stream. Desired media type could be an incomplete media type specifying only necessary parameters. Source should implement decoding or encoding internally to provide requested output type. It is not guaranteed though that an actual output type will match a desired type exactly. GetMediaType function should be used to obtain actual output media type.

public Task SetDesiredOutputType(int streamIndex, MediaType desiredType)

Parameters

streamIndex int

Stream index to set desired output media type for

desiredType MediaType

Desired media type

Returns

Task

Start()

Start media pushing

public void Start()

Stop()

Stop media pushing and closes the source

public void Stop()

Events

Error

Occurs when an error is encountered during streaming.

public event EventHandler<ErrorEventArgs> Error

Event Type

EventHandler<ErrorEventArgs>

NewSample

Occurs when a new media sample is ready.

public event EventHandler<NewSampleEventArgs> NewSample

Event Type

EventHandler<NewSampleEventArgs>

NewStream

Occurs when a new stream has been created.

public event EventHandler<NewStreamEventArgs> NewStream

Event Type

EventHandler<NewStreamEventArgs>

SourceChanged

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

public event EventHandler SourceChanged

Event Type

EventHandler

StateChanged

Occurs when the source state changes.

public event EventHandler<MediaState> StateChanged

Event Type

EventHandler<MediaState>