Class BridgeSubtitleSinkBlock
- Namespace
- VisioForge.Core.MediaBlocks.Bridge
- Assembly
- VisioForge.Core.dll
Subtitle sink block that bridges subtitle data between different pipelines or applications using a channel-based communication system. This block acts as an endpoint that receives subtitle data (text, SSA/ASS, WebVTT, or other formats) and makes it available to other pipelines or processes through a named channel. It enables inter-pipeline communication for subtitle streams, allowing complex architectures where subtitle processing is distributed across multiple pipelines. The bridge supports various subtitle formats and maintains timing synchronization. Common use cases include subtitle extraction and routing, implementing subtitle processing chains, overlaying subtitles from different sources, and creating subtitle broadcasting systems. Pair this sink with a BridgeSubtitleSourceBlock using the same channel name to establish a complete subtitle bridge. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class BridgeSubtitleSinkBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals, IMediaBlocksBridgeInheritance
Implements
Inherited Members
Extension Methods
Constructors
BridgeSubtitleSinkBlock(BridgeSubtitleSinkSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Bridge.BridgeSubtitleSinkBlock class with specified settings. Creates a bridge subtitle sink that will send subtitle data to the specified channel name.
public BridgeSubtitleSinkBlock(BridgeSubtitleSinkSettings settings)Parameters
settingsBridgeSubtitleSinkSettings-
The bridge settings including channel name and subtitle format configuration.
Properties
Input
Gets the single subtitle input pad for this sink block.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads. This sink has a single subtitle input.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad. Bridge sinks do not have outputs as they are terminal blocks.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads. Bridge sinks have no outputs as they are terminal blocks.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the bridge subtitle sink settings, including the channel name and subtitle format configuration. The channel name must match the corresponding BridgeSubtitleSourceBlock for successful connection.
public BridgeSubtitleSinkSettings Settings { get; set; }Property Value
Type
Gets the block type identifier for this bridge subtitle sink.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the bridge subtitle sink within the pipeline. Creates the bridge element with the specified channel settings and establishes pad connections.
public override bool Build()Returns
- bool
-
trueif the bridge sink was successfully built;falseif an error occurred.
CleanUp()
Releases all internal resources and disposes of the bridge subtitle sink element. This disconnects from the bridge channel and frees associated 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 bridge subtitle sink.
public BaseElement GetCore()Returns
- BaseElement
-
The BridgeSubtitleSink element that manages the channel communication.
GetElement()
Gets the underlying GStreamer element for this bridge sink.
public Element GetElement()Returns
- Element
-
The GStreamer element that handles subtitle bridging.
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.
UpdateChannel(string)
Updates the channel name for this bridge sink dynamically. This allows changing the bridge destination without rebuilding the pipeline. The new channel must exist or be created by a corresponding source.
public bool UpdateChannel(string channel)Parameters
channelstring-
The new channel name to bridge subtitles to.
Returns
- bool
-
trueif the channel was successfully updated;falseotherwise.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this bridge 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 bridge sink.