@observertc/observer-js 0.42.9 → 1.0.1-57a1811.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/.prettierrc +6 -6
- package/README.md +0 -104
- package/lib/ObservedCall.d.ts +38 -41
- package/lib/ObservedCall.d.ts.map +1 -1
- package/lib/ObservedCall.js +97 -109
- package/lib/ObservedCertificate.d.ts +19 -0
- package/lib/ObservedCertificate.d.ts.map +1 -0
- package/lib/ObservedCertificate.js +38 -0
- package/lib/ObservedClient.d.ts +49 -127
- package/lib/ObservedClient.d.ts.map +1 -1
- package/lib/ObservedClient.js +201 -750
- package/lib/ObservedCodec.d.ts +22 -0
- package/lib/ObservedCodec.d.ts.map +1 -0
- package/lib/ObservedCodec.js +45 -0
- package/lib/ObservedDataChannel.d.ts +23 -69
- package/lib/ObservedDataChannel.d.ts.map +1 -1
- package/lib/ObservedDataChannel.js +67 -109
- package/lib/ObservedIceCandidate.d.ts +29 -0
- package/lib/ObservedIceCandidate.d.ts.map +1 -0
- package/lib/ObservedIceCandidate.js +59 -0
- package/lib/ObservedIceCandidatePair.d.ts +44 -0
- package/lib/ObservedIceCandidatePair.d.ts.map +1 -0
- package/lib/ObservedIceCandidatePair.js +111 -0
- package/lib/ObservedIceTransport.d.ts +32 -0
- package/lib/ObservedIceTransport.d.ts.map +1 -0
- package/lib/ObservedIceTransport.js +65 -0
- package/lib/ObservedInboundRtp.d.ts +92 -0
- package/lib/ObservedInboundRtp.d.ts.map +1 -0
- package/lib/ObservedInboundRtp.js +193 -0
- package/lib/ObservedInboundTrack.d.ts +29 -0
- package/lib/ObservedInboundTrack.d.ts.map +1 -0
- package/lib/ObservedInboundTrack.js +57 -0
- package/lib/ObservedMediaPlayout.d.ts +22 -0
- package/lib/ObservedMediaPlayout.d.ts.map +1 -0
- package/lib/ObservedMediaPlayout.js +42 -0
- package/lib/ObservedMediaSource.d.ts +28 -0
- package/lib/ObservedMediaSource.d.ts.map +1 -0
- package/lib/ObservedMediaSource.js +55 -0
- package/lib/ObservedOutboundRtp.d.ts +62 -0
- package/lib/ObservedOutboundRtp.d.ts.map +1 -0
- package/lib/ObservedOutboundRtp.js +144 -0
- package/lib/ObservedOutboundTrack.d.ts +29 -0
- package/lib/ObservedOutboundTrack.d.ts.map +1 -0
- package/lib/ObservedOutboundTrack.js +57 -0
- package/lib/ObservedPeerConnection.d.ts +128 -78
- package/lib/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/ObservedPeerConnection.js +624 -357
- package/lib/ObservedPeerConnectionTransport.d.ts +17 -0
- package/lib/ObservedPeerConnectionTransport.d.ts.map +1 -0
- package/lib/ObservedPeerConnectionTransport.js +34 -0
- package/lib/ObservedRemoteInboundRtp.d.ts +30 -0
- package/lib/ObservedRemoteInboundRtp.d.ts.map +1 -0
- package/lib/ObservedRemoteInboundRtp.js +60 -0
- package/lib/ObservedRemoteOutboundRtp.d.ts +30 -0
- package/lib/ObservedRemoteOutboundRtp.d.ts.map +1 -0
- package/lib/ObservedRemoteOutboundRtp.js +60 -0
- package/lib/ObservedTURN.d.ts +31 -0
- package/lib/ObservedTURN.d.ts.map +1 -0
- package/lib/ObservedTURN.js +58 -0
- package/lib/ObservedTurnServer.d.ts +25 -0
- package/lib/ObservedTurnServer.d.ts.map +1 -0
- package/lib/ObservedTurnServer.js +59 -0
- package/lib/Observer.d.ts +31 -51
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +75 -229
- package/lib/common/Middleware.d.ts +10 -1
- package/lib/common/Middleware.d.ts.map +1 -1
- package/lib/common/Middleware.js +55 -36
- package/lib/common/logger.d.ts +8 -4
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +44 -68
- package/lib/common/types.d.ts +0 -21
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/types.js +1 -0
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +13 -1
- package/lib/detectors/Detector.d.ts +5 -0
- package/lib/detectors/Detector.d.ts.map +1 -0
- package/lib/detectors/Detector.js +3 -0
- package/lib/detectors/Detectors.d.ts +11 -0
- package/lib/detectors/Detectors.d.ts.map +1 -0
- package/lib/detectors/Detectors.js +34 -0
- package/lib/index.d.ts +24 -25
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +41 -41
- package/lib/monitors/TurnUsageMonitor.d.ts +0 -52
- package/lib/monitors/TurnUsageMonitor.d.ts.map +1 -1
- package/lib/monitors/TurnUsageMonitor.js +145 -120
- package/lib/schema/ClientEventTypes.d.ts +33 -0
- package/lib/schema/ClientEventTypes.d.ts.map +1 -0
- package/lib/schema/ClientEventTypes.js +38 -0
- package/lib/schema/ClientMetaTypes.d.ts +34 -0
- package/lib/schema/ClientMetaTypes.d.ts.map +1 -0
- package/lib/schema/ClientMetaTypes.js +16 -0
- package/lib/schema/ClientSample.d.ts +1333 -0
- package/lib/schema/ClientSample.d.ts.map +1 -0
- package/lib/schema/ClientSample.js +4 -0
- package/lib/scores/CalculatedScore.d.ts +6 -0
- package/lib/scores/CalculatedScore.d.ts.map +1 -0
- package/lib/scores/DefaultCallScoreCalculator.d.ts +7 -0
- package/lib/scores/DefaultCallScoreCalculator.d.ts.map +1 -0
- package/lib/scores/DefaultCallScoreCalculator.js +21 -0
- package/lib/scores/ScoreCalculator.d.ts +4 -0
- package/lib/scores/ScoreCalculator.d.ts.map +1 -0
- package/lib/scores/ScoreCalculator.js +2 -0
- package/lib/utils/CallUpdater.d.ts +5 -0
- package/lib/utils/CallUpdater.d.ts.map +1 -0
- package/lib/utils/CallUpdater.js +2 -0
- package/lib/utils/OnAllClientCallUpdater.d.ts +16 -0
- package/lib/utils/OnAllClientCallUpdater.d.ts.map +1 -0
- package/lib/utils/OnAllClientCallUpdater.js +58 -0
- package/lib/utils/RemoteTrackResolver.d.ts +7 -0
- package/lib/utils/RemoteTrackResolver.d.ts.map +1 -0
- package/lib/utils/RemoteTrackResolver.js +2 -0
- package/lib/utils/onAnyClientCallUpdater.d.ts +14 -0
- package/lib/utils/onAnyClientCallUpdater.d.ts.map +1 -0
- package/lib/utils/onAnyClientCallUpdater.js +51 -0
- package/package.json +4 -4
- package/src/ObservedCall.ts +116 -166
- package/src/ObservedCertificate.ts +43 -0
- package/src/ObservedClient.ts +213 -1060
- package/src/ObservedCodec.ts +49 -0
- package/src/ObservedDataChannel.ts +68 -181
- package/src/ObservedIceCandidate.ts +64 -0
- package/src/ObservedIceCandidatePair.ts +118 -0
- package/src/ObservedIceTransport.ts +70 -0
- package/src/ObservedInboundRtp.ts +205 -0
- package/src/ObservedInboundTrack.ts +70 -0
- package/src/ObservedMediaPlayout.ts +49 -0
- package/src/ObservedMediaSource.ts +60 -0
- package/src/ObservedOutboundRtp.ts +156 -0
- package/src/ObservedOutboundTrack.ts +69 -0
- package/src/ObservedPeerConnection.ts +827 -405
- package/src/ObservedPeerConnectionTransport.ts +38 -0
- package/src/ObservedRemoteInboundRtp.ts +64 -0
- package/src/ObservedRemoteOutboundRtp.ts +65 -0
- package/src/ObservedTURN.ts +86 -0
- package/src/ObservedTurnServer.ts +72 -0
- package/src/Observer.ts +91 -302
- package/src/common/Middleware.ts +70 -42
- package/src/common/logger.ts +60 -69
- package/src/common/types.ts +0 -42
- package/src/common/utils.ts +12 -0
- package/src/detectors/Detector.ts +6 -0
- package/src/detectors/Detectors.ts +38 -0
- package/src/index.ts +24 -90
- package/src/monitors/TurnUsageMonitor.ts +164 -164
- package/src/schema/ClientEventTypes.ts +36 -0
- package/src/schema/ClientMetaTypes.ts +41 -0
- package/src/schema/ClientSample.ts +1682 -0
- package/src/scores/CalculatedScore.ts +6 -0
- package/src/scores/DefaultCallScoreCalculator.ts +23 -0
- package/src/scores/ScoreCalculator.ts +3 -0
- package/src/utils/CallUpdater.ts +5 -0
- package/src/utils/OnAllClientCallUpdater.ts +68 -0
- package/src/utils/RemoteTrackResolver.ts +12 -0
- package/src/utils/onAnyClientCallUpdater.ts +59 -0
- package/tsconfig.json +3 -3
- package/lib/ObservedICE.d.ts +0 -64
- package/lib/ObservedICE.d.ts.map +0 -1
- package/lib/ObservedICE.js +0 -141
- package/lib/ObservedInboundAudioTrack.d.ts +0 -96
- package/lib/ObservedInboundAudioTrack.d.ts.map +0 -1
- package/lib/ObservedInboundAudioTrack.js +0 -217
- package/lib/ObservedInboundVideoTrack.d.ts +0 -101
- package/lib/ObservedInboundVideoTrack.d.ts.map +0 -1
- package/lib/ObservedInboundVideoTrack.js +0 -232
- package/lib/ObservedOutboundAudioTrack.d.ts +0 -87
- package/lib/ObservedOutboundAudioTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundAudioTrack.js +0 -186
- package/lib/ObservedOutboundVideoTrack.d.ts +0 -91
- package/lib/ObservedOutboundVideoTrack.d.ts.map +0 -1
- package/lib/ObservedOutboundVideoTrack.js +0 -193
- package/lib/ObservedSfu.d.ts +0 -59
- package/lib/ObservedSfu.d.ts.map +0 -1
- package/lib/ObservedSfu.js +0 -157
- package/lib/ObservedSfuInboundRtpPad.d.ts +0 -42
- package/lib/ObservedSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/ObservedSfuInboundRtpPad.js +0 -71
- package/lib/ObservedSfuOutboundRtpPad.d.ts +0 -42
- package/lib/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/ObservedSfuOutboundRtpPad.js +0 -72
- package/lib/ObservedSfuSctpChannel.d.ts +0 -42
- package/lib/ObservedSfuSctpChannel.d.ts.map +0 -1
- package/lib/ObservedSfuSctpChannel.js +0 -57
- package/lib/ObservedSfuTransport.d.ts +0 -58
- package/lib/ObservedSfuTransport.d.ts.map +0 -1
- package/lib/ObservedSfuTransport.js +0 -120
- package/lib/RemoteTrackAssigner.d.ts +0 -14
- package/lib/RemoteTrackAssigner.d.ts.map +0 -1
- package/lib/RemoteTrackAssigner.js +0 -52
- package/lib/ReportsCollector.d.ts +0 -109
- package/lib/ReportsCollector.d.ts.map +0 -1
- package/lib/ReportsCollector.js +0 -207
- package/lib/common/CalculatedScore.d.ts +0 -80
- package/lib/common/CalculatedScore.d.ts.map +0 -1
- package/lib/common/CalculatedScore.js +0 -162
- package/lib/common/CallEventType.d.ts +0 -63
- package/lib/common/CallEventType.d.ts.map +0 -1
- package/lib/common/CallEventType.js +0 -39
- package/lib/common/CallMetaReports.d.ts +0 -42
- package/lib/common/CallMetaReports.d.ts.map +0 -1
- package/lib/common/CallMetaReports.js +0 -36
- package/lib/common/QualityScoreUtils.d.ts +0 -1
- package/lib/common/QualityScoreUtils.d.ts.map +0 -1
- package/lib/common/QualityScoreUtils.js +0 -1
- package/lib/common/TypedEventEmitter.d.ts +0 -22
- package/lib/common/TypedEventEmitter.d.ts.map +0 -1
- package/lib/common/TypedEventEmitter.js +0 -11
- package/lib/common/callEventReports.d.ts +0 -10
- package/lib/common/callEventReports.d.ts.map +0 -1
- package/lib/common/callEventReports.js +0 -112
- package/lib/monitors/CallSummary.d.ts +0 -37
- package/lib/monitors/CallSummary.d.ts.map +0 -1
- package/lib/monitors/CallSummaryMonitor.d.ts +0 -32
- package/lib/monitors/CallSummaryMonitor.d.ts.map +0 -1
- package/lib/monitors/CallSummaryMonitor.js +0 -152
- package/lib/monitors/ClientIssueMonitor.d.ts +0 -32
- package/lib/monitors/ClientIssueMonitor.d.ts.map +0 -1
- package/lib/monitors/ClientIssueMonitor.js +0 -49
- package/lib/monitors/SfuServerMonitor.d.ts +0 -79
- package/lib/monitors/SfuServerMonitor.d.ts.map +0 -1
- package/lib/monitors/SfuServerMonitor.js +0 -198
- package/src/ObservedICE.ts +0 -237
- package/src/ObservedInboundAudioTrack.ts +0 -344
- package/src/ObservedInboundVideoTrack.ts +0 -361
- package/src/ObservedOutboundAudioTrack.ts +0 -307
- package/src/ObservedOutboundVideoTrack.ts +0 -319
- package/src/ObservedSfu.ts +0 -231
- package/src/ObservedSfuInboundRtpPad.ts +0 -106
- package/src/ObservedSfuOutboundRtpPad.ts +0 -107
- package/src/ObservedSfuSctpChannel.ts +0 -103
- package/src/ObservedSfuTransport.ts +0 -185
- package/src/RemoteTrackAssigner.ts +0 -68
- package/src/ReportsCollector.ts +0 -336
- package/src/common/CalculatedScore.ts +0 -188
- package/src/common/CallEventType.ts +0 -69
- package/src/common/CallMetaReports.ts +0 -82
- package/src/common/QualityScoreUtils.ts +0 -0
- package/src/common/TypedEventEmitter.ts +0 -32
- package/src/common/callEventReports.ts +0 -178
- package/src/monitors/CallSummary.ts +0 -38
- package/src/monitors/CallSummaryMonitor.ts +0 -192
- package/src/monitors/ClientIssueMonitor.ts +0 -88
- package/src/monitors/SfuServerMonitor.ts +0 -285
- /package/lib/{monitors/CallSummary.js → scores/CalculatedScore.js} +0 -0
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservedSfuTransport = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
const ObservedSfuInboundRtpPad_1 = require("./ObservedSfuInboundRtpPad");
|
|
6
|
-
const ObservedSfuOutboundRtpPad_1 = require("./ObservedSfuOutboundRtpPad");
|
|
7
|
-
const ObservedSfuSctpChannel_1 = require("./ObservedSfuSctpChannel");
|
|
8
|
-
class ObservedSfuTransport extends events_1.EventEmitter {
|
|
9
|
-
constructor(_model, sfu) {
|
|
10
|
-
super();
|
|
11
|
-
this._model = _model;
|
|
12
|
-
this.sfu = sfu;
|
|
13
|
-
this.created = Date.now();
|
|
14
|
-
this._updated = Date.now();
|
|
15
|
-
this._closed = false;
|
|
16
|
-
this._inboundRtpPads = new Map();
|
|
17
|
-
this._outboundRtpPads = new Map();
|
|
18
|
-
this._sctpChannels = new Map();
|
|
19
|
-
this.setMaxListeners(Infinity);
|
|
20
|
-
}
|
|
21
|
-
get inboundRtpPads() {
|
|
22
|
-
return this._inboundRtpPads;
|
|
23
|
-
}
|
|
24
|
-
get outboundRtpPads() {
|
|
25
|
-
return this._outboundRtpPads;
|
|
26
|
-
}
|
|
27
|
-
get sctpChannels() {
|
|
28
|
-
return this._sctpChannels;
|
|
29
|
-
}
|
|
30
|
-
get serviceId() {
|
|
31
|
-
return this.sfu.serviceId;
|
|
32
|
-
}
|
|
33
|
-
get mediaUnitId() {
|
|
34
|
-
return this.sfu.mediaUnitId;
|
|
35
|
-
}
|
|
36
|
-
get sfuId() {
|
|
37
|
-
return this.sfu.sfuId;
|
|
38
|
-
}
|
|
39
|
-
get sfuTransportId() {
|
|
40
|
-
return this._model.sfuTransportId;
|
|
41
|
-
}
|
|
42
|
-
get reports() {
|
|
43
|
-
return this.sfu.reports;
|
|
44
|
-
}
|
|
45
|
-
get updated() {
|
|
46
|
-
return this._updated;
|
|
47
|
-
}
|
|
48
|
-
get marker() {
|
|
49
|
-
return this._marker;
|
|
50
|
-
}
|
|
51
|
-
set marker(value) {
|
|
52
|
-
this._marker = value;
|
|
53
|
-
this._inboundRtpPads.forEach((pad) => (pad.marker = value));
|
|
54
|
-
this._outboundRtpPads.forEach((pad) => (pad.marker = value));
|
|
55
|
-
this._sctpChannels.forEach((channel) => (channel.marker = value));
|
|
56
|
-
}
|
|
57
|
-
get closed() {
|
|
58
|
-
return this._closed;
|
|
59
|
-
}
|
|
60
|
-
close() {
|
|
61
|
-
if (this._closed)
|
|
62
|
-
return;
|
|
63
|
-
this._closed = true;
|
|
64
|
-
[...this._inboundRtpPads.values()].forEach((pad) => pad.close());
|
|
65
|
-
[...this._outboundRtpPads.values()].forEach((pad) => pad.close());
|
|
66
|
-
[...this._sctpChannels.values()].forEach((channel) => channel.close());
|
|
67
|
-
this.emit('close');
|
|
68
|
-
}
|
|
69
|
-
update(sample, timestamp) {
|
|
70
|
-
const now = Date.now();
|
|
71
|
-
const elapsedTimeInMs = now - this._updated;
|
|
72
|
-
const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId, callId: undefined, roomId: undefined }, sample), { timestamp, marker: this.marker });
|
|
73
|
-
this.reports.addSfuTransportReport(report);
|
|
74
|
-
this.stats = sample;
|
|
75
|
-
this._updated = now;
|
|
76
|
-
this.emit('update', {
|
|
77
|
-
elapsedTimeInMs,
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
createSfuOutboundRtpPad(model) {
|
|
81
|
-
if (this._closed)
|
|
82
|
-
throw new Error('Cannot create SfuOutboundRtpPad on closed SfuTransport');
|
|
83
|
-
if (this._inboundRtpPads.has(model.sfuOutboundRtpPadId))
|
|
84
|
-
throw new Error(`SfuOutboundRtpPad with id ${model.sfuOutboundRtpPadId} already exists`);
|
|
85
|
-
const result = new ObservedSfuOutboundRtpPad_1.ObservedSfuOutboundRtpPad(model, this);
|
|
86
|
-
result.once('close', () => {
|
|
87
|
-
this._outboundRtpPads.delete(model.sfuOutboundRtpPadId);
|
|
88
|
-
});
|
|
89
|
-
this._outboundRtpPads.set(model.sfuOutboundRtpPadId, result);
|
|
90
|
-
this.emit('newsfuoutboundrtppad', result);
|
|
91
|
-
return result;
|
|
92
|
-
}
|
|
93
|
-
createSfuInboundRtpPad(model) {
|
|
94
|
-
if (this._closed)
|
|
95
|
-
throw new Error('Cannot create SfuInboundRtpPad on closed SfuTransport');
|
|
96
|
-
if (this._inboundRtpPads.has(model.sfuInboundRtpPadId))
|
|
97
|
-
throw new Error(`SfuInboundRtpPad with id ${model.sfuInboundRtpPadId} already exists`);
|
|
98
|
-
const result = new ObservedSfuInboundRtpPad_1.ObservedSfuInboundRtpPad(model, this);
|
|
99
|
-
result.once('close', () => {
|
|
100
|
-
this._inboundRtpPads.delete(model.sfuInboundRtpPadId);
|
|
101
|
-
});
|
|
102
|
-
this._inboundRtpPads.set(model.sfuInboundRtpPadId, result);
|
|
103
|
-
this.emit('newsfuinboundrtppad', result);
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
createSfuSctpChannel(model) {
|
|
107
|
-
if (this._closed)
|
|
108
|
-
throw new Error('Cannot create SfuSctpChannel on closed SfuTransport');
|
|
109
|
-
if (this._sctpChannels.has(model.sfuSctpChannelId))
|
|
110
|
-
throw new Error(`SfuSctpChannel with id ${model.sfuSctpChannelId} already exists`);
|
|
111
|
-
const result = new ObservedSfuSctpChannel_1.ObservedSfuSctpChannel(model, this);
|
|
112
|
-
result.once('close', () => {
|
|
113
|
-
this._sctpChannels.delete(model.sfuSctpChannelId);
|
|
114
|
-
});
|
|
115
|
-
this._sctpChannels.set(model.sfuSctpChannelId, result);
|
|
116
|
-
this.emit('newsfusctpchannel', result);
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
exports.ObservedSfuTransport = ObservedSfuTransport;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ObservedInboundAudioTrack } from './ObservedInboundAudioTrack';
|
|
2
|
-
import { ObservedInboundVideoTrack } from './ObservedInboundVideoTrack';
|
|
3
|
-
import { ObservedOutboundAudioTrack } from './ObservedOutboundAudioTrack';
|
|
4
|
-
import { ObservedOutboundVideoTrack } from './ObservedOutboundVideoTrack';
|
|
5
|
-
export declare class RemoteTrackAssigner {
|
|
6
|
-
readonly sfuStreamIdToOutboundVideoTracks: Map<string, ObservedOutboundVideoTrack>;
|
|
7
|
-
readonly sfuStreamIdToOutboundAudioTracks: Map<string, ObservedOutboundAudioTrack>;
|
|
8
|
-
readonly pendingInboundVideoTracks: Map<string, ObservedInboundVideoTrack[]>;
|
|
9
|
-
readonly pendingInboundAudioTracks: Map<string, ObservedInboundAudioTrack[]>;
|
|
10
|
-
addOutboundAudioTrack(track: ObservedOutboundAudioTrack): void;
|
|
11
|
-
addOutboundVideoTrack(track: ObservedOutboundVideoTrack): void;
|
|
12
|
-
addInboundAudioTrack(track: ObservedInboundAudioTrack): void;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=RemoteTrackAssigner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteTrackAssigner.d.ts","sourceRoot":"","sources":["../src/RemoteTrackAssigner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,qBAAa,mBAAmB;IAC/B,SAAgB,gCAAgC,0CAAiD;IACjG,SAAgB,gCAAgC,0CAAiD;IACjG,SAAgB,yBAAyB,2CAAkD;IAC3F,SAAgB,yBAAyB,2CAAkD;IAEpF,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAcvD,qBAAqB,CAAC,KAAK,EAAE,0BAA0B;IAcvD,oBAAoB,CAAC,KAAK,EAAE,yBAAyB;CA4B5D"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RemoteTrackAssigner = void 0;
|
|
4
|
-
class RemoteTrackAssigner {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.sfuStreamIdToOutboundVideoTracks = new Map();
|
|
7
|
-
this.sfuStreamIdToOutboundAudioTracks = new Map();
|
|
8
|
-
this.pendingInboundVideoTracks = new Map();
|
|
9
|
-
this.pendingInboundAudioTracks = new Map();
|
|
10
|
-
}
|
|
11
|
-
addOutboundAudioTrack(track) {
|
|
12
|
-
const untilSfuStreamIdListener = () => {
|
|
13
|
-
if (!track.sfuStreamId)
|
|
14
|
-
return;
|
|
15
|
-
this.sfuStreamIdToOutboundAudioTracks.set(track.sfuStreamId, track);
|
|
16
|
-
track.off('update', untilSfuStreamIdListener);
|
|
17
|
-
// we need to assign to the pending inbound tracks
|
|
18
|
-
};
|
|
19
|
-
track.on('update', untilSfuStreamIdListener);
|
|
20
|
-
untilSfuStreamIdListener();
|
|
21
|
-
}
|
|
22
|
-
addOutboundVideoTrack(track) {
|
|
23
|
-
const untilSfuStreamIdListener = () => {
|
|
24
|
-
if (!track.sfuStreamId)
|
|
25
|
-
return;
|
|
26
|
-
this.sfuStreamIdToOutboundVideoTracks.set(track.sfuStreamId, track);
|
|
27
|
-
track.off('update', untilSfuStreamIdListener);
|
|
28
|
-
// we need to assign to the pending inbound tracks
|
|
29
|
-
};
|
|
30
|
-
track.on('update', untilSfuStreamIdListener);
|
|
31
|
-
untilSfuStreamIdListener();
|
|
32
|
-
}
|
|
33
|
-
addInboundAudioTrack(track) {
|
|
34
|
-
const untilSfuStreamIdListener = () => {
|
|
35
|
-
if (!track.sfuStreamId)
|
|
36
|
-
return;
|
|
37
|
-
const outboundTrack = this.sfuStreamIdToOutboundAudioTracks.get(track.sfuStreamId);
|
|
38
|
-
if (!outboundTrack) {
|
|
39
|
-
this.pendingInboundAudioTracks.set(track.sfuStreamId, (this.pendingInboundAudioTracks.get(track.sfuStreamId) || []).concat(track));
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
if (outboundTrack) {
|
|
43
|
-
track.remoteOutboundTrack = outboundTrack;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
this.pendingInboundAudioTracks.set(track.sfuStreamId, (this.pendingInboundAudioTracks.get(track.sfuStreamId) || []).concat(track));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
track.on('update', untilSfuStreamIdListener);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.RemoteTrackAssigner = RemoteTrackAssigner;
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
|
|
2
|
-
import { ObserverSinkContext } from './common/types';
|
|
3
|
-
export type SinkEventsMap = {
|
|
4
|
-
'call-event': {
|
|
5
|
-
reports: CallEventReport[];
|
|
6
|
-
};
|
|
7
|
-
'call-meta': {
|
|
8
|
-
reports: CallMetaReport[];
|
|
9
|
-
};
|
|
10
|
-
'client-data-channel': {
|
|
11
|
-
reports: ClientDataChannelReport[];
|
|
12
|
-
};
|
|
13
|
-
'client-extension': {
|
|
14
|
-
reports: ClientExtensionReport[];
|
|
15
|
-
};
|
|
16
|
-
'ice-candidate-pair': {
|
|
17
|
-
reports: IceCandidatePairReport[];
|
|
18
|
-
};
|
|
19
|
-
'peer-connection-transport': {
|
|
20
|
-
reports: PeerConnectionTransportReport[];
|
|
21
|
-
};
|
|
22
|
-
'inbound-audio-track': {
|
|
23
|
-
reports: InboundAudioTrackReport[];
|
|
24
|
-
};
|
|
25
|
-
'inbound-video-track': {
|
|
26
|
-
reports: InboundVideoTrackReport[];
|
|
27
|
-
};
|
|
28
|
-
'observer-event': {
|
|
29
|
-
reports: ObserverEventReport[];
|
|
30
|
-
};
|
|
31
|
-
'outbound-audio-track': {
|
|
32
|
-
reports: OutboundAudioTrackReport[];
|
|
33
|
-
};
|
|
34
|
-
'outbound-video-track': {
|
|
35
|
-
reports: OutboundVideoTrackReport[];
|
|
36
|
-
};
|
|
37
|
-
'sfu-event': {
|
|
38
|
-
reports: SfuEventReport[];
|
|
39
|
-
};
|
|
40
|
-
'sfu-extension': {
|
|
41
|
-
reports: SfuExtensionReport[];
|
|
42
|
-
};
|
|
43
|
-
'sfu-inbound-rtp-pad': {
|
|
44
|
-
reports: SfuInboundRtpPadReport[];
|
|
45
|
-
};
|
|
46
|
-
'sfu-outbound-rtp-pad': {
|
|
47
|
-
reports: SfuOutboundRtpPadReport[];
|
|
48
|
-
};
|
|
49
|
-
'sfu-sctp-stream': {
|
|
50
|
-
reports: SfuSctpStreamReport[];
|
|
51
|
-
};
|
|
52
|
-
'sfu-transport': {
|
|
53
|
-
reports: SFUTransportReport[];
|
|
54
|
-
};
|
|
55
|
-
'sfu-meta': {
|
|
56
|
-
reports: SfuMetaReport[];
|
|
57
|
-
};
|
|
58
|
-
'reports': ObserverSinkContext;
|
|
59
|
-
'newreport': number;
|
|
60
|
-
};
|
|
61
|
-
export type ObserverSinkProcess = (observerSinkContext: ObserverSinkContext) => Promise<void>;
|
|
62
|
-
export declare class ReportsCollector {
|
|
63
|
-
private _collectedReports;
|
|
64
|
-
private _emitter;
|
|
65
|
-
private _callEventReports;
|
|
66
|
-
private _callMetaReports;
|
|
67
|
-
private _clientDataChannelReports;
|
|
68
|
-
private _clientExtensionReports;
|
|
69
|
-
private _iceCandidatePairReports;
|
|
70
|
-
private _inboundAudioTrackReports;
|
|
71
|
-
private _inboundVideoTrackReports;
|
|
72
|
-
private _peerConnectionTransportReports;
|
|
73
|
-
private _observerEventReports;
|
|
74
|
-
private _outboundAudioTrackReports;
|
|
75
|
-
private _outboundVideoTrackReports;
|
|
76
|
-
private _sfuEventReports;
|
|
77
|
-
private _sfuExtensionReports;
|
|
78
|
-
private _sfuInboundRtpPadReports;
|
|
79
|
-
private _sfuOutboundRtpPadReports;
|
|
80
|
-
private _sfuSctpStreamReports;
|
|
81
|
-
private _sfuTransportReports;
|
|
82
|
-
private _sfuMetaReports;
|
|
83
|
-
constructor();
|
|
84
|
-
on<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
85
|
-
off<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
86
|
-
once<K extends keyof SinkEventsMap>(event: K, listener: (reports: SinkEventsMap[K]) => void): this;
|
|
87
|
-
addCallEventReport(report: CallEventReport): void;
|
|
88
|
-
addCallMetaReport(report: CallMetaReport): void;
|
|
89
|
-
addClientDataChannelReport(report: ClientDataChannelReport): void;
|
|
90
|
-
addClientExtensionReport(report: ClientExtensionReport): void;
|
|
91
|
-
addIceCandidatePairReport(report: IceCandidatePairReport): void;
|
|
92
|
-
addInboundAudioTrackReport(report: InboundAudioTrackReport): void;
|
|
93
|
-
addInboundVideoTrackReport(report: InboundVideoTrackReport): void;
|
|
94
|
-
addPeerConnectionTransportReports(report: PeerConnectionTransportReport): void;
|
|
95
|
-
addObserverEventReport(report: ObserverEventReport): void;
|
|
96
|
-
addOutboundAudioTrackReport(report: OutboundAudioTrackReport): void;
|
|
97
|
-
addOutboundVideoTrackReport(report: OutboundVideoTrackReport): void;
|
|
98
|
-
addSfuEventReport(report: SfuEventReport): void;
|
|
99
|
-
addSfuExtensionReport(report: SfuExtensionReport): void;
|
|
100
|
-
addSfuInboundRtpPadReport(report: SfuInboundRtpPadReport): void;
|
|
101
|
-
addSfuOutboundRtpPadReport(report: SfuOutboundRtpPadReport): void;
|
|
102
|
-
addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
|
|
103
|
-
addSfuTransportReport(report: SFUTransportReport): void;
|
|
104
|
-
addSfuMetaReport(report: SfuMetaReport): void;
|
|
105
|
-
emit(): number;
|
|
106
|
-
private _emit;
|
|
107
|
-
private _createObserverSinkContext;
|
|
108
|
-
}
|
|
109
|
-
//# sourceMappingURL=ReportsCollector.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../src/ReportsCollector.ts"],"names":[],"mappings":"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"}
|
package/lib/ReportsCollector.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReportsCollector = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
class ReportsCollector {
|
|
6
|
-
constructor() {
|
|
7
|
-
this._collectedReports = 0;
|
|
8
|
-
this._emitter = new events_1.EventEmitter();
|
|
9
|
-
this._callEventReports = [];
|
|
10
|
-
this._callMetaReports = [];
|
|
11
|
-
this._clientDataChannelReports = [];
|
|
12
|
-
this._clientExtensionReports = [];
|
|
13
|
-
this._iceCandidatePairReports = [];
|
|
14
|
-
this._inboundAudioTrackReports = [];
|
|
15
|
-
this._inboundVideoTrackReports = [];
|
|
16
|
-
this._peerConnectionTransportReports = [];
|
|
17
|
-
this._observerEventReports = [];
|
|
18
|
-
this._outboundAudioTrackReports = [];
|
|
19
|
-
this._outboundVideoTrackReports = [];
|
|
20
|
-
this._sfuEventReports = [];
|
|
21
|
-
this._sfuExtensionReports = [];
|
|
22
|
-
this._sfuInboundRtpPadReports = [];
|
|
23
|
-
this._sfuOutboundRtpPadReports = [];
|
|
24
|
-
this._sfuSctpStreamReports = [];
|
|
25
|
-
this._sfuTransportReports = [];
|
|
26
|
-
this._sfuMetaReports = [];
|
|
27
|
-
// empty
|
|
28
|
-
}
|
|
29
|
-
on(event, listener) {
|
|
30
|
-
this._emitter.addListener(event, listener);
|
|
31
|
-
return this;
|
|
32
|
-
}
|
|
33
|
-
off(event, listener) {
|
|
34
|
-
this._emitter.removeListener(event, listener);
|
|
35
|
-
return this;
|
|
36
|
-
}
|
|
37
|
-
once(event, listener) {
|
|
38
|
-
this._emitter.once(event, listener);
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
addCallEventReport(report) {
|
|
42
|
-
this._callEventReports.push(report);
|
|
43
|
-
this._emit('newreport', ++this._collectedReports);
|
|
44
|
-
}
|
|
45
|
-
addCallMetaReport(report) {
|
|
46
|
-
this._callMetaReports.push(report);
|
|
47
|
-
this._emit('newreport', ++this._collectedReports);
|
|
48
|
-
}
|
|
49
|
-
addClientDataChannelReport(report) {
|
|
50
|
-
this._clientDataChannelReports.push(report);
|
|
51
|
-
this._emit('newreport', ++this._collectedReports);
|
|
52
|
-
}
|
|
53
|
-
addClientExtensionReport(report) {
|
|
54
|
-
this._clientExtensionReports.push(report);
|
|
55
|
-
this._emit('newreport', ++this._collectedReports);
|
|
56
|
-
}
|
|
57
|
-
addIceCandidatePairReport(report) {
|
|
58
|
-
this._iceCandidatePairReports.push(report);
|
|
59
|
-
this._emit('newreport', ++this._collectedReports);
|
|
60
|
-
}
|
|
61
|
-
addInboundAudioTrackReport(report) {
|
|
62
|
-
this._inboundAudioTrackReports.push(report);
|
|
63
|
-
this._emit('newreport', ++this._collectedReports);
|
|
64
|
-
}
|
|
65
|
-
addInboundVideoTrackReport(report) {
|
|
66
|
-
this._inboundVideoTrackReports.push(report);
|
|
67
|
-
this._emit('newreport', ++this._collectedReports);
|
|
68
|
-
}
|
|
69
|
-
addPeerConnectionTransportReports(report) {
|
|
70
|
-
this._peerConnectionTransportReports.push(report);
|
|
71
|
-
this._emit('newreport', ++this._collectedReports);
|
|
72
|
-
}
|
|
73
|
-
addObserverEventReport(report) {
|
|
74
|
-
this._observerEventReports.push(report);
|
|
75
|
-
this._emit('newreport', ++this._collectedReports);
|
|
76
|
-
}
|
|
77
|
-
addOutboundAudioTrackReport(report) {
|
|
78
|
-
this._outboundAudioTrackReports.push(report);
|
|
79
|
-
this._emit('newreport', ++this._collectedReports);
|
|
80
|
-
}
|
|
81
|
-
addOutboundVideoTrackReport(report) {
|
|
82
|
-
this._outboundVideoTrackReports.push(report);
|
|
83
|
-
this._emit('newreport', ++this._collectedReports);
|
|
84
|
-
}
|
|
85
|
-
addSfuEventReport(report) {
|
|
86
|
-
this._sfuEventReports.push(report);
|
|
87
|
-
this._emit('newreport', ++this._collectedReports);
|
|
88
|
-
}
|
|
89
|
-
addSfuExtensionReport(report) {
|
|
90
|
-
this._sfuExtensionReports.push(report);
|
|
91
|
-
this._emit('newreport', ++this._collectedReports);
|
|
92
|
-
}
|
|
93
|
-
addSfuInboundRtpPadReport(report) {
|
|
94
|
-
this._sfuInboundRtpPadReports.push(report);
|
|
95
|
-
this._emit('newreport', ++this._collectedReports);
|
|
96
|
-
}
|
|
97
|
-
addSfuOutboundRtpPadReport(report) {
|
|
98
|
-
this._sfuOutboundRtpPadReports.push(report);
|
|
99
|
-
this._emit('newreport', ++this._collectedReports);
|
|
100
|
-
}
|
|
101
|
-
addSfuSctpStreamReport(report) {
|
|
102
|
-
this._sfuSctpStreamReports.push(report);
|
|
103
|
-
this._emit('newreport', ++this._collectedReports);
|
|
104
|
-
}
|
|
105
|
-
addSfuTransportReport(report) {
|
|
106
|
-
this._sfuTransportReports.push(report);
|
|
107
|
-
this._emit('newreport', ++this._collectedReports);
|
|
108
|
-
}
|
|
109
|
-
addSfuMetaReport(report) {
|
|
110
|
-
this._sfuMetaReports.push(report);
|
|
111
|
-
this._emit('newreport', ++this._collectedReports);
|
|
112
|
-
}
|
|
113
|
-
emit() {
|
|
114
|
-
let result = 0;
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
|
-
const checkAndEmit = (eventName, reports) => {
|
|
117
|
-
if (0 < reports.length) {
|
|
118
|
-
this._emit(eventName, { reports });
|
|
119
|
-
result += reports.length;
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
const context = this._createObserverSinkContext();
|
|
123
|
-
checkAndEmit('call-event', this._callEventReports);
|
|
124
|
-
this._callEventReports = [];
|
|
125
|
-
checkAndEmit('call-meta', this._callMetaReports);
|
|
126
|
-
this._callMetaReports = [];
|
|
127
|
-
checkAndEmit('client-data-channel', this._clientDataChannelReports);
|
|
128
|
-
this._clientDataChannelReports = [];
|
|
129
|
-
checkAndEmit('client-extension', this._clientExtensionReports);
|
|
130
|
-
this._clientExtensionReports = [];
|
|
131
|
-
checkAndEmit('ice-candidate-pair', this._iceCandidatePairReports);
|
|
132
|
-
this._iceCandidatePairReports = [];
|
|
133
|
-
checkAndEmit('inbound-audio-track', this._inboundAudioTrackReports);
|
|
134
|
-
this._inboundAudioTrackReports = [];
|
|
135
|
-
checkAndEmit('inbound-video-track', this._inboundVideoTrackReports);
|
|
136
|
-
this._inboundVideoTrackReports = [];
|
|
137
|
-
checkAndEmit('peer-connection-transport', this._peerConnectionTransportReports);
|
|
138
|
-
this._peerConnectionTransportReports = [];
|
|
139
|
-
checkAndEmit('observer-event', this._observerEventReports);
|
|
140
|
-
this._observerEventReports = [];
|
|
141
|
-
checkAndEmit('outbound-audio-track', this._outboundAudioTrackReports);
|
|
142
|
-
this._outboundAudioTrackReports = [];
|
|
143
|
-
checkAndEmit('outbound-video-track', this._outboundVideoTrackReports);
|
|
144
|
-
this._outboundVideoTrackReports = [];
|
|
145
|
-
checkAndEmit('sfu-event', this._sfuEventReports);
|
|
146
|
-
this._sfuEventReports = [];
|
|
147
|
-
checkAndEmit('sfu-extension', this._sfuExtensionReports);
|
|
148
|
-
this._sfuExtensionReports = [];
|
|
149
|
-
checkAndEmit('sfu-inbound-rtp-pad', this._sfuInboundRtpPadReports);
|
|
150
|
-
this._sfuInboundRtpPadReports = [];
|
|
151
|
-
checkAndEmit('sfu-outbound-rtp-pad', this._sfuOutboundRtpPadReports);
|
|
152
|
-
this._sfuOutboundRtpPadReports = [];
|
|
153
|
-
checkAndEmit('sfu-sctp-stream', this._sfuSctpStreamReports);
|
|
154
|
-
this._sfuSctpStreamReports = [];
|
|
155
|
-
checkAndEmit('sfu-transport', this._sfuTransportReports);
|
|
156
|
-
this._sfuTransportReports = [];
|
|
157
|
-
checkAndEmit('sfu-meta', this._sfuMetaReports);
|
|
158
|
-
this._sfuMetaReports = [];
|
|
159
|
-
this._emit('reports', context);
|
|
160
|
-
this._collectedReports = 0;
|
|
161
|
-
return result;
|
|
162
|
-
}
|
|
163
|
-
_emit(event, reports) {
|
|
164
|
-
return this._emitter.emit(event, reports);
|
|
165
|
-
}
|
|
166
|
-
_createObserverSinkContext() {
|
|
167
|
-
const callEventReports = [...this._callEventReports];
|
|
168
|
-
const callMetaReports = [...this._callMetaReports];
|
|
169
|
-
const clientDataChannelReports = [...this._clientDataChannelReports];
|
|
170
|
-
const clientExtensionReports = [...this._clientExtensionReports];
|
|
171
|
-
const iceCandidatePairReports = [...this._iceCandidatePairReports];
|
|
172
|
-
const inboundAudioTrackReports = [...this._inboundAudioTrackReports];
|
|
173
|
-
const inboundVideoTrackReports = [...this._inboundVideoTrackReports];
|
|
174
|
-
const peerConnectionTransportReports = [...this._peerConnectionTransportReports];
|
|
175
|
-
const observerEventReports = [...this._observerEventReports];
|
|
176
|
-
const outboundAudioTrackReports = [...this._outboundAudioTrackReports];
|
|
177
|
-
const outboundVideoTrackReports = [...this._outboundVideoTrackReports];
|
|
178
|
-
const sfuEventReports = [...this._sfuEventReports];
|
|
179
|
-
const sfuExtensionReports = [...this._sfuExtensionReports];
|
|
180
|
-
const sfuInboundRtpPadReports = [...this._sfuInboundRtpPadReports];
|
|
181
|
-
const sfuOutboundRtpPadReports = [...this._sfuOutboundRtpPadReports];
|
|
182
|
-
const sfuSctpStreamReports = [...this._sfuSctpStreamReports];
|
|
183
|
-
const sfuTransportReports = [...this._sfuTransportReports];
|
|
184
|
-
const sfuMetaReports = [...this._sfuMetaReports];
|
|
185
|
-
return {
|
|
186
|
-
callEventReports,
|
|
187
|
-
callMetaReports,
|
|
188
|
-
clientDataChannelReports,
|
|
189
|
-
clientExtensionReports,
|
|
190
|
-
iceCandidatePairReports,
|
|
191
|
-
inboundAudioTrackReports,
|
|
192
|
-
inboundVideoTrackReports,
|
|
193
|
-
peerConnectionTransportReports,
|
|
194
|
-
observerEventReports,
|
|
195
|
-
outboundAudioTrackReports,
|
|
196
|
-
outboundVideoTrackReports,
|
|
197
|
-
sfuEventReports,
|
|
198
|
-
sfuExtensionReports,
|
|
199
|
-
sfuInboundRtpPadReports,
|
|
200
|
-
sfuOutboundRtpPadReports,
|
|
201
|
-
sfuSctpStreamReports,
|
|
202
|
-
sfuTransportReports,
|
|
203
|
-
sfuMetaReports,
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
exports.ReportsCollector = ReportsCollector;
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { ClientIssue } from '../monitors/CallSummary';
|
|
2
|
-
import { ObservedInboundVideoTrack } from '../ObservedInboundVideoTrack';
|
|
3
|
-
import { ObservedInboundAudioTrack } from '../ObservedInboundAudioTrack';
|
|
4
|
-
import { ObservedOutboundVideoTrack } from '../ObservedOutboundVideoTrack';
|
|
5
|
-
import { ObservedOutboundAudioTrack } from '../ObservedOutboundAudioTrack';
|
|
6
|
-
export type CalculationRemark = {
|
|
7
|
-
severity: 'none' | 'minor' | 'major' | 'critical';
|
|
8
|
-
text: string;
|
|
9
|
-
};
|
|
10
|
-
export type CalculatedScore = {
|
|
11
|
-
score: number;
|
|
12
|
-
timestamp: number;
|
|
13
|
-
remarks: CalculationRemark[];
|
|
14
|
-
debugText?: string;
|
|
15
|
-
};
|
|
16
|
-
export declare const BPP_RANGES: {
|
|
17
|
-
lowmotion: {
|
|
18
|
-
h264: {
|
|
19
|
-
low: number;
|
|
20
|
-
high: number;
|
|
21
|
-
};
|
|
22
|
-
h265: {
|
|
23
|
-
low: number;
|
|
24
|
-
high: number;
|
|
25
|
-
};
|
|
26
|
-
vp8: {
|
|
27
|
-
low: number;
|
|
28
|
-
high: number;
|
|
29
|
-
};
|
|
30
|
-
vp9: {
|
|
31
|
-
low: number;
|
|
32
|
-
high: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
standard: {
|
|
36
|
-
h264: {
|
|
37
|
-
low: number;
|
|
38
|
-
high: number;
|
|
39
|
-
};
|
|
40
|
-
h265: {
|
|
41
|
-
low: number;
|
|
42
|
-
high: number;
|
|
43
|
-
};
|
|
44
|
-
vp8: {
|
|
45
|
-
low: number;
|
|
46
|
-
high: number;
|
|
47
|
-
};
|
|
48
|
-
vp9: {
|
|
49
|
-
low: number;
|
|
50
|
-
high: number;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
highmotion: {
|
|
54
|
-
h264: {
|
|
55
|
-
low: number;
|
|
56
|
-
high: number;
|
|
57
|
-
};
|
|
58
|
-
h265: {
|
|
59
|
-
low: number;
|
|
60
|
-
high: number;
|
|
61
|
-
};
|
|
62
|
-
vp8: {
|
|
63
|
-
low: number;
|
|
64
|
-
high: number;
|
|
65
|
-
};
|
|
66
|
-
vp9: {
|
|
67
|
-
low: number;
|
|
68
|
-
high: number;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
};
|
|
72
|
-
export declare function calculateBaseVideoScore(track: ObservedInboundVideoTrack | ObservedOutboundVideoTrack, newIssues: ClientIssue[]): CalculatedScore | undefined;
|
|
73
|
-
export declare function calculateBaseAudioScore(track: ObservedInboundAudioTrack | ObservedOutboundAudioTrack, newIssues: ClientIssue[]): CalculatedScore | undefined;
|
|
74
|
-
export declare function calculateLatencyMOS({ avgJitter, rttInMs, packetsLoss }: {
|
|
75
|
-
avgJitter: number;
|
|
76
|
-
rttInMs: number;
|
|
77
|
-
packetsLoss: number;
|
|
78
|
-
}): number;
|
|
79
|
-
export declare function getRttScore(x: number): number;
|
|
80
|
-
//# sourceMappingURL=CalculatedScore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CalculatedScore.d.ts","sourceRoot":"","sources":["../../src/common/CalculatedScore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC/B,QAAQ,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;IAClD,IAAI,EAAE,MAAM,CAAC;CACb,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB,CAAA;AAmBD,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,yBAAyB,GAAG,0BAA0B,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,eAAe,GAAG,SAAS,CAiE5J;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,yBAAyB,GAAG,0BAA0B,EAAE,SAAS,EAAE,WAAW,EAAE,GAAG,eAAe,GAAG,SAAS,CA0C5J;AAED,wBAAgB,mBAAmB,CAClC,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,EACnC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACzD,MAAM,CASR;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAM7C"}
|