Table of Contents

Class GLVideoMixerBlock

Namespace
VisioForge.Core.MediaBlocks.OpenGL
Assembly
VisioForge.Core.dll

OpenGL-accelerated video mixer block for high-performance multi-stream video compositing and blending. Provides GPU-accelerated video mixing capabilities with multiple input streams, real-time positioning, scaling, rotation, alpha blending, chroma key effects, and advanced compositing operations for live streaming and video production. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class GLVideoMixerBlock : MediaBlock, IMediaBlock, IDisposable, IVideoMixerControl, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

GLVideoMixerBlock(GLVideoMixerSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenGL.GLVideoMixerBlock class with the specified mixer settings. Creates the necessary input and output pads for multi-stream video compositing with GPU-accelerated blending.

public GLVideoMixerBlock(GLVideoMixerSettings settings)

Parameters

settings GLVideoMixerSettings

The video mixer settings that define the stream configuration and compositing parameters.

Properties

Input

Gets the primary input pad (first of multiple mixer inputs).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (multiple inputs for video mixing).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad for providing the composited video result.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

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

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the video mixer settings that control compositing behavior, stream configurations, and blending parameters.

public GLVideoMixerSettings Settings { get; set; }

Property Value

GLVideoMixerSettings

Type

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

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the OpenGL video mixer block within the pipeline context. Creates the GStreamer video mixer element, configures multiple input streams, applies the mixer settings, and establishes the necessary pad connections for multi-stream video compositing with GPU acceleration.

public override bool Build()

Returns

bool

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

CleanUp()

Cleans up all resources associated with the OpenGL video mixer operations, including GStreamer elements and GPU shader programs.

public void CleanUp()

Dispose(bool)

Releases unmanaged and managed resources used by the OpenGL video mixer block. Properly disposes of GStreamer elements and GPU compositing 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

The BaseElement wrapper providing access to the underlying GStreamer video mixer.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The native Gst.Element representing the OpenGL video mixer filter.

Input_Get(Guid)

Gets the video mixer input stream configuration by its unique identifier.

public VideoMixerStream Input_Get(Guid id)

Parameters

id Guid

The unique GUID identifier for the input stream.

Returns

VideoMixerStream

The VideoMixerStream configuration for the specified input stream.

Input_List()

Gets all configured input stream configurations for the video mixer.

public VideoMixerStream[] Input_List()

Returns

VideoMixerStream[]

An array of VideoMixerStream configurations for all input streams.

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

Animates the position and opacity of a specific input stream over time with smooth transitions.

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

Parameters

id Guid

The unique GUID identifier for the input stream to animate.

rect Rect

The target rectangle position and size for the animation.

duration TimeSpan

The duration of the animation transition.

startAlpha double?

The starting alpha opacity value (optional, null to use current).

endAlpha double?

The ending alpha opacity value (optional, null to use current).

Input_SetChromaKeyEnabled(Guid, bool)

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

public void Input_SetChromaKeyEnabled(Guid id, bool enabled)

Parameters

id Guid

The unique GUID identifier for the input stream to modify.

enabled bool

True to enable chroma key transparency, false to disable.

Input_Update(VideoMixerStream)

Updates the configuration of a specific input stream with new positioning, scaling, and blending parameters.

public void Input_Update(VideoMixerStream stream)

Parameters

stream VideoMixerStream

The VideoMixerStream configuration with updated parameters for the input stream.

Input_UpdateChromaKeySettings(Guid, ChromaKeySettingsX)

Updates the chroma key (green screen) settings for a specific input stream, configuring color-based transparency.

public void Input_UpdateChromaKeySettings(Guid id, ChromaKeySettingsX settings)

Parameters

id Guid

The unique GUID identifier for the input stream to update.

settings ChromaKeySettingsX

The new chroma key settings defining the color range and transparency parameters.

IsAvailable()

Determines whether OpenGL video mixer functionality is available on the current system. Requires OpenGL support and appropriate GStreamer OpenGL video compositing plugins to be installed.

public static bool IsAvailable()

Returns

bool

true if video mixing operations are supported; otherwise, false.

SetSettings(VideoMixerBaseSettings)

Updates the video mixer settings with new configuration parameters for compositing behavior.

public void SetSettings(VideoMixerBaseSettings settings)

Parameters

settings VideoMixerBaseSettings

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

StartFadeIn(Guid, TimeSpan)

Starts a fade-in animation for a specific input stream, gradually increasing opacity from transparent to opaque.

public void StartFadeIn(Guid id, TimeSpan duration)

Parameters

id Guid

The unique GUID identifier for 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, gradually decreasing opacity from opaque to transparent.

public void StartFadeOut(Guid id, TimeSpan duration)

Parameters

id Guid

The unique GUID identifier for the input stream to fade out.

duration TimeSpan

The duration of the fade-out animation.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the pipeline context for this OpenGL video mixer block, 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 block.

See Also