Class GLShaderBlock
- Namespace
- VisioForge.Core.MediaBlocks.OpenGL
- Assembly
- VisioForge.Core.dll
OpenGL-accelerated programmable shader block for custom GPU-based video processing and effects. Provides high-performance custom shader execution capabilities using GLSL vertex and fragment shaders to create custom visual effects, color transformations, and advanced video processing operations with full GPU acceleration. Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class GLShaderBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
GLShaderBlock(GLShaderSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.OpenGL.GLShaderBlock class with the specified shader settings. Creates the necessary input and output pads for video processing with custom GLSL shader programs.
public GLShaderBlock(GLShaderSettings settings)Parameters
settingsGLShaderSettings-
The shader settings that define the GLSL source code and execution parameters.
Properties
Input
Gets the primary input pad for receiving video frames to be shader processed.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets all input pads available on this block (single input for video processing).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad for providing shader-processed video frames.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single output for processed video).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the shader settings that control GLSL shader programs, uniforms, and rendering parameters.
public GLShaderSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for OpenGL shader operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the OpenGL shader block within the pipeline context. Creates the GStreamer shader filter, compiles the GLSL shader programs, applies the shader settings, and establishes the necessary pad connections for processing video frames with custom GPU shaders.
public override bool Build()Returns
- bool
-
trueif the shader block was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the OpenGL shader operations, including GStreamer elements and compiled GPU shader programs.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources used by the OpenGL shader block. Properly disposes of GStreamer elements and GPU shader program 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
-
The BaseElement wrapper providing access to the underlying GStreamer shader filter.
GetElement()
Gets the native GStreamer element for direct GStreamer pipeline integration.
public Element GetElement()Returns
- Element
-
The native Gst.Element representing the custom shader filter.
IsAvailable()
Determines whether OpenGL shader functionality is available on the current system. Requires OpenGL support and appropriate GStreamer OpenGL shader execution plugins to be installed.
public static bool IsAvailable()Returns
- bool
-
trueif custom shader operations are supported; otherwise,false.
Update()
Updates the shader programs and uniform variables with the current settings. Recompiles and reloads GLSL shader code and applies new uniform variable values for dynamic shader effects.
public void Update()IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this OpenGL shader block, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this shader block.