import { PeerType, TrackType } from '../../gen/video/sfu/models/models'; import type { ComputedStats } from './types'; /** * StatsTracer is a class that collects and processes WebRTC stats. * It is used to track the performance of the WebRTC connection * and to provide information about the media streams. * It is used by both the Publisher and Subscriber classes. * * @internal */ export declare class StatsTracer { private readonly pc; private readonly peerType; private readonly trackIdToTrackType; private costOverrides?; private previousStats; private frameTimeHistory; private fpsHistory; /** * Creates a new StatsTracer instance. */ constructor(pc: RTCPeerConnection, peerType: PeerType, trackIdToTrackType: Map); /** * Get the stats from the RTCPeerConnection. * When called, it will return the stats for the current connection. * It will also return the delta between the current stats and the previous stats. * This is used to track the performance of the connection. * * @internal */ get: () => Promise; /** * Collects encode stats from the RTCPeerConnection. */ private getEncodeStats; /** * Collects decode stats from the RTCPeerConnection. */ private getDecodeStats; /** * Applies cost overrides to the performance stats. * This is used to override the default encode/decode times with custom values. * This is useful for testing and debugging purposes, and it shouldn't be used in production. */ private withOverrides; /** * Set the encode/decode cost for a specific track type. * This is used to override the default encode/decode times with custom values. * This is useful for testing and debugging purposes, and it shouldn't be used in production. * * @internal */ setCost: (cost: number, trackType?: TrackType) => void; }