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, IMediaBlockInternalsInheritance
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
pipelineMediaBlocksPipeline-
The MediaBlocks pipeline that will contain this mixer source.
settingsVideoMixerSourceSettings-
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
Inputs
Gets all input pads available on this block (none for composite source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad for the mixed composite video stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single composite video output).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets the video mixer source configuration settings that control mixing behavior and source setup.
public VideoMixerSourceSettings Settings { get; }Property Value
Type
Gets the media block type identifier for video mixer source operations.
public override MediaBlockType Type { get; }Property Value
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
-
trueif 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
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 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
idGuid-
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
idGuid-
The GUID identifier of the input stream to move.
rectRect-
The target rectangle defining new position and size.
durationTimeSpan-
The duration of the animation transition.
startAlphadouble?-
The starting alpha transparency value (0.0-1.0) for fade effects.
endAlphadouble?-
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
idGuid-
The GUID identifier of the input stream to modify.
enabledbool-
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
streamVideoMixerStream-
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
idGuid-
The GUID identifier of the input stream to update.
settingsChromaKeySettingsX-
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
-
trueif 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
settingsVideoMixerBaseSettings-
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
idGuid-
The GUID identifier of the input stream to fade in.
durationTimeSpan-
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
idGuid-
The GUID identifier of the input stream to fade out.
durationTimeSpan-
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
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this video mixer source.