sinch-rtc
Version:
RTC JavaScript/Web SDK
21 lines (20 loc) • 1.2 kB
TypeScript
import { CallQualityWarningEventFanout } from "../../listeners/CallQualityWarningEventFanout";
import { CallQualityWarningEventType } from "../CallQualityWarningEventType";
import { CallQualityWarningEvent } from "../events/CallQualityWarningEvent";
import { WebRtcStatsDetector } from "./WebRtcStatsDetector";
/**
*
* BufferedWarningDetector tracks given WebRTC statistic parameter by keeping it's recent values inside a
* [StatsBuffer] issuing warning when given amount of values in buffer exceeds provided threshold.
*
* Implementation should call `onNewMonitoredValue` whenever a new value of the monitored parameter is available.
*/
export declare abstract class BufferedWarningDetector extends WebRtcStatsDetector {
static readonly DEFAULT_BUFFER_SIZE = 4;
static readonly DEFAULT_SAMPLES_COUNT_FOR_WARNING = 3;
private readonly buffer;
private lastSampleTimestampMs;
constructor(fanout: CallQualityWarningEventFanout, bufferSize: number, samplesCountForWarning: number, threshold: number);
onNewMonitoredValue(value?: number, timestampMs?: number): void;
protected abstract warningEventWithType(type: CallQualityWarningEventType): CallQualityWarningEvent;
}