Table of Contents

Class PlayBinSourceBlock

Namespace
VisioForge.Core.MediaBlocks.Sources
Assembly
VisioForge.Core.dll

PlayBin source block for universal media playback with automatic format detection and decoding. Provides comprehensive media source support using GStreamer's PlayBin element for files, network streams, and URIs with automatic codec selection, stream demuxing, and synchronized audio/video/subtitle playback for media player applications. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class PlayBinSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

PlayBinSourceBlock(UniversalSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.PlayBinSourceBlock class with universal source settings. Configures the PlayBin source for automatic media playback with specified URI and stream selection.

public PlayBinSourceBlock(UniversalSourceSettings settings)

Parameters

settings UniversalSourceSettings

The universal source settings containing URI, stream selection, and playback configuration parameters.

Properties

AudioOutput

Gets the audio output pad that provides decoded audio stream to downstream blocks.

public MediaBlockPad AudioOutput { get; }

Property Value

MediaBlockPad

Input

Gets the primary input pad (none for source blocks that read from URIs).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad (video output for PlayBin).

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (dynamic based on enabled streams).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

SubtitleOutput

Gets the subtitle output pad that provides decoded subtitle stream to downstream blocks.

public MediaBlockPad SubtitleOutput { get; }

Property Value

MediaBlockPad

Type

Gets the media block type identifier for PlayBin source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoOutput

Gets the video output pad that provides decoded video stream to downstream blocks.

public MediaBlockPad VideoOutput { get; }

Property Value

MediaBlockPad

Methods

Build()

Builds and initializes the PlayBin source within the pipeline context. Creates PlayBin element, configures URI, sets up automatic decoding, and prepares outputs for downstream processing.

public override bool Build()

Returns

bool

true if the PlayBin source was successfully built and configured; otherwise, false.

CleanUp()

Cleans up all resources associated with the PlayBin operations, including media handles and decoder buffers.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the PlayBin source. Properly closes media source and disposes of GStreamer elements and decoding resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core GStreamer element wrapper for advanced configuration and monitoring.

public BaseElement GetCore()

Returns

BaseElement

Always null for PlayBin blocks as they use native GStreamer elements directly.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The PlayBin GStreamer element.

IsAvailable()

Determines whether PlayBin support is available on the current system. PlayBin is a core GStreamer element and should always be available with proper GStreamer installation.

public static bool IsAvailable()

Returns

bool

true if PlayBin support is available; otherwise, false.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this PlayBin source, providing access to the parent pipeline and logging context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this PlayBin source.

See Also