Class H264PushSourceBlock
- Namespace
- VisioForge.Core.MediaBlocks.Sources
- Assembly
- VisioForge.Core.dll
Pushes H264 encoded byte-stream data into a pipeline for decoding. Connect output to H264ParseBlock -> H264DecoderBlock -> VideoRenderer. Automatically converts AVC (length-prefixed) format to Annex B byte-stream. Rebases PTS timestamps relative to the first frame for proper pipeline clock alignment.
public class H264PushSourceBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
H264PushSourceBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.Sources.H264PushSourceBlock class.
public H264PushSourceBlock()Properties
DoTimestamp
Gets or sets whether appsrc should auto-generate timestamps using the pipeline clock. When true, PTS from PushData is ignored and appsrc stamps buffers with current pipeline time. This gives lowest display latency but breaks A/V sync if audio is added. When false (default), the PTS provided to PushData is used (rebased to pipeline time). Must be set before Build() / pipeline start.
public bool DoTimestamp { get; set; }Property Value
Input
Gets the input pad (none for source blocks).
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the input pads (none for source blocks).
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the output pads.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the type of the media block.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds the block, creating GStreamer elements.
public override bool Build()Returns
CleanUp()
Cleans up resources.
public void CleanUp()Dispose(bool)
Releases unmanaged and managed resources.
protected override void Dispose(bool disposing)Parameters
disposingbool
GetCore()
Gets the core BaseElement wrapper (not used).
public BaseElement GetCore()Returns
- BaseElement
GetElement()
Gets the underlying GStreamer element.
public Element GetElement()Returns
- Element
IsAvailable()
Determines whether this element is available.
public static bool IsAvailable()Returns
PushData(byte[], int, TimeSpan)
Push H264 encoded data into the pipeline with timestamp. Automatically converts AVC (length-prefixed) format to byte-stream (Annex B start codes). PTS is rebased relative to the first frame to align with the pipeline clock.
public FlowReturn PushData(byte[] data, int length, TimeSpan timestamp)Parameters
databyte[]-
H264 data (AVC length-prefixed or byte-stream).
lengthint-
Length of data to push.
timestampTimeSpan-
Presentation timestamp.
Returns
- FlowReturn
-
GStreamer FlowReturn status.
PushData(byte[], int)
Push H264 encoded data into the pipeline (no timestamp).
public FlowReturn PushData(byte[] data, int length)Parameters
Returns
- FlowReturn
-
GStreamer FlowReturn status.
SendEOS()
Signal end of stream.
public FlowReturn SendEOS()Returns
- FlowReturn
-
GStreamer FlowReturn status.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the pipeline context.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline