Table of Contents

Class DebugMediaBlockSettings

Namespace
VisioForge.Core.Types.X
Assembly
VisioForge.Core.dll

Provides a set of debugging and control settings for media blocks within the VisioForge X engine. These settings allow for fine-grained control over buffer handling, timing, and error simulation for testing and diagnostic purposes.

public class DebugMediaBlockSettings

Inheritance

Inherited Members

Examples

// Create new debug settings for a media block.
var debugSettings = new DebugMediaBlockSettings
{
    CheckImperfectOffset = true, // Enable checking for offset mismatches
    CheckImperfectTimestamp = true, // Enable checking for timestamp mismatches
    DataRate = 1024 * 1024, // Simulate a data rate of 1MB/s for timestamping
    DropProbability = 0.01f, // Drop 1% of buffers for testing error handling
    EOSAfter = 1000, // Send EOS signal after 1000 buffers
    ErrorAfter = 500, // Simulate an error after 500 buffers
    SignalHandoffs = true, // Enable handoff signals for debugging
    Silent = false, // Disable silent mode to see more debug output
    SingleSegment = true, // Treat all buffers as part of a single segment
    SleepTime = 10000, // Introduce a 10ms delay between processing buffers
    Sync = true, // Synchronize to pipeline clock
    TimestampOffset = -5000000 // Apply a -5ms timestamp offset
};

// Apply these settings to a media block (conceptual)
// mediaBlock.DebugSettings = debugSettings;

Remarks

This class is primarily intended for developers and advanced users to debug and analyze the behavior of media pipelines. Modifying these settings can significantly alter the performance and stability of media processing.

Properties

CheckImperfectOffset

Gets or sets a value indicating whether to send element messages if buffer offsets and offset_ends do not match up. This helps in debugging issues related to buffer segmentation and continuity.

public bool CheckImperfectOffset { get; set; }

Property Value

bool

CheckImperfectTimestamp

Gets or sets a value indicating whether to send element messages if buffer timestamps and durations do not match up. This helps in debugging issues related to timing and synchronization.

public bool CheckImperfectTimestamp { get; set; }

Property Value

bool

DataRate

Gets or sets the data rate in bytes per second for (re)timestamping buffers. If set to 0, this feature is inactive. Useful for simulating specific data flow rates.

public int DataRate { get; set; }

Property Value

int

DropAllocation

Gets or sets a value indicating whether to drop allocation queries. If set to true, the element will not forward allocation queries, which can be used for testing memory management scenarios.

public bool DropAllocation { get; set; }

Property Value

bool

DropProbability

Gets or sets the probability (0.0 to 1.0) that a buffer will be dropped. This can be used to simulate network packet loss or other data corruption scenarios.

public float DropProbability { get; set; }

Property Value

float

EOSAfter

Gets or sets the number of buffers after which an End-Of-Stream (EOS) signal will be sent. A value of -1 means no EOS will be sent based on buffer count. Useful for testing stream termination.

public int EOSAfter { get; set; }

Property Value

int

ErrorAfter

Gets or sets the number of buffers after which an error will be simulated. A value of -1 means no error will be simulated based on buffer count. Useful for testing error handling.

public int ErrorAfter { get; set; }

Property Value

int

SignalHandoffs

Gets or sets a value indicating whether the identity element should emit a handoff signal when processing a buffer. This signal can be used for external monitoring or debugging of buffer flow.

public bool SignalHandoffs { get; set; }

Property Value

bool

Silent

Gets or sets a value indicating whether the media block should operate in silent mode. In silent mode, less debug information might be printed to the console.

public bool Silent { get; set; }

Property Value

bool

SingleSegment

Gets or sets a value indicating whether to timestamp buffers and eat segments so as to appear as one continuous segment. This is useful for ensuring continuous playback even with fragmented input.

public bool SingleSegment { get; set; }

Property Value

bool

SleepTime

Gets or sets the time in microseconds to sleep between processing each buffer. This can be used to simulate processing delays or to throttle the pipeline for debugging purposes.

public uint SleepTime { get; set; }

Property Value

uint

Sync

Gets or sets a value indicating whether the media block should synchronize to the pipeline clock. Enabling synchronization ensures smooth playback and proper timing with other elements in the pipeline.

public bool Sync { get; set; }

Property Value

bool

TimestampOffset

Gets or sets the timestamp offset in nanoseconds for synchronization. A negative value indicates an earlier synchronization point, while a positive value indicates a later one.

public long TimestampOffset { get; set; }

Property Value

long