Class AnimatedGIFSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Animated GIF source block for playing animated GIF files as video streams. Provides seamless playback of animated GIF images with frame timing preservation for visual effects, animated overlays, and dynamic content in video productions with automatic looping and frame interpolation support. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals
public class AnimatedGIFSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
AnimatedGIFSourceBlock(ImageVideoSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.AnimatedGIFSourceBlock class with custom playback settings. Configures the animated GIF source for seamless animation playback with specified parameters.
public AnimatedGIFSourceBlock(ImageVideoSourceSettings settings)Parameters
settingsImageVideoSourceSettings-
The image video settings controlling GIF file path, loop behavior, and playback parameters.
Properties
Context
Gets or sets the logging and error reporting context for this block.
public ContextX Context { get; set; }Property Value
- ContextX
Input
Gets the primary input pad (none for source blocks that read from files).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Name
Gets or sets the user-friendly name of this animated GIF source block.
public string Name { get; set; }Property Value
Output
Gets the primary video output pad for the animated GIF frames.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single video output for GIF).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the image video source configuration settings that control GIF playback parameters.
public ImageVideoSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for animated GIF source operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the animated GIF source within the pipeline context. Creates GIF decoder, configures animation playback, and prepares video output for downstream processing.
public override bool Build()Returns
- bool
-
trueif the animated GIF source was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the animated GIF operations, including decoder and animation buffers.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the animated GIF source. Properly stops animation playback and disposes of GStreamer elements and image buffers.
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
-
The AnimatedGIFSource element providing access to GIF decoding operations.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
The animated GIF source GStreamer element.
GetPad(MediaBlockPadDirection, MediaBlockPadMediaType)
Gets a specific media block pad by direction and media type.
public MediaBlockPad GetPad(MediaBlockPadDirection direction, MediaBlockPadMediaType type)Parameters
directionMediaBlockPadDirection-
The direction of the pad (input or output).
typeMediaBlockPadMediaType-
The media type of the pad (video, audio, or auto).
Returns
- MediaBlockPad
-
The matching MediaBlockPad if found; otherwise, null.
GetPads()
Gets all media block pads available on this animated GIF source.
public MediaBlockPad[] GetPads()Returns
- MediaBlockPad[]
-
An array containing the single video output pad for animated GIF frames.
IsAvailable()
Determines whether animated GIF support is available on the current system. Requires GStreamer GIF decoder plugins to be installed and functional.
public static bool IsAvailable()Returns
- bool
-
trueif animated GIF support is available; otherwise,false.
Stop()
Stops the animated GIF playback and halts frame generation.
public override bool Stop()Returns
- bool
-
trueif the animation was successfully stopped; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this animated GIF source, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this animated GIF source.