Table of Contents

Class ProxySourceBlock

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

Proxy source block that enables direct element-to-element communication within the same pipeline using GStreamer's proxy elements. This block acts as a source that pairs with a ProxySinkBlock to create an internal bridge within a single pipeline, receiving data without traditional pad connections. The proxy mechanism provides a way to decouple pipeline sections, making it easier to implement dynamic pipeline topologies, switchable processing paths, and modular pipeline designs. Unlike InterPipe which works across pipelines, proxy elements work within the same pipeline with minimal overhead. The source automatically discovers its paired sink through a global cache and establishes the connection during build. Common use cases include implementing switchable effects chains, creating reusable processing modules within a pipeline, building dynamic routing systems, and enabling runtime pipeline reconfiguration without rebuilding the entire graph. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals.

public class ProxySourceBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

ProxySourceBlock(string)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.ProxySourceBlock class with specified pair ID. Creates a proxy source that will receive data from the ProxySinkBlock with matching pair ID. The source is automatically registered in the global bridge cache for discovery by sinks.

public ProxySourceBlock(string pairID)

Parameters

pairID string

The unique identifier that pairs this source with its corresponding proxy sink.

Properties

Input

Gets the input pad. Proxy sources do not have inputs as they generate data from a paired sink.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads. Proxy sources have no inputs as they generate data from a paired sink.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the single output pad for this source block.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads. This source has a single output that provides any media type.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

PairID

Gets or sets the unique pair identifier that links this source to its corresponding proxy sink. Both sink and source must use the same pair ID for successful connection within the pipeline.

public string PairID { get; set; }

Property Value

string

Type

Gets the block type identifier for this proxy source.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the proxy source within the pipeline. Discovers the corresponding sink through the bridge cache, creates the proxy element with the sink reference, and establishes pad connections. If the sink is found, it ensures the sink is built first to establish the proxy connection properly.

public override bool Build()

Returns

bool

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

CleanUp()

Performs cleanup operations for the proxy source. Note: The actual element disposal is handled in the Dispose method to ensure proper removal from the bridge cache before releasing 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 proxy source. Note: This implementation returns null as the proxy source uses a different architecture.

public BaseElement GetCore()

Returns

BaseElement

Always returns null for proxy sources.

GetElement()

Gets the underlying GStreamer element for this proxy source.

public Element GetElement()

Returns

Element

The GStreamer proxysrc element.

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.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this proxy 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 proxy source.

See Also