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, IMediaBlockInternalsInheritance
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
settingsIPushSourceSettings-
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
Inputs
Gets all input pads available on this block (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the primary output pad for the pushed data stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single output).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the push source configuration settings that control data format and buffering.
public IPushSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for push source operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds this instance.
public override bool Build()Returns
- bool
-
trueif successfull,falseotherwise.
CleanUp()
Cleans up.
public void CleanUp()Dispose(bool)
Releases unmanaged and - optionally - managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool-
trueto release both managed and unmanaged resources;falseto 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
-
trueif 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
databyte[]-
The data.
dataSizeint-
Size of the data.
ptsTimeSpan?-
The PTS.
durationTimeSpan?-
The duration.
PushFrame(AudioFrame)
Pushes the frame.
public void PushFrame(AudioFrame frame)Parameters
frameAudioFrame-
The frame.
PushFrame(VideoFrameX)
Pushes the frame.
public void PushFrame(VideoFrameX frame)Parameters
frameVideoFrameX-
The frame.
SendEOS()
Sends the End-of-Stream.
public bool SendEOS()Returns
- bool
-
trueif successful,falseotherwise.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The pipeline.