Table of Contents

Class RSInterSourceBlock

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

RS (Rust) inter source block that enables high-performance inter-pipeline communication using Rust-based GStreamer elements. This block acts as a source that listens to a named channel created by an RSInterSinkBlock with the same channel name. RS inter elements provide optimized performance through Rust implementations while maintaining compatibility with standard GStreamer pipelines. The source supports zero-copy data transfer, 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. Unlike standard InterPipe elements, RS inter elements may offer better performance characteristics and additional features through their Rust implementation. Common use cases include high-throughput data reception, low-latency pipeline communication, implementing scalable media processing architectures, and building performance-critical applications. The media type parameter ensures proper type safety and format negotiation. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class RSInterSourceBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

RSInterSourceBlock(MediaBlockPadMediaType, string)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.RSInterSourceBlock class with specified media type and channel ID. Creates an RS inter source that will listen for data from the RSInterSinkBlock with the same channel name. The media type ensures proper format negotiation and type safety.

public RSInterSourceBlock(MediaBlockPadMediaType mediaType, string pairID)

Parameters

mediaType MediaBlockPadMediaType

The type of media this source will provide (video, audio, subtitle, or auto).

pairID string

The unique identifier for the named channel to connect to.

Properties

Input

Gets the input pad. RS inter sources do not have inputs as they generate data from a named channel.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads. RS inter sources have no inputs as they generate data from a named channel.

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 with the specified media type.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

PairID

Gets or sets the unique channel identifier that links this source to its corresponding sink. The source will receive data from the RSInterSinkBlock with the same PairID.

public string PairID { get; set; }

Property Value

string

Type

Gets the block type identifier for this RS inter source.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the RS inter source within the pipeline. Creates the Rust-based inter source element with the specified channel name and media type, opens the connection, and establishes pad connections. The source will wait for an RSInterSinkBlock with the same PairID to provide data.

public override bool Build()

Returns

bool

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

CleanUp()

Performs cleanup operations for the RS inter 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 RS inter source.

public BaseElement GetCore()

Returns

BaseElement

The RSInterSource element that manages the channel communication.

GetElement()

Gets the underlying GStreamer element for this RS inter source.

public Element GetElement()

Returns

Element

The Rust-based GStreamer inter source 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.

RemoveElementsFromPipeline()

Removes all internal elements from the pipeline. This method is typically called during cleanup or when reconfiguring the pipeline. It ensures proper disconnection from the RS inter channel.

public override void RemoveElementsFromPipeline()

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

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

See Also