Class UniversalDemuxDecoderBlock
- Namespace
- VisioForge.Core.MediaBlocks.Special
- Assembly
- VisioForge.Core.dll
A unified demuxer and decoder block that handles the complete pipeline from source to decoding. This block uses UniversalSourceSettings and automatically selects appropriate demuxers, parsers, and decoders based on the actual capabilities reported by GStreamer elements.
public class UniversalDemuxDecoderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
UniversalDemuxDecoderBlock(UniversalSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.UniversalDemuxDecoderBlock class.
public UniversalDemuxDecoderBlock(UniversalSourceSettings settings)Parameters
settingsUniversalSourceSettings-
The UniversalSourceSettings containing source URI and rendering options.
Properties
AudioOutput
public MediaBlockPad AudioOutput { get; }Property Value
Input
Gets the primary input pad for this media block.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the collection of input pads for this media block.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad for this media block.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the collection of output pads for this media block.
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets the UniversalSourceSettings used for this block.
public UniversalSourceSettings Settings { get; }Property Value
SubtitleOutput
public MediaBlockPad SubtitleOutput { get; }Property Value
Type
Gets or sets the functional type of this media block (source, sink, effect, encoder, etc.). This property must be overridden in derived classes to specify the block's role in the pipeline.
public override MediaBlockType Type { get; }Property Value
Exceptions
- NotImplementedException
-
Thrown when the derived class has not implemented this property.
- NotImplementedException
-
Thrown when the derived class has not implemented the setter.
VideoOutput
public MediaBlockPad VideoOutput { get; }Property Value
Methods
Build()
Builds and initializes this media block, creating any necessary GStreamer elements and configuring them. This method must be overridden in derived classes to implement block-specific initialization logic.
public override bool Build()Returns
- bool
-
trueif the block was successfully built; otherwise,false.
CreateAsync(Uri, bool, bool, bool)
Creates a UniversalDemuxDecoderBlock from a URI.
public static Task<UniversalDemuxDecoderBlock> CreateAsync(Uri uri, bool renderVideo = true, bool renderAudio = true, bool renderSubtitle = false)Parameters
Returns
CreateAsync(string, bool, bool, bool)
Creates a UniversalDemuxDecoderBlock from a file path.
public static Task<UniversalDemuxDecoderBlock> CreateAsync(string filePath, bool renderVideo = true, bool renderAudio = true, bool renderSubtitle = false)Parameters
Returns
Dispose(bool)
Releases unmanaged and - optionally - managed resources. Override this method in derived classes to implement block-specific cleanup logic.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto release only unmanaged resources.
IMediaBlockInternals.Build()
Constructs and initializes the underlying GStreamer elements for this MediaBlock. This method creates the necessary GStreamer components, configures their properties, and prepares the block for integration into the pipeline. Must be called before the block can process media.
bool IMediaBlockInternals.Build()Returns
- bool
-
True if the block was successfully built and all required elements were created; false if construction failed.
IMediaBlockInternals.CleanUp()
Releases all resources and performs cleanup operations for this MediaBlock. This method disposes of GStreamer elements, releases memory, and ensures proper shutdown of the block. Called automatically during pipeline teardown.
void IMediaBlockInternals.CleanUp()IMediaBlockInternals.GetCore()
Retrieves the core BaseElement wrapper that provides additional functionality around the GStreamer element. This wrapper adds VisioForge-specific features and simplifies common operations on the underlying GStreamer element.
BaseElement IMediaBlockInternals.GetCore()Returns
- BaseElement
-
The BaseElement wrapper instance that encapsulates the GStreamer element.
IMediaBlockInternals.GetElement()
Retrieves the primary GStreamer element that represents this MediaBlock in the pipeline. This element is the main component that performs the actual media processing and is connected to other elements in the GStreamer pipeline.
Element IMediaBlockInternals.GetElement()Returns
- Element
-
The GStreamer Element instance, or null if the block hasn't been built yet.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Associates this MediaBlock with a pipeline and initializes its internal context. This method is called automatically when the block is added to a pipeline, providing access to shared resources and pipeline-wide configuration.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The MediaBlocksPipeline instance that will manage this block.