Table of Contents

Class BridgeVideoSourceBlock

Namespace
VisioForge.Core.MediaBlocks.Bridge
Assembly
VisioForge.Core.dll

Video source block that bridges video data from other pipelines or applications using a channel-based communication system. This block acts as a source that receives video data from a named channel created by a BridgeVideoSinkBlock. It enables inter-pipeline communication for video streams, allowing complex architectures where video processing is distributed across multiple pipelines. The bridge uses an efficient in-memory transport mechanism with minimal latency and supports real-time video streaming at high resolutions and frame rates. Common use cases include receiving video from another pipeline, implementing modular video processing chains, creating multi-view applications, and building video distribution systems. The source can handle various video formats and color spaces with automatic format negotiation. Pair this source with a BridgeVideoSinkBlock using the same channel name to establish a complete video bridge connection. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class BridgeVideoSourceBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlocksBridge

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

BridgeVideoSourceBlock(BridgeVideoSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.BridgeVideoSourceBlock class with specified settings. Creates a bridge video source that will receive video data from the specified channel name.

public BridgeVideoSourceBlock(BridgeVideoSourceSettings settings)

Parameters

settings BridgeVideoSourceSettings

The bridge settings including channel name and buffer configuration.

Properties

Input

Gets the input pad. Bridge sources do not have inputs as they generate data from a channel.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads. Bridge sources have no inputs as they generate data from a channel.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the single video output pad for this source block.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. This source has a single video output.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the bridge video source settings, including the channel name and buffer configuration. The channel name must match the corresponding BridgeVideoSinkBlock for successful connection.

public BridgeVideoSourceSettings Settings { get; set; }

Property Value

BridgeVideoSourceSettings

Type

Gets the block type identifier for this bridge video source.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the bridge video source within the pipeline. Creates the bridge element with the specified channel settings, opens the channel connection, and establishes pad connections. The source will wait for data from the corresponding sink.

public override bool Build()

Returns

bool

true if the bridge source was successfully built; false if an error occurred.

CleanUp()

Releases all internal resources and disposes of the bridge video source element. This disconnects from the bridge channel and frees associated resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed 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 BaseElement wrapper for the bridge video source.

public BaseElement GetCore()

Returns

BaseElement

The BridgeVideoSource element that manages the channel communication.

GetElement()

Gets the underlying GStreamer element for this bridge source.

public Element GetElement()

Returns

Element

The GStreamer element that handles video bridging.

IsAvailable()

Determines whether this media block is available. Correct NuGet SDK redist should be included into your project.

public static bool IsAvailable()

Returns

bool

true if this media block is available; otherwise, false.

RemoveElementsFromPipeline()

Removes all internal elements from the pipeline. This method is typically called during cleanup or when reconfiguring the pipeline. It ensures proper disconnection from the bridge channel.

public override void RemoveElementsFromPipeline()

UpdateChannel(string)

Updates the channel name for this bridge source dynamically. This allows changing the bridge source without rebuilding the pipeline. The new channel must have a corresponding sink providing data.

public bool UpdateChannel(string channel)

Parameters

channel string

The new channel name to receive video from.

Returns

bool

true if the channel was successfully updated; false otherwise.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this bridge source, providing access to shared resources. This method is called internally during pipeline construction.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline that owns this bridge source.

See Also