Table of Contents

Class VideoMixerSourceBlock

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

Video mixer source block for combining multiple video sources into a single composite output. Provides real-time video mixing with positioning, scaling, alpha blending, and chroma key support for creating picture-in-picture effects, video walls, live production, and multi-stream compositing using CPU, OpenGL, or D3D11 acceleration. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class VideoMixerSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IVideoMixerControl, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

VideoMixerSourceBlock(MediaBlocksPipeline, VideoMixerSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.VideoMixerSourceBlock class with custom mixer settings. Configures the video mixer with multiple sources, positions, and optional chroma key effects.

public VideoMixerSourceBlock(MediaBlocksPipeline pipeline, VideoMixerSourceSettings settings)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocks pipeline that will contain this mixer source.

settings VideoMixerSourceSettings

The video mixer settings specifying sources, layout, and rendering options.

Properties

Input

Gets the primary input pad (none for source blocks that generate composite video).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

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

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad for the mixed composite video stream.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (single composite video output).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets the video mixer source configuration settings that control mixing behavior and source setup.

public VideoMixerSourceSettings Settings { get; }

Property Value

VideoMixerSourceSettings

Type

Gets the media block type identifier for video mixer source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the video mixer source within the pipeline context. Creates all video sources, configures the mixer, and establishes connections for composite output.

public override bool Build()

Returns

bool

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

CleanUp()

Cleans up all resources associated with the video mixer operations, including sources and compositing resources.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the video mixer source. Properly disposes of all video sources, the mixer, and associated rendering 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 composite source blocks that manage multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

Always null for composite blocks that contain multiple managed sources.

Input_Get(Guid)

Gets a specific input stream configuration by its unique identifier.

public VideoMixerStream Input_Get(Guid id)

Parameters

id Guid

The GUID identifier of the input stream to retrieve.

Returns

VideoMixerStream

The VideoMixerStream containing position, size, and effects for the specified input.

Input_List()

Gets the configuration of all input streams in the video mixer.

public VideoMixerStream[] Input_List()

Returns

VideoMixerStream[]

An array of VideoMixerStream objects containing position, size, and effects for each input.

Input_Move(Guid, Rect, TimeSpan, double?, double?)

Animates an input stream to a new position and size with optional alpha fade.

public void Input_Move(Guid id, Rect rect, TimeSpan duration, double? startAlpha, double? endAlpha)

Parameters

id Guid

The GUID identifier of the input stream to move.

rect Rect

The target rectangle defining new position and size.

duration TimeSpan

The duration of the animation transition.

startAlpha double?

The starting alpha transparency value (0.0-1.0) for fade effects.

endAlpha double?

The ending alpha transparency value (0.0-1.0) for fade effects.

Input_SetChromaKeyEnabled(Guid, bool)

Enables or disables chroma key (green screen) effect for a specific input stream.

public void Input_SetChromaKeyEnabled(Guid id, bool enabled)

Parameters

id Guid

The GUID identifier of the input stream to modify.

enabled bool

If set to true, enables chroma key; otherwise, disables it.

Input_Update(VideoMixerStream)

Updates the configuration of a specific input stream including position, size, and effects.

public void Input_Update(VideoMixerStream stream)

Parameters

stream VideoMixerStream

The VideoMixerStream containing updated configuration for the input.

Input_UpdateChromaKeySettings(Guid, ChromaKeySettingsX)

Updates the chroma key (green screen) settings for a specific input stream.

public void Input_UpdateChromaKeySettings(Guid id, ChromaKeySettingsX settings)

Parameters

id Guid

The GUID identifier of the input stream to update.

settings ChromaKeySettingsX

The new chroma key settings including color range and tolerance values.

IsAvailable()

Determines whether video mixer support is available on the current system. Requires GStreamer compositor or GL video mixer plugins depending on the selected rendering mode.

public static bool IsAvailable()

Returns

bool

true if video mixer support is available; otherwise, false.

SetSettings(VideoMixerBaseSettings)

Updates the video mixer configuration settings including output resolution and rendering mode.

public void SetSettings(VideoMixerBaseSettings settings)

Parameters

settings VideoMixerBaseSettings

The new video mixer base settings to apply to the mixer.

StartFadeIn(Guid, TimeSpan)

Starts a fade-in animation for a specific input stream from transparent to opaque.

public void StartFadeIn(Guid id, TimeSpan duration)

Parameters

id Guid

The GUID identifier of the input stream to fade in.

duration TimeSpan

The duration of the fade-in animation.

StartFadeOut(Guid, TimeSpan)

Starts a fade-out animation for a specific input stream from opaque to transparent.

public void StartFadeOut(Guid id, TimeSpan duration)

Parameters

id Guid

The GUID identifier of the input stream to fade out.

duration TimeSpan

The duration of the fade-out animation.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

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

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocks pipeline containing this video mixer source.

See Also