Class UniversalAutoDemuxerBlock
- Namespace
- VisioForge.Core.MediaBlocks.Demuxers
- Assembly
- VisioForge.Core.dll
Represents a universal automatic demuxer block that dynamically selects the appropriate demuxer based on the input stream format detected by typefind element.
public class UniversalAutoDemuxerBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Remarks
The UniversalAutoDemuxerBlock is a MediaBlocks component that automatically detects the format of an incoming stream and creates the appropriate demuxer dynamically. It uses GStreamer's typefind element to identify the media format and then instantiates the correct demuxer element on the fly.
Key features: - Automatic format detection using typefind - Dynamic demuxer creation based on detected format - Support for all common container formats (MP4, MKV, AVI, WebM, etc.) - Pre-created output pads based on constructor parameters - Configurable output stream selection (video, audio, subtitle, metadata)
Output pads are pre-created based on constructor parameters: - If renderVideo is true, creates 1 video output pad - If renderAudio is true, creates 1 audio output pad - If renderSubtitle is true, creates 1 subtitle output pad - If renderMetadata is true, creates 1 metadata output pad
Constructors
UniversalAutoDemuxerBlock(bool, bool, bool, bool)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Demuxers.UniversalAutoDemuxerBlock class.
public UniversalAutoDemuxerBlock(bool renderVideo = true, bool renderAudio = true, bool renderSubtitle = false, bool renderMetadata = false)Parameters
renderVideobool-
Whether to output video streams.
renderAudiobool-
Whether to output audio streams.
renderSubtitlebool-
Whether to output subtitle streams.
renderMetadatabool-
Whether to output metadata streams.
Properties
AudioOutput
Gets the first audio output pad if available. Convenience property for accessing the primary audio stream.
public MediaBlockPad AudioOutput { get; }Property Value
AudioOutputs
Gets all audio output pads.
public MediaBlockPad[] AudioOutputs { get; }Property Value
Input
Gets the input pad.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads.
public override MediaBlockPad[] Inputs { get; }Property Value
MetadataOutputs
Gets all metadata output pads.
public MediaBlockPad[] MetadataOutputs { get; }Property Value
Output
Gets the primary output pad.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads.
public override MediaBlockPad[] Outputs { get; }Property Value
SubtitleOutput
Gets the first subtitle output pad if available. Convenience property for accessing the primary subtitle stream.
public MediaBlockPad SubtitleOutput { get; }Property Value
SubtitleOutputs
Gets all subtitle output pads.
public MediaBlockPad[] SubtitleOutputs { get; }Property Value
Type
Gets the type of this media block.
public override MediaBlockType Type { get; }Property Value
VideoOutput
Gets the first video output pad if available. Convenience property for accessing the primary video stream.
public MediaBlockPad VideoOutput { get; }Property Value
VideoOutputs
Gets all video output pads.
public MediaBlockPad[] VideoOutputs { get; }Property Value
Methods
Build()
Builds and initializes the demuxer block.
public override bool Build()Returns
- bool
-
True if successful, false otherwise.
CleanUp()
Cleans up resources used by this block.
public void CleanUp()Dispose(bool)
Disposes of this block.
protected override void Dispose(bool disposing)Parameters
disposingbool
GetCore()
Gets the core BaseElement wrapper.
public BaseElement GetCore()Returns
- BaseElement
GetElement()
Gets the underlying GStreamer element.
public Element GetElement()Returns
- Element
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The pipeline to associate with this block.