Table of Contents

Class BridgeAudioSourceBlock

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

Audio source block that bridges audio data from other pipelines or applications using a channel-based communication system. This block acts as a source that receives audio data from a named channel created by a BridgeAudioSinkBlock. It enables inter-pipeline communication for audio streams, allowing complex architectures where audio processing is distributed across multiple pipelines. The bridge uses an efficient in-memory transport mechanism with minimal latency and supports real-time audio streaming. Common use cases include receiving audio from another pipeline, implementing modular audio processing chains, and creating reusable audio processing components. Pair this source with a BridgeAudioSinkBlock using the same channel name to establish a complete audio bridge connection. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

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

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

BridgeAudioSourceBlock(BridgeAudioSourceSettings)

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

public BridgeAudioSourceBlock(BridgeAudioSourceSettings settings)

Parameters

settings BridgeAudioSourceSettings

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 audio output pad for this source block.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

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

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

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

public BridgeAudioSourceSettings Settings { get; set; }

Property Value

BridgeAudioSourceSettings

Type

Gets the block type identifier for this bridge audio source.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the bridge audio 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 audio 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 audio source.

public BaseElement GetCore()

Returns

BaseElement

The BridgeAudioSource 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 audio 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 audio 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