Table of Contents

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, IMediaBlockInternals

Inheritance

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

renderVideo bool

Whether to output video streams.

renderAudio bool

Whether to output audio streams.

renderSubtitle bool

Whether to output subtitle streams.

renderMetadata bool

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

MediaBlockPad

AudioOutputs

Gets all audio output pads.

public MediaBlockPad[] AudioOutputs { get; }

Property Value

MediaBlockPad[]

Input

Gets the input pad.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

MetadataOutputs

Gets all metadata output pads.

public MediaBlockPad[] MetadataOutputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

SubtitleOutput

Gets the first subtitle output pad if available. Convenience property for accessing the primary subtitle stream.

public MediaBlockPad SubtitleOutput { get; }

Property Value

MediaBlockPad

SubtitleOutputs

Gets all subtitle output pads.

public MediaBlockPad[] SubtitleOutputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the type of this media block.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoOutput

Gets the first video output pad if available. Convenience property for accessing the primary video stream.

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

VideoOutputs

Gets all video output pads.

public MediaBlockPad[] VideoOutputs { get; }

Property Value

MediaBlockPad[]

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

disposing bool

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

pipeline MediaBlocksPipeline

The pipeline to associate with this block.