Table of Contents

Class DebugTimestampBlock

Namespace
VisioForge.Core.MediaBlocks.Special
Assembly
VisioForge.Core.dll

A debugging utility block that logs and optionally overlays timestamp information on media streams. This block intercepts media frames to display Decode Time Stamp (DTS) and Presentation Time Stamp (PTS) values, which are crucial for diagnosing synchronization and timing issues in media pipelines.

Key features:

  • Logs DTS and PTS values to the debug console with custom labels
  • Optional visual overlay of timestamp information on video frames
  • Passthrough design with minimal performance impact
  • Configurable logger name for identifying different streams
  • Support for any media type (video, audio, etc.)
  • Platform-specific availability (not available on iOS)

Common use cases:

  • Debugging A/V synchronization issues
  • Analyzing timestamp discontinuities in streams
  • Verifying proper timestamp generation in encoders
  • Troubleshooting playback timing problems
  • Educational visualization of media timing concepts
  • Quality assurance for streaming applications

Technical details:

  • DTS represents when a frame should be decoded
  • PTS represents when a frame should be presented
  • Can combine with TextOverlay for visual timestamp display
  • Timestamps are logged in nanoseconds (GStreamer format)
  • Useful for identifying timestamp gaps or jumps

Implements the VisioForge.Core.MediaBlocks.MediaBlock. Implements the VisioForge.Core.MediaBlocks.IMediaBlockInternals. Implements the IDisposable.

public class DebugTimestampBlock : MediaBlock, IMediaBlock, IDisposable, IMediaBlockInternals

Inheritance

Implements

Inherited Members

Extension Methods

Constructors

DebugTimestampBlock(string, TextOverlaySettings)

Initializes a new instance of the VisioForge.Core.MediaBlocks.Special.DebugTimestampBlock class with optional visual overlay.

public DebugTimestampBlock(string loggerName = "DebugTimestamp", TextOverlaySettings additionalTimeOverlay = null)

Parameters

loggerName string

Custom name to identify this stream in debug logs. Default is "DebugTimestamp".

additionalTimeOverlay TextOverlaySettings

Optional configuration for visual timestamp overlay on video frames. When provided, timestamps will be rendered on the video in addition to being logged.

Properties

Input

Gets the input pad for receiving media streams to analyze.

public override MediaBlockPad Input { get; }

Property Value

MediaBlockPad

Inputs

Gets the array of input pads. This block has a single input.

public override MediaBlockPad[] Inputs { get; }

Property Value

MediaBlockPad[]

Output

Gets the output pad that passes through the analyzed media stream.

public override MediaBlockPad Output { get; }

Property Value

MediaBlockPad

Outputs

Gets the array of output pads. This block has a single passthrough output.

public override MediaBlockPad[] Outputs { get; }

Property Value

MediaBlockPad[]

Type

Gets the media block type identifier for this debug timestamp block.

public override MediaBlockType Type { get; }

Property Value

MediaBlockType

Methods

Build()

Builds and initializes the debug timestamp block within the media pipeline. Creates the timestamp logger and optionally sets up visual overlay for video streams. This method is called automatically during pipeline construction.

public override bool Build()

Returns

bool

true if the block was successfully built; false if initialization failed.

CleanUp()

Performs cleanup of the debug timestamp element and associated resources. Releases the GStreamer element and resets the build state.

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 element wrapper. Returns null as this is a specialized debug element.

public BaseElement GetCore()

Returns

BaseElement

Always returns null for this debug block.

GetElement()

Gets the underlying GStreamer debug timestamp element.

public Element GetElement()

Returns

Element

The native GStreamer element that performs timestamp logging.

IsAvailable()

Determines whether the debug timestamp functionality is available in the current environment. This block is always available when the platform supports it (not iOS).

public static bool IsAvailable()

Returns

bool

Always returns true on supported platforms.

IMediaBlockInternals.SetContext(MediaBlocksPipeline)

Sets the media pipeline context for this debug block. This internal method establishes the connection to the parent pipeline.

void IMediaBlockInternals.SetContext(MediaBlocksPipeline pipeline)

Parameters

pipeline MediaBlocksPipeline

The parent MediaBlocksPipeline that contains this block.

See Also