Table of Contents

Class PushSourceBlock

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

Push source block for generic programmatic data injection into the pipeline. Provides flexible real-time streaming from application-generated data including video frames, audio samples, or raw data for custom media sources, live processing pipelines, and integration with external data sources or hardware devices. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class PushSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

PushSourceBlock(IPushSourceSettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.PushSourceBlock class with custom push settings. Configures the push source for real-time data injection with appropriate media type detection.

public PushSourceBlock(IPushSourceSettings settings)

Parameters

settings IPushSourceSettings

The push source settings controlling data format and buffering parameters.

Properties

Input

Gets the primary input pad (none for source blocks that receive pushed data).

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets all input pads available on this block (none for source blocks).

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the primary output pad for the pushed data stream.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets all output pads available on this block (single output).

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Settings

Gets or sets the push source configuration settings that control data format and buffering.

public IPushSourceSettings Settings { get; set; }

Property Value

IPushSourceSettings

Type

Gets the media block type identifier for push source operations.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds this instance.

public override bool Build()

Returns

bool

true if successfull, false otherwise.

CleanUp()

Cleans up.

public void CleanUp()

Dispose(bool)

Releases unmanaged and - optionally - managed resources.

protected override void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

GetCore()

Gets the core GStreamer element wrapper for advanced configuration and monitoring.

public BaseElement GetCore()

Returns

BaseElement

Always null for composite source blocks with multiple internal elements.

GetElement()

Gets the native GStreamer element for direct GStreamer pipeline integration.

public Element GetElement()

Returns

Element

The push source GStreamer element.

IsAvailable()

Determines whether push source support is available on the current system. Requires GStreamer appsrc plugin to be installed for data injection.

public static bool IsAvailable()

Returns

bool

true if push source support is available; otherwise, false.

PushData(byte[], int, TimeSpan?, TimeSpan?)

Pushes the data.

public void PushData(byte[] data, int dataSize, TimeSpan? pts = null, TimeSpan? duration = null)

Parameters

data byte[]

The data.

dataSize int

Size of the data.

pts TimeSpan?

The PTS.

duration TimeSpan?

The duration.

PushFrame(AudioFrame)

Pushes the frame.

public void PushFrame(AudioFrame frame)

Parameters

frame AudioFrame

The frame.

PushFrame(VideoFrameX)

Pushes the frame.

public void PushFrame(VideoFrameX frame)

Parameters

frame VideoFrameX

The frame.

SendEOS()

Sends the End-of-Stream.

public bool SendEOS()

Returns

bool

true if successful, false otherwise.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the context.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The pipeline.

See Also