Table of Contents

Class SqueezebackBlock

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

Squeezeback effect block for picture-in-picture and video transition effects. This Windows-specific block creates a squeezeback effect by combining video padding and image overlay to create sophisticated picture-in-picture layouts and transitions. Features include dynamic resizing, alpha blending, fade effects, and animated positioning. The block composites a background image with a video stream that can be dynamically positioned and scaled. Essential for broadcast production, video transitions, news tickers, and professional video layouts requiring animated picture-in-picture effects. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class SqueezebackBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

SqueezebackBlock(MediaBlocksPipeline, VideoFrameInfoX, ImageOverlaySettings, Rect)

Initializes a new instance of the VisioForge.Core.MediaBlocks.VideoProcessing.SqueezebackBlock class with specified pipeline, video information, and overlay settings.

public SqueezebackBlock(MediaBlocksPipeline pipeline, VideoFrameInfoX videoInfo, ImageOverlaySettings imageSettings, Rect videoRect)

Parameters

pipeline MediaBlocksPipeline

The media blocks pipeline that will contain this block.

videoInfo VideoFrameInfoX

The video frame information including dimensions and format.

imageSettings ImageOverlaySettings

The background image overlay settings.

videoRect Rect

The rectangle defining video position within the layout.

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

Methods

Build()

Constructs and initializes the squeezeback effect components. This method sets up the internal padding changer and image overlay blocks but performs no additional initialization as components are pre-built.

public override bool Build()

Returns

bool

Always returns true as components are pre-configured.

CleanUp()

Resets this squeezeback block to a re-buildable state after the pipeline is stopped.

public void CleanUp()

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.

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 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 block.

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

Animates the video position and opacity within the squeezeback layout.

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

Parameters

rect Rect

The target rectangle for the video position and size.

duration TimeSpan

The duration of the animation.

startAlpha double?

Optional starting opacity value (0.0-1.0).

endAlpha double?

Optional ending opacity value (0.0-1.0).

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.

StartFadeIn(TimeSpan)

Starts a fade-in animation on the background image overlay.

public void StartFadeIn(TimeSpan duration)

Parameters

duration TimeSpan

The duration of the fade-in effect.

StartFadeOut(TimeSpan)

Starts a fade-out animation on the background image overlay.

public void StartFadeOut(TimeSpan duration)

Parameters

duration TimeSpan

The duration of the fade-out effect.

Update()

Updates the image overlay settings and refreshes the visual composition. Call this method after modifying image settings to apply changes.

public void Update()

UpdateImage(string, Rect)

Updates the background image and sets a transparent cutout region for the video area. The source image is composited with an alpha-transparent hole punched at videoRect so the underlying video is visible through that region.

public void UpdateImage(string filename, Rect videoRect)

Parameters

filename string

Path to the source image file to use as the background overlay.

videoRect Rect

Rectangle within the background image that will be made fully transparent.

UpdateImageAlpha(double)

Updates the opacity of the background image overlay.

public void UpdateImageAlpha(double alpha)

Parameters

alpha double

The new alpha value (0.0-1.0) for the background image.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Associates this squeezeback 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