Class PushVideoSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Push video source block for programmatic video frame injection into the pipeline. Provides real-time video streaming from application-generated or externally-sourced video frames for custom video sources, frame processing pipelines, video synthesis, and integration with external video APIs or capture devices. Implements the VisioForge.Core.MediaBlocks.Sources.SourceMediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class PushVideoSourceBlock : SourceMediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
PushVideoSourceBlock(PushVideoSourceSettings)
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.PushVideoSourceBlock class with custom video settings. Configures the push video source for real-time frame injection with specified format parameters.
public PushVideoSourceBlock(PushVideoSourceSettings settings)Parameters
settingsPushVideoSourceSettings-
The push video settings controlling resolution, pixel 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 video output pad for the pushed video stream.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets all output pads available on this block (single video output).
public override MediaBlockPad[] Outputs { get; }Property Value
Settings
Gets or sets the push video configuration settings that control video format and buffering.
public PushVideoSourceSettings Settings { get; set; }Property Value
Type
Gets the media block type identifier for push video source operations.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the push video source within the pipeline context. Creates frame injection pipeline, configures format conversion, and prepares video output for downstream processing.
public override bool Build()Returns
- bool
-
trueif the push video source was successfully built and configured; otherwise,false.
CleanUp()
Cleans up all resources associated with the push video operations, including frame buffers and video converters.
public void CleanUp()ClearQueue()
Clears all pending video frames from the internal buffer queue.
public void ClearQueue()Dispose(bool)
Releases unmanaged and managed resources used by the push video source. Properly stops frame injection and disposes of GStreamer elements and video buffers.
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 video source GStreamer element.
IsAvailable()
Determines whether push video support is available on the current system. Requires GStreamer appsrc plugin to be installed for video frame injection.
public static bool IsAvailable()Returns
- bool
-
trueif push video support is available; otherwise,false.
PushFrame(VideoFrameX)
Pushes a video frame into the pipeline for real-time processing.
public void PushFrame(VideoFrameX frame)Parameters
frameVideoFrameX-
The VideoFrameX containing pixel data with format and timing information to inject into the pipeline.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context for this push video source, providing access to the parent pipeline and logging context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocks pipeline containing this push video source.