@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
package/lib/ObservedSfu.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ObservedSfu = void 0;
|
|
15
|
-
const events_1 = require("events");
|
|
16
|
-
const ObservedSfuTransport_1 = require("./ObservedSfuTransport");
|
|
17
|
-
class ObservedSfu extends events_1.EventEmitter {
|
|
18
|
-
constructor(_model, observer, appData) {
|
|
19
|
-
super();
|
|
20
|
-
this._model = _model;
|
|
21
|
-
this.observer = observer;
|
|
22
|
-
this.appData = appData;
|
|
23
|
-
this.created = Date.now();
|
|
24
|
-
this._updated = Date.now();
|
|
25
|
-
this._closed = false;
|
|
26
|
-
this._transports = new Map();
|
|
27
|
-
this.setMaxListeners(Infinity);
|
|
28
|
-
}
|
|
29
|
-
get marker() {
|
|
30
|
-
return this._marker;
|
|
31
|
-
}
|
|
32
|
-
get reports() {
|
|
33
|
-
return this.observer.reports;
|
|
34
|
-
}
|
|
35
|
-
get serviceId() {
|
|
36
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
37
|
-
return this._model.serviceId;
|
|
38
|
-
}
|
|
39
|
-
get mediaUnitId() {
|
|
40
|
-
return this._model.mediaUnitId;
|
|
41
|
-
}
|
|
42
|
-
get sfuId() {
|
|
43
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
44
|
-
return this._model.sfuId;
|
|
45
|
-
}
|
|
46
|
-
get joined() {
|
|
47
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
48
|
-
return Number(this._model.joined);
|
|
49
|
-
}
|
|
50
|
-
get transports() {
|
|
51
|
-
return this._transports;
|
|
52
|
-
}
|
|
53
|
-
get updated() {
|
|
54
|
-
return this._updated;
|
|
55
|
-
}
|
|
56
|
-
get closed() {
|
|
57
|
-
return this._closed;
|
|
58
|
-
}
|
|
59
|
-
close() {
|
|
60
|
-
if (this._closed)
|
|
61
|
-
return;
|
|
62
|
-
this._closed = true;
|
|
63
|
-
[...this._transports.values()].forEach((transport) => transport.close());
|
|
64
|
-
this.emit('close');
|
|
65
|
-
}
|
|
66
|
-
addEventReport(params) {
|
|
67
|
-
var _a;
|
|
68
|
-
const { attachments } = params, fields = __rest(params, ["attachments"]);
|
|
69
|
-
this.reports.addCallEventReport(Object.assign(Object.assign({}, fields), { serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, marker: this.marker, timestamp: (_a = params.timestamp) !== null && _a !== void 0 ? _a : Date.now(), attachments: attachments ? JSON.stringify(attachments) : undefined }));
|
|
70
|
-
}
|
|
71
|
-
addExtensionStatsReport(extensionType, payload) {
|
|
72
|
-
this.reports.addSfuExtensionReport({
|
|
73
|
-
serviceId: this.serviceId,
|
|
74
|
-
mediaUnitId: this.mediaUnitId,
|
|
75
|
-
timestamp: Date.now(),
|
|
76
|
-
extensionType,
|
|
77
|
-
payload: payload ? JSON.stringify(payload) : undefined,
|
|
78
|
-
marker: this.marker,
|
|
79
|
-
sfuId: this.sfuId,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
update(sample) {
|
|
83
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
84
|
-
if (this._closed)
|
|
85
|
-
throw new Error(`Sfu ${this.sfuId} is closed`);
|
|
86
|
-
if (sample.sfuId !== this.sfuId)
|
|
87
|
-
throw new Error(`Sfu ${this.sfuId} is not the same as sample.sfuId`);
|
|
88
|
-
if (!this._timeZoneOffsetInHours && sample.timeZoneOffsetInHours) {
|
|
89
|
-
this._timeZoneOffsetInHours = sample.timeZoneOffsetInHours;
|
|
90
|
-
}
|
|
91
|
-
this._marker = sample.marker;
|
|
92
|
-
const now = Date.now();
|
|
93
|
-
const elapsedTimeInMs = now - this._updated;
|
|
94
|
-
for (const customSfuEvents of (_a = sample.customSfuEvents) !== null && _a !== void 0 ? _a : []) {
|
|
95
|
-
const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId }, customSfuEvents), { timestamp: sample.timestamp, marker: this._marker });
|
|
96
|
-
this.reports.addSfuEventReport(report);
|
|
97
|
-
}
|
|
98
|
-
for (const extensionStats of (_b = sample.extensionStats) !== null && _b !== void 0 ? _b : []) {
|
|
99
|
-
const report = {
|
|
100
|
-
serviceId: this.serviceId,
|
|
101
|
-
mediaUnitId: this.mediaUnitId,
|
|
102
|
-
sfuId: this.sfuId,
|
|
103
|
-
extensionType: extensionStats.type,
|
|
104
|
-
payload: extensionStats.payload,
|
|
105
|
-
timestamp: sample.timestamp,
|
|
106
|
-
};
|
|
107
|
-
this.reports.addSfuExtensionReport(report);
|
|
108
|
-
}
|
|
109
|
-
for (const transport of (_c = sample.transports) !== null && _c !== void 0 ? _c : []) {
|
|
110
|
-
const observedSfuTransport = (_d = this._transports.get(transport.transportId)) !== null && _d !== void 0 ? _d : this._createTransport({
|
|
111
|
-
sfuTransportId: transport.transportId,
|
|
112
|
-
});
|
|
113
|
-
observedSfuTransport.update(transport, sample.timestamp);
|
|
114
|
-
}
|
|
115
|
-
for (const inboundRtpPad of (_e = sample.inboundRtpPads) !== null && _e !== void 0 ? _e : []) {
|
|
116
|
-
const transport = (_f = this._transports.get(inboundRtpPad.transportId)) !== null && _f !== void 0 ? _f : this._createTransport({
|
|
117
|
-
sfuTransportId: inboundRtpPad.transportId,
|
|
118
|
-
});
|
|
119
|
-
const observedSfuInboundRtpPad = (_g = transport.inboundRtpPads.get(inboundRtpPad.padId)) !== null && _g !== void 0 ? _g : transport.createSfuInboundRtpPad({
|
|
120
|
-
sfuInboundRtpPadId: inboundRtpPad.padId,
|
|
121
|
-
});
|
|
122
|
-
observedSfuInboundRtpPad.update(inboundRtpPad, sample.timestamp);
|
|
123
|
-
}
|
|
124
|
-
for (const outboundRtpPad of (_h = sample.outboundRtpPads) !== null && _h !== void 0 ? _h : []) {
|
|
125
|
-
const transport = (_j = this._transports.get(outboundRtpPad.transportId)) !== null && _j !== void 0 ? _j : this._createTransport({
|
|
126
|
-
sfuTransportId: outboundRtpPad.transportId,
|
|
127
|
-
});
|
|
128
|
-
const observedSfuOutboundRtpPad = (_k = transport.outboundRtpPads.get(outboundRtpPad.padId)) !== null && _k !== void 0 ? _k : transport.createSfuOutboundRtpPad({
|
|
129
|
-
sfuOutboundRtpPadId: outboundRtpPad.padId,
|
|
130
|
-
});
|
|
131
|
-
observedSfuOutboundRtpPad.update(outboundRtpPad, sample.timestamp);
|
|
132
|
-
}
|
|
133
|
-
for (const sctpChannel of (_l = sample.sctpChannels) !== null && _l !== void 0 ? _l : []) {
|
|
134
|
-
const transport = (_m = this._transports.get(sctpChannel.transportId)) !== null && _m !== void 0 ? _m : this._createTransport({
|
|
135
|
-
sfuTransportId: sctpChannel.transportId,
|
|
136
|
-
});
|
|
137
|
-
const observedSfuSctpChannel = (_o = transport.sctpChannels.get(sctpChannel.channelId)) !== null && _o !== void 0 ? _o : transport.createSfuSctpChannel({
|
|
138
|
-
sfuSctpChannelId: sctpChannel.channelId,
|
|
139
|
-
});
|
|
140
|
-
observedSfuSctpChannel.update(sctpChannel, sample.timestamp);
|
|
141
|
-
}
|
|
142
|
-
this._updated = now;
|
|
143
|
-
this.emit('update', {
|
|
144
|
-
elapsedTimeInMs,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
_createTransport(model) {
|
|
148
|
-
const result = new ObservedSfuTransport_1.ObservedSfuTransport(model, this);
|
|
149
|
-
result.once('close', () => {
|
|
150
|
-
this._transports.delete(model.sfuTransportId);
|
|
151
|
-
});
|
|
152
|
-
this._transports.set(model.sfuTransportId, result);
|
|
153
|
-
this.emit('newtransport', result);
|
|
154
|
-
return result;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
exports.ObservedSfu = ObservedSfu;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { SfuInboundRtpPad } from '@observertc/sample-schemas-js';
|
|
4
|
-
import { ObservedSfuTransport } from './ObservedSfuTransport';
|
|
5
|
-
export type ObservedSfuInboundRtpPadModel = {
|
|
6
|
-
sfuInboundRtpPadId: string;
|
|
7
|
-
};
|
|
8
|
-
export type ObservedSfuInboundRtpPadEvents = {
|
|
9
|
-
update: [
|
|
10
|
-
{
|
|
11
|
-
elapsedTimeInMs: number;
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
close: [];
|
|
15
|
-
};
|
|
16
|
-
export declare interface ObservedSfuInboundRtpPad {
|
|
17
|
-
on<U extends keyof ObservedSfuInboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuInboundRtpPadEvents[U]) => void): this;
|
|
18
|
-
off<U extends keyof ObservedSfuInboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuInboundRtpPadEvents[U]) => void): this;
|
|
19
|
-
once<U extends keyof ObservedSfuInboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuInboundRtpPadEvents[U]) => void): this;
|
|
20
|
-
emit<U extends keyof ObservedSfuInboundRtpPadEvents>(event: U, ...args: ObservedSfuInboundRtpPadEvents[U]): boolean;
|
|
21
|
-
update(sample: SfuInboundRtpPad, timestamp: number): void;
|
|
22
|
-
}
|
|
23
|
-
export declare class ObservedSfuInboundRtpPad extends EventEmitter {
|
|
24
|
-
private readonly _model;
|
|
25
|
-
readonly transport: ObservedSfuTransport;
|
|
26
|
-
readonly created: number;
|
|
27
|
-
stats?: SfuInboundRtpPad;
|
|
28
|
-
marker?: string;
|
|
29
|
-
private _updated;
|
|
30
|
-
private _closed;
|
|
31
|
-
constructor(_model: ObservedSfuInboundRtpPadModel, transport: ObservedSfuTransport);
|
|
32
|
-
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
33
|
-
get serviceId(): string;
|
|
34
|
-
get mediaUnitId(): string;
|
|
35
|
-
get sfuId(): string;
|
|
36
|
-
get sfuTransportId(): string;
|
|
37
|
-
get sfuRtpPadId(): string;
|
|
38
|
-
get updated(): number;
|
|
39
|
-
get closed(): boolean;
|
|
40
|
-
close(): void;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ObservedSfuInboundRtpPad.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedSfuInboundRtpPad.d.ts","sourceRoot":"","sources":["../src/ObservedSfuInboundRtpPad.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;A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AO,CAAC,OAAO,CAAS;gBAGN,MAAM,EAAE,6BAA6B,EACtC,SAAS,EAAE,oBAAoB;IAMhD,IAAW,OAAO,kDAEjB;IAED,IAAW,SAAS,WAEnB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,KAAK,WAEf;IAED,IAAW,cAAc,WAExB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,OAAO,WAEjB;IAED,IAAW,MAAM,YAEhB;IAEM,KAAK;CAgCZ"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ObservedSfuInboundRtpPad = void 0;
|
|
15
|
-
const events_1 = require("events");
|
|
16
|
-
class ObservedSfuInboundRtpPad extends events_1.EventEmitter {
|
|
17
|
-
constructor(_model, transport) {
|
|
18
|
-
super();
|
|
19
|
-
this._model = _model;
|
|
20
|
-
this.transport = transport;
|
|
21
|
-
this.created = Date.now();
|
|
22
|
-
this._updated = Date.now();
|
|
23
|
-
this._closed = false;
|
|
24
|
-
this.setMaxListeners(Infinity);
|
|
25
|
-
}
|
|
26
|
-
get reports() {
|
|
27
|
-
return this.transport.reports;
|
|
28
|
-
}
|
|
29
|
-
get serviceId() {
|
|
30
|
-
return this.transport.serviceId;
|
|
31
|
-
}
|
|
32
|
-
get mediaUnitId() {
|
|
33
|
-
return this.transport.mediaUnitId;
|
|
34
|
-
}
|
|
35
|
-
get sfuId() {
|
|
36
|
-
return this.transport.sfuId;
|
|
37
|
-
}
|
|
38
|
-
get sfuTransportId() {
|
|
39
|
-
return this.transport.sfuTransportId;
|
|
40
|
-
}
|
|
41
|
-
get sfuRtpPadId() {
|
|
42
|
-
return this._model.sfuInboundRtpPadId;
|
|
43
|
-
}
|
|
44
|
-
get updated() {
|
|
45
|
-
return this._updated;
|
|
46
|
-
}
|
|
47
|
-
get closed() {
|
|
48
|
-
return this._closed;
|
|
49
|
-
}
|
|
50
|
-
close() {
|
|
51
|
-
if (this._closed)
|
|
52
|
-
return;
|
|
53
|
-
this._closed = true;
|
|
54
|
-
this.emit('close');
|
|
55
|
-
}
|
|
56
|
-
update(sample, timestamp) {
|
|
57
|
-
const now = Date.now();
|
|
58
|
-
const elapsedTimeInMs = now - this._updated;
|
|
59
|
-
const { streamId: sfuStreamId, padId: rtpPadId } = sample, reportData = __rest(sample, ["streamId", "padId"]);
|
|
60
|
-
const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId, callId: undefined, // TODO: where to get this from?
|
|
61
|
-
sfuStreamId,
|
|
62
|
-
rtpPadId }, reportData), { timestamp, marker: this.marker });
|
|
63
|
-
this.reports.addSfuInboundRtpPadReport(report);
|
|
64
|
-
this.stats = sample;
|
|
65
|
-
this._updated = now;
|
|
66
|
-
this.emit('update', {
|
|
67
|
-
elapsedTimeInMs,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
exports.ObservedSfuInboundRtpPad = ObservedSfuInboundRtpPad;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { SfuOutboundRtpPad } from '@observertc/sample-schemas-js';
|
|
4
|
-
import { ObservedSfuTransport } from './ObservedSfuTransport';
|
|
5
|
-
export type ObservedSfuOutboundRtpPadModel = {
|
|
6
|
-
sfuOutboundRtpPadId: string;
|
|
7
|
-
};
|
|
8
|
-
export type ObservedSfuOutboundRtpPadEvents = {
|
|
9
|
-
update: [
|
|
10
|
-
{
|
|
11
|
-
elapsedTimeInMs: number;
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
close: [];
|
|
15
|
-
};
|
|
16
|
-
export declare interface ObservedSfuOutboundRtpPad {
|
|
17
|
-
on<U extends keyof ObservedSfuOutboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuOutboundRtpPadEvents[U]) => void): this;
|
|
18
|
-
off<U extends keyof ObservedSfuOutboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuOutboundRtpPadEvents[U]) => void): this;
|
|
19
|
-
once<U extends keyof ObservedSfuOutboundRtpPadEvents>(event: U, listener: (...args: ObservedSfuOutboundRtpPadEvents[U]) => void): this;
|
|
20
|
-
emit<U extends keyof ObservedSfuOutboundRtpPadEvents>(event: U, ...args: ObservedSfuOutboundRtpPadEvents[U]): boolean;
|
|
21
|
-
update(sample: SfuOutboundRtpPad, timestamp: number): void;
|
|
22
|
-
}
|
|
23
|
-
export declare class ObservedSfuOutboundRtpPad extends EventEmitter {
|
|
24
|
-
private readonly _model;
|
|
25
|
-
readonly transport: ObservedSfuTransport;
|
|
26
|
-
readonly created: number;
|
|
27
|
-
stats?: SfuOutboundRtpPad;
|
|
28
|
-
marker?: string;
|
|
29
|
-
private _updated;
|
|
30
|
-
private _closed;
|
|
31
|
-
constructor(_model: ObservedSfuOutboundRtpPadModel, transport: ObservedSfuTransport);
|
|
32
|
-
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
33
|
-
get serviceId(): string;
|
|
34
|
-
get mediaUnitId(): string;
|
|
35
|
-
get sfuId(): string;
|
|
36
|
-
get sfuTransportId(): string;
|
|
37
|
-
get sfuRtpPadId(): string;
|
|
38
|
-
get updated(): number;
|
|
39
|
-
get closed(): boolean;
|
|
40
|
-
close():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AC,CAAC,CAAC,GAAG,OAAO,CAAC;IAEtH,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3D;AAED,qBAAa,yBAA0B,SAAQ,YAAY;IASzD,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,SAAS,EAAE,oBAAoB;IAThD,SAAgB,OAAO,SAAc;IAE9B,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAS;gBAGN,MAAM,EAAE,8BAA8B,EACvC,SAAS,EAAE,oBAAoB;IAMhD,IAAW,OAAO,kDAEjB;IAED,IAAW,SAAS,WAEnB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,KAAK,WAEf;IAED,IAAW,cAAc,WAExB;IAED,IAAW,WAAW,WAErB;IAED,IAAW,OAAO,WAEjB;IAED,IAAW,MAAM,YAEhB;IAEM,KAAK;CAiCZ"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
-
var t = {};
|
|
4
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
-
t[p] = s[p];
|
|
6
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
-
t[p[i]] = s[p[i]];
|
|
10
|
-
}
|
|
11
|
-
return t;
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.ObservedSfuOutboundRtpPad = void 0;
|
|
15
|
-
const events_1 = require("events");
|
|
16
|
-
class ObservedSfuOutboundRtpPad extends events_1.EventEmitter {
|
|
17
|
-
constructor(_model, transport) {
|
|
18
|
-
super();
|
|
19
|
-
this._model = _model;
|
|
20
|
-
this.transport = transport;
|
|
21
|
-
this.created = Date.now();
|
|
22
|
-
this._updated = Date.now();
|
|
23
|
-
this._closed = false;
|
|
24
|
-
this.setMaxListeners(Infinity);
|
|
25
|
-
}
|
|
26
|
-
get reports() {
|
|
27
|
-
return this.transport.reports;
|
|
28
|
-
}
|
|
29
|
-
get serviceId() {
|
|
30
|
-
return this.transport.serviceId;
|
|
31
|
-
}
|
|
32
|
-
get mediaUnitId() {
|
|
33
|
-
return this.transport.mediaUnitId;
|
|
34
|
-
}
|
|
35
|
-
get sfuId() {
|
|
36
|
-
return this.transport.sfuId;
|
|
37
|
-
}
|
|
38
|
-
get sfuTransportId() {
|
|
39
|
-
return this.transport.sfuTransportId;
|
|
40
|
-
}
|
|
41
|
-
get sfuRtpPadId() {
|
|
42
|
-
return this._model.sfuOutboundRtpPadId;
|
|
43
|
-
}
|
|
44
|
-
get updated() {
|
|
45
|
-
return this._updated;
|
|
46
|
-
}
|
|
47
|
-
get closed() {
|
|
48
|
-
return this._closed;
|
|
49
|
-
}
|
|
50
|
-
close() {
|
|
51
|
-
if (this._closed)
|
|
52
|
-
return;
|
|
53
|
-
this._closed = true;
|
|
54
|
-
this.emit('close');
|
|
55
|
-
}
|
|
56
|
-
update(sample, timestamp) {
|
|
57
|
-
const now = Date.now();
|
|
58
|
-
const elapsedTimeInMs = now - this._updated;
|
|
59
|
-
const { streamId: sfuStreamId, padId: rtpPadId, sinkId: sfuSinkId } = sample, reportData = __rest(sample, ["streamId", "padId", "sinkId"]);
|
|
60
|
-
const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId, callId: undefined, // TODO: where to get this from?
|
|
61
|
-
sfuStreamId,
|
|
62
|
-
sfuSinkId,
|
|
63
|
-
rtpPadId }, reportData), { timestamp, marker: this.marker });
|
|
64
|
-
this.reports.addSfuOutboundRtpPadReport(report);
|
|
65
|
-
this.stats = sample;
|
|
66
|
-
this._updated = now;
|
|
67
|
-
this.emit('update', {
|
|
68
|
-
elapsedTimeInMs,
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
exports.ObservedSfuOutboundRtpPad = ObservedSfuOutboundRtpPad;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { SfuSctpChannel } from '@observertc/sample-schemas-js';
|
|
4
|
-
import { ObservedSfuTransport } from './ObservedSfuTransport';
|
|
5
|
-
export type ObservedSfuSctpChannelModel = {
|
|
6
|
-
sfuSctpChannelId: string;
|
|
7
|
-
};
|
|
8
|
-
export type ObservedSfuSctpChannelEvents = {
|
|
9
|
-
update: [
|
|
10
|
-
{
|
|
11
|
-
elapsedTimeInMs: number;
|
|
12
|
-
}
|
|
13
|
-
];
|
|
14
|
-
close: [];
|
|
15
|
-
};
|
|
16
|
-
export declare interface ObservedSfuSctpChannel {
|
|
17
|
-
on<U extends keyof ObservedSfuSctpChannelEvents>(event: U, listener: (...args: ObservedSfuSctpChannelEvents[U]) => void): this;
|
|
18
|
-
off<U extends keyof ObservedSfuSctpChannelEvents>(event: U, listener: (...args: ObservedSfuSctpChannelEvents[U]) => void): this;
|
|
19
|
-
once<U extends keyof ObservedSfuSctpChannelEvents>(event: U, listener: (...args: ObservedSfuSctpChannelEvents[U]) => void): this;
|
|
20
|
-
emit<U extends keyof ObservedSfuSctpChannelEvents>(event: U, ...args: ObservedSfuSctpChannelEvents[U]): boolean;
|
|
21
|
-
update(sample: SfuSctpChannel, timestamp: number): void;
|
|
22
|
-
}
|
|
23
|
-
export declare class ObservedSfuSctpChannel extends EventEmitter {
|
|
24
|
-
private readonly _model;
|
|
25
|
-
readonly transport: ObservedSfuTransport;
|
|
26
|
-
readonly created: number;
|
|
27
|
-
stats?: SfuSctpChannel;
|
|
28
|
-
marker?: string;
|
|
29
|
-
private _updated;
|
|
30
|
-
private _closed;
|
|
31
|
-
constructor(_model: ObservedSfuSctpChannelModel, transport: ObservedSfuTransport);
|
|
32
|
-
get serviceId(): string;
|
|
33
|
-
get sfuId(): string;
|
|
34
|
-
get mediaUnitId(): string;
|
|
35
|
-
get sfuTransportId(): string;
|
|
36
|
-
get sfuSctpChannelId(): string;
|
|
37
|
-
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
38
|
-
get updated(): number;
|
|
39
|
-
get closed(): boolean;
|
|
40
|
-
close(): void;
|
|
41
|
-
}
|
|
42
|
-
//# sourceMappingURL=ObservedSfuSctpChannel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedSfuSctpChannel.d.ts","sourceRoot":"","sources":["../src/ObservedSfuSctpChannel.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,MAAM,MAAM,2BAA2B,GAAE;IACxC,gBAAgB,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IAC1C,MAAM,EAAE;QAAC;YACR,eAAe,EAAE,MAAM,CAAC;SACxB;KAAC,CAAC;IACH,KAAK,EAAE,EAAE,CAAC;CACV,CAAC;AAEF,MAAM,CAAC,OAAO,WAAW,sBAAsB;IAC9C,EAAE,CAAC,CAAC,SAAS,MAAM,4BAA4B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAC/H,GAAG,CAAC,CAAC,SAAS,MAAM,4BAA4B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IAChI,IAAI,CAAC,CAAC,SAAS,MAAM,4BAA4B,EAAE,KAAK,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAC,KAAK,IAAI,GAAG,IAAI,CAAC;IACjI,IAAI,CAAC,CAAC,SAAS,MAAM,4BAA4B,EAAE,KAAK,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,4BAA4B,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;IAEhH,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACxD;AAED,qBAAa,sBAAuB,SAAQ,YAAY;IAStD,OAAO,CAAC,QAAQ,CAAC,MAAM;aACP,SAAS,EAAE,oBAAoB;IAThD,SAAgB,OAAO,SAAc;IAE9B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAc;IAC9B,OAAO,CAAC,OAAO,CAAS;gBAGN,MAAM,EAAE,2BAA2B,EACpC,SAAS,EAAE,oBAAoB;IAMhD,IAAW,SAAS,WAEnB;IAED,IAAW,KAAK,WAEf;IAED,IAAW,WAAW,WAErB;IAED,IAAW,cAAc,WAExB;IAED,IAAW,gBAAgB,WAE1B;IAED,IAAW,OAAO,kDAEjB;IAED,IAAW,OAAO,WAEjB;IAED,IAAW,MAAM,YAEhB;IAEM,KAAK;CA6BZ"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ObservedSfuSctpChannel = void 0;
|
|
4
|
-
const events_1 = require("events");
|
|
5
|
-
class ObservedSfuSctpChannel extends events_1.EventEmitter {
|
|
6
|
-
constructor(_model, transport) {
|
|
7
|
-
super();
|
|
8
|
-
this._model = _model;
|
|
9
|
-
this.transport = transport;
|
|
10
|
-
this.created = Date.now();
|
|
11
|
-
this._updated = Date.now();
|
|
12
|
-
this._closed = false;
|
|
13
|
-
this.setMaxListeners(Infinity);
|
|
14
|
-
}
|
|
15
|
-
get serviceId() {
|
|
16
|
-
return this.transport.serviceId;
|
|
17
|
-
}
|
|
18
|
-
get sfuId() {
|
|
19
|
-
return this.transport.sfuId;
|
|
20
|
-
}
|
|
21
|
-
get mediaUnitId() {
|
|
22
|
-
return this.transport.mediaUnitId;
|
|
23
|
-
}
|
|
24
|
-
get sfuTransportId() {
|
|
25
|
-
return this.transport.sfuTransportId;
|
|
26
|
-
}
|
|
27
|
-
get sfuSctpChannelId() {
|
|
28
|
-
return this._model.sfuSctpChannelId;
|
|
29
|
-
}
|
|
30
|
-
get reports() {
|
|
31
|
-
return this.transport.reports;
|
|
32
|
-
}
|
|
33
|
-
get updated() {
|
|
34
|
-
return this._updated;
|
|
35
|
-
}
|
|
36
|
-
get closed() {
|
|
37
|
-
return this._closed;
|
|
38
|
-
}
|
|
39
|
-
close() {
|
|
40
|
-
if (this._closed)
|
|
41
|
-
return;
|
|
42
|
-
this._closed = true;
|
|
43
|
-
this.emit('close');
|
|
44
|
-
}
|
|
45
|
-
update(sample, timestamp) {
|
|
46
|
-
const now = Date.now();
|
|
47
|
-
const elapsedTimeInMs = now - this._updated;
|
|
48
|
-
const report = Object.assign(Object.assign({ serviceId: this.serviceId, mediaUnitId: this.mediaUnitId, sfuId: this.sfuId, callId: undefined, roomId: undefined }, sample), { timestamp, marker: this.marker });
|
|
49
|
-
this.reports.addSfuTransportReport(report);
|
|
50
|
-
this.stats = sample;
|
|
51
|
-
this._updated = now;
|
|
52
|
-
this.emit('update', {
|
|
53
|
-
elapsedTimeInMs,
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
exports.ObservedSfuSctpChannel = ObservedSfuSctpChannel;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { SfuTransport } from '@observertc/sample-schemas-js';
|
|
4
|
-
import { ObservedSfu } from './ObservedSfu';
|
|
5
|
-
import { ObservedSfuInboundRtpPad, ObservedSfuInboundRtpPadModel } from './ObservedSfuInboundRtpPad';
|
|
6
|
-
import { ObservedSfuOutboundRtpPad, ObservedSfuOutboundRtpPadModel } from './ObservedSfuOutboundRtpPad';
|
|
7
|
-
import { ObservedSfuSctpChannel, ObservedSfuSctpChannelModel } from './ObservedSfuSctpChannel';
|
|
8
|
-
export type ObservedSfuTransportModel = {
|
|
9
|
-
sfuTransportId: string;
|
|
10
|
-
};
|
|
11
|
-
export type ObservedSfuTransportEvents = {
|
|
12
|
-
update: [
|
|
13
|
-
{
|
|
14
|
-
elapsedTimeInMs: number;
|
|
15
|
-
}
|
|
16
|
-
];
|
|
17
|
-
close: [];
|
|
18
|
-
newsfuoutboundrtppad: [ObservedSfuOutboundRtpPad];
|
|
19
|
-
newsfuinboundrtppad: [ObservedSfuInboundRtpPad];
|
|
20
|
-
newsfusctpchannel: [ObservedSfuSctpChannel];
|
|
21
|
-
};
|
|
22
|
-
export declare interface ObservedSfuTransport {
|
|
23
|
-
on<U extends keyof ObservedSfuTransportEvents>(event: U, listener: (...args: ObservedSfuTransportEvents[U]) => void): this;
|
|
24
|
-
off<U extends keyof ObservedSfuTransportEvents>(event: U, listener: (...args: ObservedSfuTransportEvents[U]) => void): this;
|
|
25
|
-
once<U extends keyof ObservedSfuTransportEvents>(event: U, listener: (...args: ObservedSfuTransportEvents[U]) => void): this;
|
|
26
|
-
emit<U extends keyof ObservedSfuTransportEvents>(event: U, ...args: ObservedSfuTransportEvents[U]): boolean;
|
|
27
|
-
update(sample: SfuTransport, timestamp: number): void;
|
|
28
|
-
}
|
|
29
|
-
export declare class ObservedSfuTransport extends EventEmitter {
|
|
30
|
-
private readonly _model;
|
|
31
|
-
readonly sfu: ObservedSfu;
|
|
32
|
-
readonly created: number;
|
|
33
|
-
stats?: SfuTransport;
|
|
34
|
-
private _updated;
|
|
35
|
-
private _closed;
|
|
36
|
-
private _marker?;
|
|
37
|
-
private readonly _inboundRtpPads;
|
|
38
|
-
private readonly _outboundRtpPads;
|
|
39
|
-
private readonly _sctpChannels;
|
|
40
|
-
constructor(_model: ObservedSfuTransportModel, sfu: ObservedSfu);
|
|
41
|
-
get inboundRtpPads(): ReadonlyMap<string, ObservedSfuInboundRtpPad>;
|
|
42
|
-
get outboundRtpPads(): ReadonlyMap<string, ObservedSfuOutboundRtpPad>;
|
|
43
|
-
get sctpChannels(): ReadonlyMap<string, ObservedSfuSctpChannel>;
|
|
44
|
-
get serviceId(): string;
|
|
45
|
-
get mediaUnitId(): string;
|
|
46
|
-
get sfuId(): string;
|
|
47
|
-
get sfuTransportId(): string;
|
|
48
|
-
get reports(): import("./ReportsCollector").ReportsCollector;
|
|
49
|
-
get updated(): number;
|
|
50
|
-
get marker(): string | undefined;
|
|
51
|
-
set marker(value: string | undefined);
|
|
52
|
-
get closed(): boolean;
|
|
53
|
-
close(): void;
|
|
54
|
-
createSfuOutboundRtpPad(model: ObservedSfuOutboundRtpPadModel): ObservedSfuOutboundRtpPad;
|
|
55
|
-
createSfuInboundRtpPad(model: ObservedSfuInboundRtpPadModel): ObservedSfuInboundRtpPad;
|
|
56
|
-
createSfuSctpChannel(model: ObservedSfuSctpChannelModel): ObservedSfuSctpChannel;
|
|
57
|
-
}
|
|
58
|
-
//# sourceMappingURL=ObservedSfuTransport.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ObservedSfuTransport.d.ts","sourceRoot":"","sources":["../src/ObservedSfuTransport.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC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