Table of Contents

Class FallbackSwitchSourceBlock

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

Fallback switch source block that wraps any live source with automatic failover capability. Uses GStreamer's fallbacksrc element to provide seamless switching between main source and fallback content (static text, image, or media block) when the primary source fails. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class FallbackSwitchSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

FallbackSwitchSourceBlock(IVideoSourceSettings, FallbackSwitchSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.FallbackSwitchSourceBlock class.

public FallbackSwitchSourceBlock(IVideoSourceSettings mainSourceSettings, FallbackSwitchSettings fallbackSettings)

Parameters

mainSourceSettings IVideoSourceSettings

The main source settings (RTSP, SRT, NDI, etc.).

fallbackSettings FallbackSwitchSettings

The fallback switch configuration.

Properties

AudioOutput

Gets the audio output pad that provides the active audio stream (main or fallback).

public MediaBlockPad AudioOutput { get; }

Property Value

MediaBlockPad

Input

Gets the primary input pad (none for source blocks).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Type

Gets the media block type identifier for fallback switch source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoOutput

Gets the video output pad that provides the active video stream (main or fallback).

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds and initializes the fallback switch source and its internal components. Creates the GStreamer fallbacksrc element and establishes connections.

public override bool Build()

Returns

bool

True if the block was successfully built; false if initialization failed.

CleanUp()

Cleans up and releases all resources used by this block.

public void CleanUp()

Dispose(bool)

Releases all resources used by the fallback switch source block.

protected override void Dispose(bool disposing)

Parameters

disposing bool

True if disposing; false if finalizing.

GetCore()

Gets the core BaseElement wrapper. Not used for this block type.

public BaseElement GetCore()

Returns

BaseElement

Always returns null.

GetElement()

Gets the GStreamer element for IMediaBlockInternals.

public Element GetElement()

Returns

Element

The fallbacksrc element.

GetStatistics()

Gets statistics from the fallback source.

public Dictionary<string, object> GetStatistics()

Returns

Dictionary<string, object>

Dictionary containing statistics like retry counts and buffering percentages.

GetStatus()

Gets the current status of the fallback source.

public string GetStatus()

Returns

string

Status string from the fallbacksrc element.

GetVideoStreamInfo()

Gets the video stream information from the active source.

public VideoStreamInfo GetVideoStreamInfo()

Returns

VideoStreamInfo

The video stream information.

Unblock()

Manually unblocks the fallback source when manual-unblock is enabled.

public void Unblock()

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline that owns this block.

See Also