@livedigital/client 3.50.0 → 3.51.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine/WebRTCStats/BaseTrackStatsManager.d.ts +9 -0
- package/dist/engine/WebRTCStats/InboundTrackStatsManager.d.ts +12 -2
- package/dist/engine/WebRTCStats/OutboundTrackStatsManager.d.ts +25 -0
- package/dist/engine/WebRTCStats/StatsHandler.d.ts +6 -5
- package/dist/engine/WebRTCStats/TransportsStatsProvider.d.ts +5 -1
- package/dist/engine/WebRTCStats/types.d.ts +25 -2
- package/dist/engine/analyticsApiClient/types.d.ts +3 -0
- package/dist/engine/index.d.ts +4 -1
- package/dist/engine/media/tracks/DefaultBaseTrack.d.ts +2 -0
- package/dist/engine/media/tracks/PeerTrack.d.ts +6 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +2 -2
- package/dist/index.js +2 -2
- package/dist/inversify.tokens.d.ts +5 -0
- package/dist/qoe/ScoresCalculator.d.ts +11 -0
- package/dist/qoe/WIDStatsAdapter.d.ts +10 -0
- package/dist/qoe/constants.d.ts +5 -0
- package/dist/qoe/helpers.d.ts +7 -0
- package/dist/qoe/types.d.ts +112 -0
- package/dist/types/media.d.ts +6 -0
- package/package.json +2 -2
- package/dist/engine/WebRTCStats/OutboudTrackStatsManager.d.ts +0 -16
|
@@ -10,7 +10,12 @@ export declare enum TOKEN {
|
|
|
10
10
|
ChannelAudioObserverMissingProducerRestorer = "ChannelAudioObserverMissingProducerRestorer",
|
|
11
11
|
ChannelStateSynchronizer = "ChannelStateSynchronizer",
|
|
12
12
|
ChannelStateSyncEventHandler = "ChannelStateSyncEventHandler",
|
|
13
|
+
CompositeStatsParser = "CompositeStatsParser",
|
|
14
|
+
PeriodicStatsReporter = "PeriodicStatsReporter",
|
|
15
|
+
WIDIgnoreSsrcList = "WIDIgnoreSsrcList",
|
|
13
16
|
WebRTCIssueDetector = "WebRTCIssueDetector",
|
|
17
|
+
WIDStatsAdapter = "WIDStatsAdapter",
|
|
18
|
+
ScoresCalculator = "ScoresCalculator",
|
|
14
19
|
LoggerFactory = "LoggerFactory",
|
|
15
20
|
MediaStreamTrackManager = "MediaStreamTrackManager",
|
|
16
21
|
EventsQueue = "EventsQueue",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AudioStreamStats, VideoStreamStats, ScoresCalculatorConfig, DeviceType } from './types';
|
|
2
|
+
export declare class ScoresCalculator {
|
|
3
|
+
private readonly config;
|
|
4
|
+
constructor(config?: ScoresCalculatorConfig);
|
|
5
|
+
calculateAudioMOS(stats: Partial<AudioStreamStats>): number;
|
|
6
|
+
calculateVideoMOS(stats: Partial<VideoStreamStats>): number;
|
|
7
|
+
calculateAVCompositeMOS(Qa: number, Qv: number, deviceType?: DeviceType): number;
|
|
8
|
+
private mergeConfig;
|
|
9
|
+
private normalizeAudioStats;
|
|
10
|
+
private normalizeVideoStats;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AdaptInboundAudioStatsPayload, AdaptInboundVideoStatsPayload, AdaptOutboundAudioStatsPayload, AdaptOutboundVideoStatsPayload, AudioStreamStats, VideoStreamStats } from './types';
|
|
2
|
+
export declare class WIDStatsAdapter {
|
|
3
|
+
adaptInboundAudioStats(payload: AdaptInboundAudioStatsPayload): AudioStreamStats;
|
|
4
|
+
adaptInboundVideoStats(payload: AdaptInboundVideoStatsPayload): VideoStreamStats;
|
|
5
|
+
adaptOutboundAudioStats(payload: AdaptOutboundAudioStatsPayload): AudioStreamStats;
|
|
6
|
+
adaptOutboundVideoStats(payload: AdaptOutboundVideoStatsPayload): VideoStreamStats;
|
|
7
|
+
private calculateDeltaPacketLoss;
|
|
8
|
+
private calculateDeltaAverageQP;
|
|
9
|
+
private calculateJitterBufferDelay;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function findStatsBySsrc<T extends {
|
|
2
|
+
ssrc: number;
|
|
3
|
+
}>(ssrc: number, statsItems: T[]): T | undefined;
|
|
4
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
5
|
+
export declare function toPrecision(num: number, precision?: number): number;
|
|
6
|
+
export declare function prepareScore(score: number): number;
|
|
7
|
+
export declare function linearPercentile(sorted: number[], percentile: number): number;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { ParsedConnectionStats, ParsedInboundAudioStreamStats, ParsedInboundVideoStreamStats, ParsedOutboundAudioStreamStats, ParsedOutboundVideoStreamStats, ParsedRemoteInboundStreamStats } from 'webrtc-issue-detector';
|
|
2
|
+
export interface AudioStreamStats {
|
|
3
|
+
ssrc: number;
|
|
4
|
+
packetLoss: number;
|
|
5
|
+
bitrate: number;
|
|
6
|
+
roundTripTime: number;
|
|
7
|
+
bufferDelay: number;
|
|
8
|
+
fec: boolean;
|
|
9
|
+
dtx: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface VideoStreamStats {
|
|
12
|
+
ssrc: number;
|
|
13
|
+
packetLoss: number;
|
|
14
|
+
bitrate: number;
|
|
15
|
+
roundTripTime: number;
|
|
16
|
+
bufferDelay: number;
|
|
17
|
+
codec?: string;
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
expectedWidth: number;
|
|
21
|
+
expectedHeight: number;
|
|
22
|
+
frameRate: number;
|
|
23
|
+
expectedFrameRate: number;
|
|
24
|
+
decreaseOutboundPenalty?: boolean;
|
|
25
|
+
isStaticContent?: boolean;
|
|
26
|
+
averageQP?: number;
|
|
27
|
+
qualityLimitationReason?: 'none' | 'bandwidth' | 'cpu' | 'other';
|
|
28
|
+
}
|
|
29
|
+
export interface AdaptedWIDStats {
|
|
30
|
+
inbound: {
|
|
31
|
+
audio: AudioStreamStats[];
|
|
32
|
+
video: VideoStreamStats[];
|
|
33
|
+
};
|
|
34
|
+
outbound: {
|
|
35
|
+
audio: AudioStreamStats[];
|
|
36
|
+
video: VideoStreamStats[];
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface CodecFactors {
|
|
40
|
+
vp9?: number;
|
|
41
|
+
vp8?: number;
|
|
42
|
+
h264?: number;
|
|
43
|
+
[codec: string]: number | undefined;
|
|
44
|
+
}
|
|
45
|
+
export interface VideoCalculatorConfig {
|
|
46
|
+
codecFactors?: CodecFactors;
|
|
47
|
+
}
|
|
48
|
+
export interface ScoresCalculatorConfig {
|
|
49
|
+
video?: VideoCalculatorConfig;
|
|
50
|
+
}
|
|
51
|
+
export interface BaseCalculatorConfig {
|
|
52
|
+
video: Required<VideoCalculatorConfig>;
|
|
53
|
+
defaults: Required<{
|
|
54
|
+
audio: AudioStreamStats;
|
|
55
|
+
video: VideoStreamStats;
|
|
56
|
+
}>;
|
|
57
|
+
}
|
|
58
|
+
export type DeviceType = 'mobile' | 'pc' | 'tv';
|
|
59
|
+
export interface MOSScores {
|
|
60
|
+
Qa?: number;
|
|
61
|
+
Qv?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ExpectedVideoParams {
|
|
64
|
+
width?: number;
|
|
65
|
+
height?: number;
|
|
66
|
+
maxFramerate?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface PacketLossStats {
|
|
69
|
+
packetsLost: number;
|
|
70
|
+
packetsReceivedOrSent: number;
|
|
71
|
+
}
|
|
72
|
+
type RemoteInboundStats = Pick<ParsedRemoteInboundStreamStats, 'packetsLost' | 'jitter' | 'roundTripTime'>;
|
|
73
|
+
interface OutboundPrevStats {
|
|
74
|
+
outbound: {
|
|
75
|
+
packetsSent: number;
|
|
76
|
+
qpSum?: number;
|
|
77
|
+
framesEncoded?: number;
|
|
78
|
+
};
|
|
79
|
+
remoteInbound: {
|
|
80
|
+
packetsLost: number;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
export interface AdaptInboundAudioStatsPayload {
|
|
84
|
+
stats: ParsedInboundAudioStreamStats;
|
|
85
|
+
connectionStats: ParsedConnectionStats;
|
|
86
|
+
fec: boolean;
|
|
87
|
+
dtx: boolean;
|
|
88
|
+
prevStats?: ParsedInboundAudioStreamStats;
|
|
89
|
+
}
|
|
90
|
+
export interface AdaptInboundVideoStatsPayload {
|
|
91
|
+
stats: ParsedInboundVideoStreamStats;
|
|
92
|
+
connectionStats: ParsedConnectionStats;
|
|
93
|
+
prevStats?: ParsedInboundVideoStreamStats;
|
|
94
|
+
expectedWidth?: number;
|
|
95
|
+
expectedHeight?: number;
|
|
96
|
+
expectedFrameRate?: number;
|
|
97
|
+
isStaticContent?: boolean;
|
|
98
|
+
}
|
|
99
|
+
export interface AdaptOutboundAudioStatsPayload {
|
|
100
|
+
stats: ParsedOutboundAudioStreamStats;
|
|
101
|
+
remoteInboundStats?: RemoteInboundStats;
|
|
102
|
+
fec: boolean;
|
|
103
|
+
dtx: boolean;
|
|
104
|
+
prevStats?: OutboundPrevStats;
|
|
105
|
+
}
|
|
106
|
+
export interface AdaptOutboundVideoStatsPayload {
|
|
107
|
+
stats: ParsedOutboundVideoStreamStats;
|
|
108
|
+
remoteInboundStats?: RemoteInboundStats;
|
|
109
|
+
prevStats?: OutboundPrevStats;
|
|
110
|
+
isStaticContent?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export {};
|
package/dist/types/media.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ import type Network from '../engine/network';
|
|
|
13
13
|
import type StatsHandler from '../engine/WebRTCStats/StatsHandler';
|
|
14
14
|
import type ProducerCloseManager from '../engine/media/producer/ProducerCloseManager';
|
|
15
15
|
import type EnhancedEventEmitter from '../EnhancedEventEmitter';
|
|
16
|
+
import type { MOSScores } from '../qoe/types';
|
|
17
|
+
import type { WIDStatsAdapter } from '../qoe/WIDStatsAdapter';
|
|
18
|
+
import type { ScoresCalculator } from '../qoe/ScoresCalculator';
|
|
16
19
|
import type { BaseTrackInfo, EncoderConfig, TrackLabel, TrackOutboundStats, TrackProduceParams, TrackTransformParams } from './common';
|
|
17
20
|
import type { InternalObserverEvents } from './engine';
|
|
18
21
|
export interface BaseTrackDependenciesParams {
|
|
@@ -25,6 +28,8 @@ export interface BaseTrackDependenciesParams {
|
|
|
25
28
|
producerCloseManager: ProducerCloseManager;
|
|
26
29
|
mutex: LocalMutex;
|
|
27
30
|
statsHandler: StatsHandler;
|
|
31
|
+
widStatsAdapter: WIDStatsAdapter;
|
|
32
|
+
scoresCalculator: ScoresCalculator;
|
|
28
33
|
}
|
|
29
34
|
export interface BaseTrackParams {
|
|
30
35
|
loggerNamespace: string;
|
|
@@ -42,6 +47,7 @@ export interface BaseTrack {
|
|
|
42
47
|
producerId?: string;
|
|
43
48
|
videoWebRTCStats?: ParsedOutboundVideoStreamStats;
|
|
44
49
|
audioWebRTCStats?: ParsedOutboundAudioStreamStats;
|
|
50
|
+
connectionScores: MOSScores;
|
|
45
51
|
getLabel: () => TrackLabel;
|
|
46
52
|
setLabel: (label: TrackLabel) => void;
|
|
47
53
|
setEncoderConfig: (encoderConfig: EncoderConfig) => void;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@livedigital/client",
|
|
3
3
|
"author": "vlprojects",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "3.
|
|
5
|
+
"version": "3.51.0",
|
|
6
6
|
"private": false,
|
|
7
7
|
"bugs": {
|
|
8
8
|
"url": "https://github.com/vlprojects/livedigital-sdk/issues"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"qs": "^6.11.0",
|
|
57
57
|
"reflect-metadata": "^0.2.2",
|
|
58
58
|
"serialize-error": "^7.0.1",
|
|
59
|
-
"webrtc-issue-detector": "^1.17.
|
|
59
|
+
"webrtc-issue-detector": "^1.17.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@rollup/plugin-commonjs": "^19.0.0",
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { ParsedOutboundVideoStreamStats, ParsedOutboundAudioStreamStats } from 'webrtc-issue-detector';
|
|
2
|
-
import type StatsHandler from './StatsHandler';
|
|
3
|
-
interface OutboundTrackStatsManagerParams {
|
|
4
|
-
track: MediaStreamTrack;
|
|
5
|
-
statsHandler: StatsHandler;
|
|
6
|
-
}
|
|
7
|
-
export default class OutboundTrackStatsManager {
|
|
8
|
-
#private;
|
|
9
|
-
constructor({ track, statsHandler }: OutboundTrackStatsManagerParams);
|
|
10
|
-
get videoWebRTCStats(): ParsedOutboundVideoStreamStats | undefined;
|
|
11
|
-
get audioWebRTCStats(): ParsedOutboundAudioStreamStats | undefined;
|
|
12
|
-
private handleWebRTCStats;
|
|
13
|
-
private setVideoWebRTCStats;
|
|
14
|
-
private setAudioWebRTCStats;
|
|
15
|
-
}
|
|
16
|
-
export {};
|