import type { ParsedConnectionStats, ParsedInboundAudioStreamStats, ParsedInboundVideoStreamStats, ParsedOutboundAudioStreamStats, ParsedOutboundVideoStreamStats, ParsedRemoteInboundStreamStats } from 'webrtc-issue-detector'; export interface AudioStreamStats { ssrc: number; packetLoss: number; bitrate: number; roundTripTime: number; bufferDelay: number; fec: boolean; dtx: boolean; } export interface VideoStreamStats { ssrc: number; packetLoss: number; bitrate: number; roundTripTime: number; bufferDelay: number; codec?: string; width: number; height: number; expectedWidth: number; expectedHeight: number; frameRate: number; expectedFrameRate: number; decreaseOutboundPenalty?: boolean; isStaticContent?: boolean; averageQP?: number; qualityLimitationReason?: 'none' | 'bandwidth' | 'cpu' | 'other'; } export interface AdaptedWIDStats { inbound: { audio: AudioStreamStats[]; video: VideoStreamStats[]; }; outbound: { audio: AudioStreamStats[]; video: VideoStreamStats[]; }; } export interface CodecFactors { vp9?: number; vp8?: number; h264?: number; [codec: string]: number | undefined; } export interface VideoCalculatorConfig { codecFactors?: CodecFactors; } export interface ScoresCalculatorConfig { video?: VideoCalculatorConfig; } export interface BaseCalculatorConfig { video: Required; defaults: Required<{ audio: AudioStreamStats; video: VideoStreamStats; }>; } export type DeviceType = 'mobile' | 'pc' | 'tv'; export interface MOSScores { Qa?: number; Qv?: number; } export interface ExpectedVideoParams { width?: number; height?: number; maxFramerate?: number; } export interface PacketLossStats { packetsLost: number; packetsReceivedOrSent: number; } type RemoteInboundStats = Pick; interface OutboundPrevStats { outbound: { packetsSent: number; qpSum?: number; framesEncoded?: number; }; remoteInbound: { packetsLost: number; }; } export interface AdaptInboundAudioStatsPayload { stats: ParsedInboundAudioStreamStats; connectionStats: ParsedConnectionStats; fec: boolean; dtx: boolean; prevStats?: ParsedInboundAudioStreamStats; } export interface AdaptInboundVideoStatsPayload { stats: ParsedInboundVideoStreamStats; connectionStats: ParsedConnectionStats; prevStats?: ParsedInboundVideoStreamStats; expectedWidth?: number; expectedHeight?: number; expectedFrameRate?: number; isStaticContent?: boolean; } export interface AdaptOutboundAudioStatsPayload { stats: ParsedOutboundAudioStreamStats; remoteInboundStats?: RemoteInboundStats; fec: boolean; dtx: boolean; prevStats?: OutboundPrevStats; } export interface AdaptOutboundVideoStatsPayload { stats: ParsedOutboundVideoStreamStats; remoteInboundStats?: RemoteInboundStats; prevStats?: OutboundPrevStats; isStaticContent?: boolean; } export {};