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, IMediaBlockInternalsInheritance
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
settingsUniversalSourceSettings-
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
Input
Gets the primary input pad (none for source blocks that read from URIs).
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 PlayBin).
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (dynamic based on enabled streams).
public override MediaBlockPad[] Outputs { 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 PlayBin 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 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
-
trueif 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
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
-
trueif 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
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this PlayBin source.