Table of Contents

Class MediaBlockHelper

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

Static helper class providing extension methods for MediaBlock operations. These utility methods simplify common MediaBlock operations by providing convenient access to underlying GStreamer element functionality for state management and event handling.

public static class MediaBlockHelper

Inheritance

Inherited Members

Methods

SendEndOfStream(MediaBlock)

Sends an End-of-Stream (EOS) event to the specified MediaBlock. This convenience method signals that no more data will be processed, causing the block to complete processing.

public static bool SendEndOfStream(this MediaBlock block)

Parameters

block MediaBlock

The MediaBlock that should receive the EOS event.

Returns

bool

True if the EOS event was successfully sent; false if the operation failed.

SendEvent(MediaBlock, Event)

Sends a GStreamer event to the underlying element of the specified MediaBlock. This extension method allows direct event injection for advanced pipeline control and manipulation.

public static bool SendEvent(this MediaBlock block, Event evt)

Parameters

block MediaBlock

The MediaBlock whose underlying element should receive the event.

evt Event

The GStreamer event to send to the element.

Returns

bool

True if the event was successfully sent and processed; false if the block has no element or event sending failed.

SetState(MediaBlock, State)

Sets the GStreamer state of the underlying element for the specified MediaBlock. This extension method provides direct access to GStreamer state management for advanced control.

public static bool SetState(this MediaBlock block, State state)

Parameters

block MediaBlock

The MediaBlock whose underlying element state should be changed.

state State

The target GStreamer state (Null, Ready, Paused, Playing).

Returns

bool

True if the state change was successful; false if the block has no element or state change failed.