Table of Contents

Class InterPipeSourceBlock

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

InterPipe source block that enables high-performance inter-pipeline communication using the GStreamer interpipe plugin. This block acts as a source that listens to a named pipe created by an InterPipeSinkBlock with the same pipe name. InterPipe provides zero-copy data transfer between pipelines running in the same process, with support for dynamic connection/disconnection, automatic format negotiation, and seamless pipeline synchronization. Multiple source blocks can connect to the same sink, enabling one-to-many data distribution patterns. The source maintains compatibility with standard GStreamer elements while providing enhanced performance for local pipeline communication. Common use cases include receiving data from modular processing pipelines, implementing multi-view applications, creating reusable processing components, and building complex media processing graphs with dynamic routing. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class InterPipeSourceBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

InterPipeSourceBlock(string, MediaBlockPadMediaType)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.InterPipeSourceBlock class with specified pipe ID. Creates an InterPipe source that will listen for data from the InterPipeSinkBlock with the same pipe name.

public InterPipeSourceBlock(string pairID, MediaBlockPadMediaType mediaType)

Parameters

pairID string

The unique identifier for the named pipe to connect to.

mediaType MediaBlockPadMediaType

The media type of the output pad, which determines the format of data received from the InterPipe sink.

Properties

Input

Gets the input pad. InterPipe sources do not have inputs as they generate data from a named pipe.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads. InterPipe sources have no inputs as they generate data from a named pipe.

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 pipe identifier that links this source to its corresponding sink. The source will receive data from the InterPipeSinkBlock with the same PairID.

public string PairID { get; set; }

Property Value

string

Type

Gets the block type identifier for this InterPipe source.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the InterPipe source within the pipeline. Creates the interpipesrc element with the specified pipe name, opens the connection, and establishes pad connections. The source will wait for an InterPipeSinkBlock with the same PairID to provide data.

public override bool Build()

Returns

bool

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

CleanUp()

Performs cleanup operations for the InterPipe source. Note: The actual element disposal is commented out, likely to maintain flexibility for dynamic pipeline reconfiguration.

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 InterPipe source. Note: This implementation returns null as the InterPipe source uses a different architecture.

public BaseElement GetCore()

Returns

BaseElement

Always returns null for InterPipe sources.

GetElement()

Gets the underlying GStreamer element for this InterPipe source.

public Element GetElement()

Returns

Element

The GStreamer interpipesrc 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.

SwitchListenTo(string)

Dynamically switches this source to listen to a different InterPipeSinkBlock. This allows runtime reconfiguration of pipeline connections without rebuilding.

public void SwitchListenTo(string newPairID)

Parameters

newPairID string

The PairID of the InterPipeSinkBlock to start listening to.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

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

See Also