Class UniversalSourceBlockMini
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Lightweight universal media source block with integrated format detection and decoding capabilities. This mini version of UniversalSourceBlock provides a streamlined implementation optimized for common media playback scenarios, offering automatic format detection, demuxing, and decoding in a single block. Designed for applications requiring simple media playback without the complexity of manual pipeline construction.
Key features:
- Automatic format detection for 100+ container and codec combinations
- Integrated demuxing and decoding with hardware acceleration support
- Dynamic pad creation based on available streams (video/audio/subtitle)
- Support for local files, HTTP/HTTPS URLs, and custom URI schemes
- Optimized memory usage for embedded and mobile applications
- Selective stream rendering (video-only, audio-only, or both)
- Built-in buffering and synchronization management
Supported sources:
- Local files: All major formats (MP4, AVI, MKV, MOV, WebM, etc.)
- Network streams: HTTP, HTTPS, RTSP, RTMP, HLS, DASH
- Device URIs: Custom schemes for platform-specific sources
- Memory streams: Via custom URI protocols
Common use cases:
- Media player applications with basic playback needs
- Video preview and thumbnail generation
- Audio-only playback for music applications
- Embedded systems with limited resources
- Quick media format validation and analysis
The "Mini" designation indicates this block uses simplified internal processing compared to the full UniversalSourceBlock, trading some advanced features for reduced complexity and resource usage while maintaining compatibility with most common media formats and use cases. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class UniversalSourceBlockMini : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
UniversalSourceBlockMini(UniversalSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.UniversalSourceBlockMini class. Creates a universal media source configured for automatic format detection and decoding.
public UniversalSourceBlockMini(UniversalSourceSettings settings)Parameters
settingsUniversalSourceSettings-
The universal source settings containing URI, stream selection preferences, and playback options.
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 settings that control media loading and playback behavior.
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 with automatic format detection and decoding. Creates the underlying GStreamer elements, validates the URI, and prepares for playback.
public override bool Build()Returns
- bool
-
trueif the source was successfully built and opened;falseif initialization failed due to invalid URI or missing codecs.
CleanUp()
Performs cleanup of all resources associated with the universal source. Releases GStreamer elements and handles platform-specific resource cleanup.
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 wrapper element for internal pipeline operations.
public BaseElement GetCore()Returns
- BaseElement
-
Always returns null as UniversalSource manages elements internally.
GetElement()
Gets the underlying GStreamer element for advanced configuration and pipeline integration.
public Element GetElement()Returns
- Element
-
The native GStreamer element performing the source operations.
IsAvailable()
Determines whether the universal source functionality is available on the current platform. Requires appropriate GStreamer plugins and codecs to be installed.
public static bool IsAvailable()Returns
- bool
-
trueif universal source is available with necessary plugins;falseif required components are missing.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this source block. Called internally when the block is added to a pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocksPipeline that will manage this source.