Table of Contents

Class BridgeAudioSinkBlock

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

Audio sink block that bridges audio data between different pipelines or applications using a channel-based communication system. This block acts as an endpoint that receives audio data and makes it available to other pipelines or processes through a named channel. 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 splitting audio processing across multiple pipelines, implementing modular audio processing chains, and creating reusable audio processing components. Pair this sink with a BridgeAudioSourceBlock 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 BridgeAudioSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlocksBridge

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

BridgeAudioSinkBlock(BridgeAudioSinkSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.BridgeAudioSinkBlock class with specified settings. Creates a bridge audio sink that will send audio data to the specified channel name.

public BridgeAudioSinkBlock(BridgeAudioSinkSettings settings)

Parameters

settings BridgeAudioSinkSettings

The bridge settings including channel name and buffer configuration.

Properties

Input

Gets the single audio input pad for this sink block.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads. This sink has a single audio input.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad. Bridge sinks do not have outputs as they are terminal blocks.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. Bridge sinks have no outputs as they are terminal blocks.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

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

public BridgeAudioSinkSettings Settings { get; set; }

Property Value

BridgeAudioSinkSettings

Type

Gets the block type identifier for this bridge audio sink.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the bridge audio sink within the pipeline. Creates the bridge element with the specified channel settings and establishes pad connections.

public override bool Build()

Returns

bool

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

CleanUp()

Releases all internal resources and disposes of the bridge audio sink 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 sink.

public BaseElement GetCore()

Returns

BaseElement

The BridgeAudioSink element that manages the channel communication.

GetElement()

Gets the underlying GStreamer element for this bridge sink.

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.

UpdateChannel(string)

Updates the channel name for this bridge sink dynamically. This allows changing the bridge destination without rebuilding the pipeline. The new channel must exist or be created by a corresponding source.

public bool UpdateChannel(string channel)

Parameters

channel string

The new channel name to bridge audio to.

Returns

bool

true if the channel was successfully updated; false otherwise.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this bridge sink, 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 sink.

See Also