Table of Contents

Class CustomColorspaceXBlock

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

A media block that converts RGB video frames to YV12 format. This block uses a custom GStreamer plugin that implements RGB to Y'CbCr conversion with 4:2:0 chroma subsampling in C#.

public class CustomColorspaceXBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

CustomColorspaceXBlock()

Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.CustomColorspaceXBlock class. Converts RGB video to YV12 format.

public CustomColorspaceXBlock()

CustomColorspaceXBlock(int, int, string)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.CustomColorspaceXBlock class with specified dimensions.

public CustomColorspaceXBlock(int width, int height, string frameRate = null)

Parameters

width int

The video width (must be even).

height int

The video height (must be even).

frameRate string

Optional frame rate (e.g., "30/1").

Properties

FrameRate

Gets or sets the frame rate (e.g., "30/1" for 30 fps). Optional - if not set, will be negotiated automatically.

public string FrameRate { get; set; }

Property Value

string

Height

Gets or sets the video height. Optional - if not set, will be negotiated automatically. Must be even for YV12 format.

public int? Height { get; set; }

Property Value

int?

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

Width

Gets or sets the video width. Optional - if not set, will be negotiated automatically. Must be even for YV12 format.

public int? Width { get; set; }

Property Value

int?

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.

GetInputCaps()

Gets the input caps string for RGB format.

public string GetInputCaps()

Returns

string

The input caps string.

GetOutputCaps()

Gets the output caps string for YV12 format.

public string GetOutputCaps()

Returns

string

The output caps string.

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

void IMediaBlockInternals.CleanUp()

IMediaBlockInternals.GetCore()

Retrieves the core BaseElement wrapper for this colorspace converter.

BaseElement IMediaBlockInternals.GetCore()

Returns

BaseElement

The base element wrapping the colorspace converter.

IMediaBlockInternals.GetElement()

Retrieves the primary GStreamer element for this colorspace converter.

Element IMediaBlockInternals.GetElement()

Returns

Element

The GStreamer element performing colorspace conversion.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this colorspace converter block.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent media blocks pipeline that manages this converter.