Class LiveSyncBlock
- Namespace
- VisioForge.Core.MediaBlocks.Special
- Assembly
- VisioForge.Core.dll
Live stream synchronization block that ensures frames are delivered on time for real-time streaming. The LiveSync block synchronizes live streams by managing frame timing, dropping late frames, and duplicating frames when needed to maintain consistent playback. This is essential for live streaming scenarios where maintaining real-time delivery is critical.
Key features:
- Real-time frame synchronization for live streams
- Automatic dropping of late frames to prevent backlog
- Frame duplication when frames arrive too late
- Maintains consistent playback timing
- Low-latency operation for live streaming
- Suitable for live camera feeds, RTSP streams, and other real-time sources
Common use cases:
- Live camera streaming to ensure real-time delivery
- RTSP stream synchronization for IP cameras
- Live broadcasting to maintain consistent frame timing
- Real-time video conferencing applications
- Live sports or event streaming
- Any scenario requiring strict real-time frame delivery
Technical details:
- Monitors frame timestamps and delivery timing
- Drops frames that arrive too late to maintain real-time playback
- Duplicates previous frame if current frame hasn't arrived yet
- Operates with minimal latency for live scenarios
- Handles format changes and events properly
- Configurable latency and timeout parameters
Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.
public class LiveSyncBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternalsInheritance
Implements
Inherited Members
Extension Methods
Constructors
LiveSyncBlock()
Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.LiveSyncBlock class. The livesync block will use default synchronization settings suitable for most live streaming scenarios.
public LiveSyncBlock()Properties
Input
Gets the input pad for receiving media data.
public override MediaBlockPad Input { get; }Property Value
Inputs
Gets the array of input pads. This block has a single input.
public override MediaBlockPad[] Inputs { get; }Property Value
Output
Gets the output pad that provides synchronized media data.
public override MediaBlockPad Output { get; }Property Value
Outputs
Gets the array of output pads. This block has a single output.
public override MediaBlockPad[] Outputs { get; }Property Value
Type
Gets the media block type identifier for this livesync block.
public override MediaBlockType Type { get; }Property Value
Methods
Build()
Builds and initializes the livesync block within the media pipeline. Creates the synchronization element and establishes pad connections. This method is called automatically during pipeline construction.
public override bool Build()Returns
- bool
-
trueif the livesync block was successfully built;falseif initialization failed.
CleanUp()
Performs cleanup of the livesync resources. Releases the GStreamer element and clears buffered data.
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 the livesync.
public BaseElement GetCore()Returns
- BaseElement
-
The BaseElement instance wrapping the livesync element.
GetElement()
Gets the underlying GStreamer livesync element.
public Element GetElement()Returns
- Element
-
The native GStreamer livesync element.
IsAvailable()
Determines whether the livesync functionality is available in the current environment. This requires the livesync GStreamer element to be available.
public static bool IsAvailable()Returns
- bool
-
trueif livesync element is available; otherwise,false.
IMediaBlockInternals.SetContext(MediaBlocksPipeline)
Sets the media pipeline context for this livesync block. This internal method establishes the connection to the parent pipeline.
void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)Parameters
pipelineMediaBlocksPipeline-
The parent MediaBlocksPipeline that contains this block.