Class ProxySinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Bridge
- Assembly
- VisioForge.Core.dll
Proxy sink block that enables direct element-to-element communication within the same pipeline using GStreamer's proxy elements. This block acts as a sink that pairs with a ProxySourceBlock to create an internal bridge within a single pipeline, allowing dynamic pipeline reconfiguration and data routing 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 sink automatically registers itself in a global cache for discovery by its paired source. Common use cases include implementing switchable effects chains, creating reusable processing modules within a pipeline, and building dynamic routing systems. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals.
public class ProxySinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
ProxySinkBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.ProxySinkBlock class with specified pair ID. Creates a proxy sink that will forward data to the ProxySourceBlock with matching pair ID. The sink is automatically registered in the global bridge cache for discovery by sources.
public ProxySinkBlock(string pairID)Parameters
pairIDstring-
The unique identifier that pairs this sink with its corresponding proxy source.
Properties
Input
Gets the single input pad for this sink block.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads. This sink has a single input that accepts any media type.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad. Proxy sinks do not have outputs as they are terminal blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. Proxy sinks have no outputs as they are terminal blocks.
public override MediaBlockPad[] Outputs { get; }Property Value
PairID
Gets or sets the unique pair identifier that links this sink to its corresponding proxy source. Both sink and source must use the same pair ID for successful connection within the pipeline.
public string PairID { get; set; }Property Value
Type
Gets the block type identifier for this proxy sink.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the proxy sink within the pipeline. Creates the proxysink element and establishes pad connections. The sink will be ready to forward data to its paired ProxySourceBlock once both are built.
public override bool Build()Returns
- bool
-
trueif the proxy sink was successfully built;falseif an error occurred.
CleanUp()
Performs cleanup operations for the proxy sink. 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
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
GetCore()
Gets the core BaseElement wrapper for the proxy sink.
public BaseElement GetCore()Returns
- BaseElement
-
The ProxySink element that manages the proxy connection.
GetElement()
Gets the underlying GStreamer element for this proxy sink.
public Element GetElement()Returns
- Element
-
The GStreamer proxysink 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
-
trueif this media block is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this proxy sink, providing access to shared resources. This method is called internally during pipeline construction.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline that owns this proxy sink.