Table of Contents

Class CustomTransformBlock

Namespace
VisioForge.Core.MediaBlocks.Special
Assembly
VisioForge.Core.dll

A media block that allows custom transformation with independent input/output caps. Users receive input samples via event and can push output samples when ready.

public class CustomTransformBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

CustomTransformBlock(string, string, bool)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.CustomTransformBlock class.

public CustomTransformBlock(string inputCaps = null, string outputCaps = null, bool passthroughOnEmpty = false)

Parameters

inputCaps string

Optional input caps constraint. If null, any caps will be accepted.

outputCaps string

Optional output caps constraint. If null, any caps will be produced.

passthroughOnEmpty bool

If true, input will be passed through when no output is available.

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.

CreateSample(Buffer, Caps)

Creates a new sample with the specified buffer and caps. This is a helper method for creating samples to push.

public static Sample CreateSample(Buffer buffer, Caps caps)

Parameters

buffer Buffer

The buffer for the sample.

caps Caps

The caps for the sample.

Returns

Sample

A new sample instance.

CreateSample(Buffer, string)

Creates a new sample with the specified buffer using the output caps string. This is a helper method for creating samples to push.

public static Sample CreateSample(Buffer buffer, string capsString)

Parameters

buffer Buffer

The buffer for the sample.

capsString string

The caps string for the sample.

Returns

Sample

A new sample instance.

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.

PushBuffer(Buffer)

Pushes a new buffer to the output with the current output caps.

public void PushBuffer(Buffer buffer)

Parameters

buffer Buffer

The buffer to push to output.

PushSample(Sample)

Pushes a new sample to the output.

public void PushSample(Sample sample)

Parameters

sample Sample

The sample to push to output.

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 transform to uninitialized state.

void IMediaBlockInternals.CleanUp()

IMediaBlockInternals.GetCore()

Retrieves the core BaseElement wrapper for this custom transform.

BaseElement IMediaBlockInternals.GetCore()

Returns

BaseElement

The base element wrapping the custom transform.

IMediaBlockInternals.GetElement()

Retrieves the primary GStreamer element for this custom transform.

Element IMediaBlockInternals.GetElement()

Returns

Element

The GStreamer element performing custom transformation.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this custom transform block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent media blocks pipeline that manages this transform.

OnSampleReceived

This event occurs when a new sample is received on the input.

public event EventHandler<SampleReceivedEventArgs> OnSampleReceived

Event Type

EventHandler<SampleReceivedEventArgs>