Table of Contents

Interface IMediaBlock

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

Main Media Block interface that defines the contract for all media processing blocks in the pipeline system. Media blocks are the fundamental building blocks of media processing pipelines, representing individual processing units such as sources, filters, encoders, decoders, and sinks. Each block can have input and output pads for connecting to other blocks, forming a directed graph of media processing operations.

public interface IMediaBlock : IDisposable

Implements

Extension Methods

Properties

Input

Gets the primary input pad for this media block, if it has a single input. For blocks with multiple inputs, this returns the default or primary input pad. Returns null for source blocks that have no inputs.

MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets an array of all input pads available on this media block. Input pads are connection points where this block can receive media data from other blocks. Source blocks typically return an empty array as they generate data rather than receive it.

MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Name

Gets or sets the unique name identifier for this media block within the pipeline. The name is used for debugging, logging, and referencing the block in pipeline operations. Names should be descriptive and unique within a pipeline to avoid confusion.

string Name { get; set; }

Property Value

string

Output

Gets the primary output pad for this media block, if it has a single output. For blocks with multiple outputs, this returns the default or primary output pad. Returns null for sink blocks that have no outputs.

MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets an array of all output pads available on this media block. Output pads are connection points where this block can send media data to other blocks. Sink blocks typically return an empty array as they consume data rather than produce it.

MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets or sets the type of media block, indicating its primary function in the pipeline. The type determines the block's role (source, filter, encoder, decoder, sink, etc.) and helps in categorizing blocks for pipeline validation and optimization.

MediaBlockType Type { get; set; }

Property Value

MediaBlockType

Methods

GetPipelineContext()

Gets the pipeline context associated with this media block. The pipeline context provides access to shared resources, pipeline state, and coordination mechanisms used by all blocks within the same pipeline instance.

BlockPipelineContext GetPipelineContext()

Returns

BlockPipelineContext

The BlockPipelineContext object containing pipeline-wide state and resources.

ToYAMLBlock()

Converts this media block's configuration to a YAML representation for serialization. This method enables saving and loading pipeline configurations by converting the block's settings and connections into a portable YAML format that can be persisted and restored.

YAMLBlock ToYAMLBlock()

Returns

YAMLBlock

A YAMLBlock object containing the serializable configuration of this media block.