Class InterPipeSinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Bridge
- Assembly
- VisioForge.Core.dll
InterPipe sink block that enables high-performance inter-pipeline communication using the GStreamer interpipe plugin. This block acts as an endpoint that publishes data to a named pipe, making it available to InterPipeSourceBlock instances with the same pipe name. InterPipe provides zero-copy data transfer between pipelines running in the same process, with support for multiple listeners, dynamic connection/disconnection, and automatic format negotiation. The sink maintains compatibility with standard GStreamer elements while providing enhanced performance for local pipeline communication. Common use cases include splitting processing across multiple pipelines for modularity, implementing one-to-many data distribution, creating reusable processing components, and building complex media processing graphs. The video information parameter helps optimize buffer handling for video streams but the block can handle any media type. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals.
public class InterPipeSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
InterPipeSinkBlock(string, VideoFrameInfoX)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.InterPipeSinkBlock class with specified pipe ID and optional video information. Creates an InterPipe sink that will publish data to the named pipe for consumption by InterPipeSourceBlock instances.
public InterPipeSinkBlock(string pairID, VideoFrameInfoX videoInfo)Parameters
pairIDstring-
The unique identifier for the named pipe that sources will connect to.
videoInfoVideoFrameInfoX-
Optional video frame information for optimizing video buffer handling. Can be null for non-video data.
InterPipeSinkBlock(string, AudioInfoX)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.InterPipeSinkBlock class with specified pipe ID and audio information. Creates an InterPipe sink that will publish audio data to the named pipe for consumption by InterPipeSourceBlock instances.
public InterPipeSinkBlock(string pairID, AudioInfoX audioInfo)Parameters
pairIDstring-
The unique identifier for the named pipe that sources will connect to.
audioInfoAudioInfoX-
Audio information for optimizing audio buffer handling.
InterPipeSinkBlock(string, MediaBlockPadMediaType)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.InterPipeSinkBlock class with specified pipe ID and media type. Creates an InterPipe sink that will publish data to the named pipe for consumption by InterPipeSourceBlock instances.
public InterPipeSinkBlock(string pairID, MediaBlockPadMediaType mediaType)Parameters
pairIDstring-
The unique identifier for the named pipe that sources will connect to.
mediaTypeMediaBlockPadMediaType-
The media type for this sink (Video or Audio).
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. InterPipe sinks do not have outputs as they are terminal blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. InterPipe sinks have no outputs as they are terminal blocks.
public override MediaBlockPad[] Outputs { get; }Property Value
PairID
Gets or sets the unique pipe identifier that links this sink to its corresponding sources. All InterPipeSourceBlock instances with the same PairID will receive data from this sink.
public string PairID { get; set; }Property Value
Type
Gets the block type identifier for this InterPipe sink.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the InterPipe sink within the pipeline. Creates the interpipesink element with the specified pipe name and establishes pad connections. The sink will immediately begin accepting data for distribution to connected sources.
public override bool Build()Returns
- bool
-
trueif the InterPipe sink was successfully built;falseif an error occurred.
CleanUp()
Performs cleanup operations for the InterPipe sink. Note: The actual element disposal is commented out, likely to maintain the named pipe for other pipelines that may still be connected.
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 InterPipe sink.
public BaseElement GetCore()Returns
- BaseElement
-
The InterPipeSink element that manages the named pipe.
GetElement()
Gets the underlying GStreamer element for this InterPipe sink.
public Element GetElement()Returns
- Element
-
The GStreamer interpipesink element.
GetNumListeners()
Gets the number of InterPipeSourceBlock elements currently listening to this sink.
public int GetNumListeners()Returns
- int
-
The number of listeners connected to this sink.
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 InterPipe 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 InterPipe sink.