Table of Contents

Class RTSPSourceBlock

Namespace
VisioForge.Core.MediaBlocks.Sources
Assembly
VisioForge.Core.dll

RTSP (Real Time Streaming Protocol) source block with integrated decoders for IP camera and streaming server access. Provides low-latency video and audio streaming from network cameras, surveillance systems, and media servers with automatic codec detection, RTP/RTCP transport, and synchronized playback for security, broadcast, and live streaming applications. Supports configurable low latency mode for real-time applications by minimizing buffering and dropping late frames. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class RTSPSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IGetVideoStreamInfo

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

RTSPSourceBlock(RTSPSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.RTSPSourceBlock class with custom RTSP settings. Configures the RTSP source for network streaming with automatic codec detection and decoding.

public RTSPSourceBlock(RTSPSourceSettings settings)

Parameters

settings RTSPSourceSettings

The RTSP settings controlling URI, authentication, transport protocol, and stream selection.

Properties

AudioOutput

Gets the audio output pad that provides decoded RTSP audio stream to downstream blocks.

public MediaBlockPad AudioOutput { get; }

Property Value

MediaBlockPad

Input

Gets the primary input pad (none for source blocks that receive network streams).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad (video output for RTSP).

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (dynamic based on stream content).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the RTSP configuration settings that control connection parameters and streaming options.

public RTSPSourceSettings Settings { get; set; }

Property Value

RTSPSourceSettings

Type

Gets the media block type identifier for RTSP source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoOutput

Gets the video output pad that provides decoded RTSP video stream to downstream blocks.

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds and initializes the RTSP source within the pipeline context. Establishes network connection, negotiates stream parameters, and prepares decoders for audio/video playback.

public override bool Build()

Returns

bool

true if the RTSP source was successfully built and configured; otherwise, false.

CleanUp()

Cleans up all resources associated with the RTSP operations, including network connections and decoder resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the RTSP source. Properly closes network connections and disposes of GStreamer elements and streaming resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core GStreamer element wrapper for advanced configuration and monitoring.

public BaseElement GetCore()

Returns

BaseElement

Always null for composite source blocks with multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The RTSP source GStreamer element.

GetVideoStreamInfo()

Gets the detailed video stream information extracted from the RTSP source.

public VideoStreamInfo GetVideoStreamInfo()

Returns

VideoStreamInfo

A VideoStreamInfo object containing codec, resolution, frame rate, and format details of the video stream.

IsAvailable()

Determines whether RTSP support is available on the current system. Requires GStreamer RTSP plugins and codec libraries to be installed.

public static bool IsAvailable()

Returns

bool

true if RTSP support is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this RTSP source, providing access to the parent pipeline and logging context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this RTSP source.

OnAudioRAWFrame

Event raised when raw compressed audio frames are received from the RTSP stream before decoding. Requires RTSPSourceSettings.EnableRAWVideoAudioEvents to be set to true for activation.

public event EventHandler<DataFrameEventArgs> OnAudioRAWFrame

Event Type

EventHandler<DataFrameEventArgs>

OnVideoRAWFrame

Event raised when raw compressed video frames are received from the RTSP stream before decoding. Requires RTSPSourceSettings.EnableRAWVideoAudioEvents to be set to true for activation.

public event EventHandler<DataFrameEventArgs> OnVideoRAWFrame

Event Type

EventHandler<DataFrameEventArgs>

See Also