Class DataProcessorBlock
- Namespace
- VisioForge.Core.MediaBlocks.Special
- Assembly
- VisioForge.Core.dll
A media block that allows custom in-place processing of audio/video buffers. Inherit from this class and override the ProcessBuffer method to implement custom processing logic.
public class DataProcessorBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
DataProcessorBlock(string)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.DataProcessorBlock class.
public DataProcessorBlock(string caps = null)Parameters
capsstring-
Optional caps constraint for both input and output. If null, default caps will be used.
Properties
Input
Gets the input.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the inputs.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the outputs.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the type.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds the media block.
public override bool Build()Returns
- bool
-
trueif successful,falseotherwise.
Dispose(bool)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
True if disposing, false if finalizing.
ProcessBuffer(Buffer, Caps)
Virtual method for processing buffer data. Override this method to implement custom buffer processing. This method performs in-place processing - the buffer is modified directly.
protected virtual FlowReturn ProcessBuffer(Buffer buffer, Caps caps)Parameters
bufferBuffer-
The buffer to process in-place
capsCaps-
The negotiated caps for this buffer
Returns
- FlowReturn
-
FlowReturn indicating success or failure
IMediaBlockInternals.Build()
Builds the media block by creating and initializing the underlying GStreamer elements.
bool IMediaBlockInternals.Build()Returns
- bool
-
True if the block was successfully built; false if construction failed.
IMediaBlockInternals.CleanUp()
Performs cleanup of resources and resets the processor to uninitialized state.
void IMediaBlockInternals.CleanUp()IMediaBlockInternals.GetCore()
Retrieves the core BaseElement wrapper for this data processor.
BaseElement IMediaBlockInternals.GetCore()Returns
- BaseElement
-
The base element wrapping the data processor.
IMediaBlockInternals.GetElement()
Retrieves the primary GStreamer element for this data processor.
Element IMediaBlockInternals.GetElement()Returns
- Element
-
The GStreamer element performing data processing.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this data processor block.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent media blocks pipeline that manages this processor.
OnBuffer
Gets or sets the event handler for buffer processing. This event is fired for each buffer if ProcessBuffer is not overridden.
public event EventHandler<BufferEventArgs> OnBuffer