Class UniversalSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Universal source block with integrated decoders for comprehensive media file and stream playback. Provides automatic format detection, demuxing, and decoding for virtually any media format including local files, network streams, and URIs with support for video, audio, and subtitle tracks for complete media player functionality. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class UniversalSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
UniversalSourceBlock(UniversalSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.UniversalSourceBlock class with custom media settings. Configures the universal source for comprehensive media playback with automatic format detection.
public UniversalSourceBlock(UniversalSourceSettings settings)Parameters
settingsUniversalSourceSettings-
The universal source settings containing URI, stream selection, and decoding parameters.
Properties
AudioOutput
Gets the audio output pad that provides decoded audio stream to downstream blocks.
public MediaBlockPad AudioOutput { get; }Property Value
Input
Gets the primary input pad (none for source blocks that read from files/streams).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad (video output for universal source).
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (dynamic based on media content).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets the universal source configuration settings that control media loading and playback options.
public UniversalSourceSettings Settings { get; }Property Value
SubtitleOutput
Gets the subtitle output pad that provides decoded subtitle stream to downstream blocks.
public MediaBlockPad SubtitleOutput { get; }Property Value
Type
Gets the media block type identifier for universal source operations.
public override MediaBlockType Type { get; }Property Value
VideoOutput
Gets the video output pad that provides decoded video stream to downstream blocks.
public MediaBlockPad VideoOutput { get; }Property Value
Methods
Build()
Builds and initializes the universal source within the pipeline context. Creates demuxer, decoders, and processing chain for comprehensive media playback with all detected streams.
public override bool Build()Returns
- bool
-
trueif the universal source was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the universal source operations, including decoders and stream buffers.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the universal source. Properly closes media files/streams and disposes of GStreamer elements and decoding 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 GStreamer element wrapper for advanced configuration and monitoring.
public BaseElement GetCore()Returns
- BaseElement
-
Always null for composite source blocks with multiple internal elements.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
The universal source GStreamer element.
IsAvailable()
Determines whether universal source support is available on the current system. Requires GStreamer decoding plugins and format parsers to be installed.
public static bool IsAvailable()Returns
- bool
-
trueif universal source support is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this universal source, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this universal source.