Table of Contents

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, IMediaBlockInternals

Inheritance

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

caps string

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

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()

Builds the media block.

public override bool Build()

Returns

bool

true if successful, false otherwise.

Dispose(bool)

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

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

buffer Buffer

The buffer to process in-place

caps Caps

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

pipeline MediaBlocksPipeline

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

Event Type

EventHandler<BufferEventArgs>