Table of Contents

Class VideoEffectsBlock

Namespace
VisioForge.Core.MediaBlocks.VideoProcessing
Assembly
VisioForge.Core.dll

Video effects block for dynamic effect chain management and real-time effect processing. This block provides a flexible framework for applying multiple video effects in sequence, with support for dynamic addition, removal, and modification of effects during playback. Features include automatic effect chaining, runtime parameter updates, intelligent pipeline management, and support for all major effect types (color correction, geometric transforms, overlays, filters). Essential for video editing applications, live streaming with effects, post-production workflows, and any scenario requiring complex, dynamic video effect chains. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class VideoEffectsBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

VideoEffectsBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.VideoEffectsBlock class with an empty effects chain ready for dynamic effect management.

public VideoEffectsBlock()

Properties

Input

Gets the input.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the inputs.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the outputs.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the type.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

VideoEffectsCount

Gets the current number of active video effects in the processing chain.

public int VideoEffectsCount { get; }

Property Value

int

Methods

AddOrUpdateAsync(IBaseVideoEffect)

Adds a new video effect or updates an existing effect in the processing chain. Supports dynamic effect modification during playback with automatic pipeline reconfiguration.

public Task AddOrUpdateAsync(IBaseVideoEffect effect)

Parameters

effect IBaseVideoEffect

The video effect to add or update.

Returns

Task

A Task representing the asynchronous operation.

Build()

Constructs and initializes the video effects processing chain. This method creates the video converter, effects processor, and connects all effects in the specified order, establishing proper pad connections and pipeline integration.

public override bool Build()

Returns

bool

true if the effects chain was successfully built and configured; false if initialization failed.

CleanUp()

Releases all resources and performs cleanup operations for this video effects block. This method disposes of the effects processor and video converter elements.

public void CleanUp()

Clear()

Removes all video effects from the processing chain. Restores the pipeline to pass-through mode.

public void Clear()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

Get(string)

Gets a video effect interface by its unique name. Enables direct access to specific effects for parameter updates.

public IBaseVideoEffect Get(string name)

Parameters

name string

The unique effect name used during creation.

Returns

IBaseVideoEffect

The VisioForge.Core.Types.X.VideoEffects.IBaseVideoEffect instance if found; otherwise, null.

GetByID(VideoEffectID)

Gets a video effect interface by its effect type ID. Finds the first effect with the specified ID regardless of its name. Useful for finding effects like ResizeVideoEffect that may have custom names.

public IBaseVideoEffect GetByID(VideoEffectID id)

Parameters

id VideoEffectID

The video effect type identifier to search for.

Returns

IBaseVideoEffect

The first VisioForge.Core.Types.X.VideoEffects.IBaseVideoEffect instance with the matching ID if found; otherwise, null.

GetCore()

Gets the core BaseElement wrapper. Returns null as this is a composite block.

public BaseElement GetCore()

Returns

BaseElement

Always returns null for this composite effect block.

GetElement()

Gets the underlying GStreamer element. Returns null as this is a composite block.

public Element GetElement()

Returns

Element

Always returns null for this composite effect block.

IsAvailable()

Determines whether this media block is available. Correct NuGet SDK redist should be included into your project.

public static bool IsAvailable()

Returns

bool

true if this media block is available; otherwise, false.

Remove(IBaseVideoEffect)

Removes a video effect from the processing chain. Automatically reconfigures the pipeline to maintain continuity.

public void Remove(IBaseVideoEffect effect)

Parameters

effect IBaseVideoEffect

The video effect to remove.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this video effects block with a pipeline and initializes its internal context. This method is called internally when the block is added to a pipeline.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The MediaBlocksPipeline instance that will manage this block.

See Also