@observertc/observer-js 0.9.1-beta → 0.9.2-beta
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/lib/Evaluator.d.ts.map +1 -1
- package/lib/Evaluator.js +13 -2
- package/lib/Observer.d.ts +3 -1
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +19 -1
- package/lib/common/logger.d.ts +2 -2
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +49 -35
- package/lib/common/types.d.ts +22 -0
- package/lib/common/types.d.ts.map +1 -1
- package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +1 -1
- package/lib/middlewares/CommitTransactionMiddleware.js +25 -0
- package/lib/middlewares/TransactionContext.d.ts +4 -2
- package/lib/middlewares/TransactionContext.d.ts.map +1 -1
- package/lib/middlewares/TransactionContext.js +2 -1
- package/lib/middlewares/TransactoinProcessor.d.ts.map +1 -1
- package/lib/middlewares/TransactoinProcessor.js +3 -2
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +1 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +1 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.js +2 -2
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts +6 -0
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +1 -0
- package/lib/middlewares/VisitObservedSfusMiddleware.js +142 -0
- package/lib/middlewares/visitors/visitClient.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitClient.js +13 -0
- package/lib/middlewares/visitors/{visitOutboundVideoTarcks.d.ts → visitOutboundVideoTarck.d.ts} +1 -1
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfu.d.ts +5 -0
- package/lib/middlewares/visitors/visitSfu.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfu.js +79 -0
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts +5 -0
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +60 -0
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts +5 -0
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +61 -0
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts +5 -0
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfuSctpChannel.js +58 -0
- package/lib/middlewares/visitors/visitSfuTransport.d.ts +5 -0
- package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +1 -0
- package/lib/middlewares/visitors/visitSfuTransport.js +59 -0
- package/lib/samples/ObservedSfu.d.ts +27 -0
- package/lib/samples/ObservedSfu.d.ts.map +1 -0
- package/lib/samples/ObservedSfu.js +72 -0
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts +15 -0
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +1 -0
- package/lib/samples/ObservedSfuInboundRtpPad.js +21 -0
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts +15 -0
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +1 -0
- package/lib/samples/ObservedSfuOutboundRtpPad.js +21 -0
- package/lib/samples/ObservedSfuSctpChannel.d.ts +15 -0
- package/lib/samples/ObservedSfuSctpChannel.d.ts.map +1 -0
- package/lib/samples/ObservedSfuSctpChannel.js +21 -0
- package/lib/samples/ObservedSfuTransport.d.ts +30 -0
- package/lib/samples/ObservedSfuTransport.d.ts.map +1 -0
- package/lib/samples/ObservedSfuTransport.js +93 -0
- package/lib/samples/ObservedSfus.d.ts +16 -0
- package/lib/samples/ObservedSfus.d.ts.map +1 -0
- package/lib/samples/ObservedSfus.js +66 -0
- package/lib/sinks/ObserverSink.d.ts +3 -3
- package/lib/sinks/ObserverSink.d.ts.map +1 -1
- package/lib/sources/ObservedSfuSource.d.ts +14 -0
- package/lib/sources/ObservedSfuSource.d.ts.map +1 -0
- package/lib/sources/ObservedSfuSource.js +2 -0
- package/lib/sources/Sources.d.ts +8 -0
- package/lib/sources/Sources.d.ts.map +1 -1
- package/lib/sources/Sources.js +47 -1
- package/lib/storages/StorageProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/Evaluator.ts +14 -2
- package/src/Observer.ts +22 -1
- package/src/common/logger.ts +145 -127
- package/src/common/types.ts +27 -0
- package/src/middlewares/CommitTransactionMiddleware.ts +46 -6
- package/src/middlewares/TransactionContext.ts +7 -3
- package/src/middlewares/TransactoinProcessor.ts +3 -1
- package/src/middlewares/VisitObservedCallsMiddleware.ts +1 -1
- package/src/middlewares/VisitObservedSfusMiddleware.ts +202 -0
- package/src/middlewares/visitors/visitClient.ts +15 -0
- package/src/middlewares/visitors/visitSfu.ts +64 -0
- package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +50 -0
- package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +51 -0
- package/src/middlewares/visitors/visitSfuSctpChannel.ts +48 -0
- package/src/middlewares/visitors/visitSfuTransport.ts +48 -0
- package/src/samples/ObservedSfu.ts +108 -0
- package/src/samples/ObservedSfuInboundRtpPad.ts +34 -0
- package/src/samples/ObservedSfuOutboundRtpPad.ts +34 -0
- package/src/samples/ObservedSfuSctpChannel.ts +35 -0
- package/src/samples/ObservedSfuTransport.ts +130 -0
- package/src/samples/ObservedSfus.ts +85 -0
- package/src/sinks/ObserverSink.ts +5 -3
- package/src/sources/ObservedSfuSource.ts +23 -0
- package/src/sources/Sources.ts +54 -3
- package/src/storages/StorageProvider.ts +1 -4
- package/lib/middlewares/visitors/visitOutboundVideoTarcks.d.ts.map +0 -1
- package/lib/storages/StorageFactory.d.ts +0 -27
- package/lib/storages/StorageFactory.d.ts.map +0 -1
- package/lib/storages/StorageFactory.js +0 -37
- package/src/storages/StorageFactory.ts +0 -58
- /package/lib/middlewares/visitors/{visitOutboundVideoTarcks.js → visitOutboundVideoTarck.js} +0 -0
- /package/src/middlewares/visitors/{visitOutboundVideoTarcks.ts → visitOutboundVideoTarck.ts} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createVisitObservedSfusMiddleware = exports.logger = void 0;
|
|
4
|
+
const logger_1 = require("../common/logger");
|
|
5
|
+
const visitSfu_1 = require("./visitors/visitSfu");
|
|
6
|
+
const visitSfuTransport_1 = require("./visitors/visitSfuTransport");
|
|
7
|
+
const visitSfuInboundRtpPad_1 = require("./visitors/visitSfuInboundRtpPad");
|
|
8
|
+
const visitSfuOutboundRtpPad_1 = require("./visitors/visitSfuOutboundRtpPad");
|
|
9
|
+
const visitSfuSctpChannel_1 = require("./visitors/visitSfuSctpChannel");
|
|
10
|
+
exports.logger = (0, logger_1.createLogger)('VisitObservedCallsMiddleware');
|
|
11
|
+
function createVisitObservedSfusMiddleware(reports, fetchSamples) {
|
|
12
|
+
const process = async (transaction) => {
|
|
13
|
+
const { observedSfus, updatedSfus, deletedSfus, updatedSfuTransports, deletedSfuTransports, updatedSfuInboundRtpPads, deletedSfuInboundRtpPads, updatedSfuOutboundRtpPads, deletedSfuOutboundRtpPads, updatedSfuSctpChannels, deletedSfuSctpChannels } = transaction;
|
|
14
|
+
const visitedSfuIds = new Set();
|
|
15
|
+
const visitedSfuTransportIds = new Set();
|
|
16
|
+
const visitedSfuInboundRtpPadIds = new Set();
|
|
17
|
+
const visitedSfuOutboundRtpPadIds = new Set();
|
|
18
|
+
const visitedSfuSctpChannels = new Set();
|
|
19
|
+
for (const observedSfu of observedSfus.observedSfus()) {
|
|
20
|
+
const { sfuId } = observedSfu;
|
|
21
|
+
(0, visitSfu_1.visitSfu)(observedSfu, updatedSfus, reports, fetchSamples);
|
|
22
|
+
visitedSfuIds.add(sfuId);
|
|
23
|
+
const storedSfu = updatedSfus.get(sfuId);
|
|
24
|
+
if (!storedSfu) {
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
for (const observedSfuTransport of observedSfu.observedSfuTransports()) {
|
|
28
|
+
const { transportId } = observedSfuTransport;
|
|
29
|
+
(0, visitSfuTransport_1.visitSfuTransport)(observedSfuTransport, storedSfu, updatedSfuTransports, reports, fetchSamples);
|
|
30
|
+
visitedSfuTransportIds.add(transportId);
|
|
31
|
+
const storedSfuTransport = updatedSfuTransports.get(transportId);
|
|
32
|
+
if (!storedSfuTransport) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
for (const sfuInboundRtpPad of observedSfuTransport.inboundRtpPads()) {
|
|
36
|
+
(0, visitSfuInboundRtpPad_1.visitSfuInboundRtpPad)(sfuInboundRtpPad, storedSfuTransport, updatedSfuInboundRtpPads, reports, fetchSamples);
|
|
37
|
+
visitedSfuInboundRtpPadIds.add(sfuInboundRtpPad.padId);
|
|
38
|
+
}
|
|
39
|
+
for (const sfuOutboundRtpPad of observedSfuTransport.outboundRtpPads()) {
|
|
40
|
+
(0, visitSfuOutboundRtpPad_1.visitSfuOutboundRtpPad)(sfuOutboundRtpPad, storedSfuTransport, updatedSfuOutboundRtpPads, reports, fetchSamples);
|
|
41
|
+
visitedSfuInboundRtpPadIds.add(sfuOutboundRtpPad.padId);
|
|
42
|
+
}
|
|
43
|
+
for (const sfuSctpChannel of observedSfuTransport.sfuSctpChannels()) {
|
|
44
|
+
(0, visitSfuSctpChannel_1.visitSfuSctpChannel)(sfuSctpChannel, storedSfuTransport, updatedSfuSctpChannels, reports, fetchSamples);
|
|
45
|
+
visitedSfuSctpChannels.add(sfuSctpChannel.channelId);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
for (const [sfuId, sfu] of Array.from(updatedSfus.entries())) {
|
|
50
|
+
if (visitedSfuIds.has(sfuId)) {
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
deletedSfus.add(sfuId);
|
|
54
|
+
if (sfu.serviceId && sfu.mediaUnitId) {
|
|
55
|
+
reports.addSfuEventReport({
|
|
56
|
+
serviceId: sfu.serviceId,
|
|
57
|
+
mediaUnitId: sfu.mediaUnitId,
|
|
58
|
+
name: "SFU_LEFT",
|
|
59
|
+
sfuId,
|
|
60
|
+
timestamp: Date.now(),
|
|
61
|
+
marker: sfu.marker,
|
|
62
|
+
message: 'SFU is detached',
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const [sfuTransportId, sfuTransport] of Array.from(updatedSfuTransports.entries())) {
|
|
67
|
+
if (visitedSfuTransportIds.has(sfuTransportId)) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
// delete PeerConnection
|
|
71
|
+
const { serviceId, sfuId, transportId } = sfuTransport;
|
|
72
|
+
if (!serviceId || !sfuId || !transportId) {
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
const storedSfu = updatedSfus.get(sfuId);
|
|
76
|
+
updatedSfuTransports.delete(transportId);
|
|
77
|
+
deletedSfuTransports.add(transportId);
|
|
78
|
+
// also update the peer connection model
|
|
79
|
+
if (storedSfu) {
|
|
80
|
+
storedSfu.sfuTransportIds = storedSfu.sfuTransportIds.filter((tId) => tId !== transportId);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
for (const [padId, sfuInboundRtpPad] of Array.from(updatedSfuInboundRtpPads.entries())) {
|
|
84
|
+
if (visitedSfuInboundRtpPadIds.has(padId)) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
// delete Sfu Inbound Rtp Pad
|
|
88
|
+
const { serviceId, rtpPadId, sfuTransportId } = sfuInboundRtpPad;
|
|
89
|
+
if (!serviceId || !sfuTransportId || !rtpPadId) {
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
93
|
+
updatedSfuInboundRtpPads.delete(rtpPadId);
|
|
94
|
+
deletedSfuInboundRtpPads.add(rtpPadId);
|
|
95
|
+
// also update the sfu transport model
|
|
96
|
+
if (storedSfuTransport) {
|
|
97
|
+
storedSfuTransport.inboundRtpPadIds = storedSfuTransport.inboundRtpPadIds.filter((tId) => tId !== rtpPadId);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
for (const [padId, sfuOutboundRtpPad] of Array.from(updatedSfuOutboundRtpPads.entries())) {
|
|
101
|
+
if (visitedSfuOutboundRtpPadIds.has(padId)) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
// delete Sfu Outbound Rtp Pad
|
|
105
|
+
const { serviceId, rtpPadId, sfuTransportId } = sfuOutboundRtpPad;
|
|
106
|
+
if (!serviceId || !sfuTransportId || !rtpPadId) {
|
|
107
|
+
continue;
|
|
108
|
+
}
|
|
109
|
+
const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
110
|
+
updatedSfuOutboundRtpPads.delete(rtpPadId);
|
|
111
|
+
deletedSfuOutboundRtpPads.add(rtpPadId);
|
|
112
|
+
// also update the sfu transport model
|
|
113
|
+
if (storedSfuTransport) {
|
|
114
|
+
storedSfuTransport.outboundRtpPadIds = storedSfuTransport.outboundRtpPadIds.filter((tId) => tId !== rtpPadId);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const [channelId, sfuSctpChannel] of Array.from(updatedSfuSctpChannels.entries())) {
|
|
118
|
+
if (visitedSfuSctpChannels.has(channelId)) {
|
|
119
|
+
continue;
|
|
120
|
+
}
|
|
121
|
+
// delete Sfu Outbound Rtp Pad
|
|
122
|
+
const { serviceId, sfuSctpChannelId, sfuTransportId } = sfuSctpChannel;
|
|
123
|
+
if (!serviceId || !sfuTransportId || !sfuSctpChannelId) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
const storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
127
|
+
updatedSfuSctpChannels.delete(sfuSctpChannelId);
|
|
128
|
+
deletedSfuSctpChannels.add(sfuSctpChannelId);
|
|
129
|
+
// also update the sfu transport model
|
|
130
|
+
if (storedSfuTransport) {
|
|
131
|
+
storedSfuTransport.sctpChannelIds = storedSfuTransport.sctpChannelIds.filter((tId) => tId !== sfuSctpChannelId);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
const result = async (context, next) => {
|
|
136
|
+
await process(context);
|
|
137
|
+
if (next)
|
|
138
|
+
await next(context);
|
|
139
|
+
};
|
|
140
|
+
return result;
|
|
141
|
+
}
|
|
142
|
+
exports.createVisitObservedSfusMiddleware = createVisitObservedSfusMiddleware;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"visitClient.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,wBAAgB,WAAW,CAC1B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"visitClient.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AASjE,wBAAgB,WAAW,CAC1B,cAAc,EAAE,cAAc,EAC9B,MAAM,EAAE,MAAM,CAAC,MAAM,EACrB,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QA6KrB"}
|
|
@@ -87,6 +87,19 @@ function visitClient(observedClient, client, reports, fetchSamples) {
|
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
|
+
if (clientSample.customCallEvents && 0 < clientSample.customCallEvents.length) {
|
|
91
|
+
for (const callEvent of clientSample.customCallEvents) {
|
|
92
|
+
reports.addCallEventReport({
|
|
93
|
+
serviceId,
|
|
94
|
+
mediaUnitId,
|
|
95
|
+
roomId,
|
|
96
|
+
callId,
|
|
97
|
+
clientId,
|
|
98
|
+
timestamp: Date.now(),
|
|
99
|
+
...callEvent,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
90
103
|
if (clientSample.userMediaErrors && 0 < clientSample.userMediaErrors.length) {
|
|
91
104
|
for (const userMediaError of clientSample.userMediaErrors) {
|
|
92
105
|
const callMetaReport = (0, callMetaReports_1.createCallMetaReport)(serviceId, mediaUnitId, roomId, callId, clientId, {
|
package/lib/middlewares/visitors/{visitOutboundVideoTarcks.d.ts → visitOutboundVideoTarck.d.ts}
RENAMED
|
@@ -2,4 +2,4 @@ import * as Models from '../../models/Models';
|
|
|
2
2
|
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
3
|
import { ObservedOutboundVideoTrack } from '../../samples/ObservedOutboundVideoTrack';
|
|
4
4
|
export declare function visitOutboundVideoTrack(observedOutboundVideoTrack: ObservedOutboundVideoTrack, storedPeerConnection: Models.PeerConnection, storedOutboundTracks: Map<string, Models.OutboundTrack>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
-
//# sourceMappingURL=
|
|
5
|
+
//# sourceMappingURL=visitOutboundVideoTarck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitOutboundVideoTarck.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitOutboundVideoTarck.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AAKtF,wBAAgB,uBAAuB,CACtC,0BAA0B,EAAE,0BAA0B,EACtD,oBAAoB,EAAE,MAAM,CAAC,cAAc,EAC3C,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,EACvD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAiFrB"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Models from '../../models/Models';
|
|
2
|
+
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
|
+
import { ObservedSfu } from '../../samples/ObservedSfu';
|
|
4
|
+
export declare function visitSfu(observedSfu: ObservedSfu, storedSfus: Map<string, Models.Sfu>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
+
//# sourceMappingURL=visitSfu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitSfu.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfu.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,wBAAgB,QAAQ,CACvB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,EACnC,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuDrB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.visitSfu = void 0;
|
|
27
|
+
const Models = __importStar(require("../../models/Models"));
|
|
28
|
+
function visitSfu(observedSfu, storedSfus, reports, fetchSamples) {
|
|
29
|
+
const { mediaUnitId, serviceId, sfuId, timeZoneId, marker } = observedSfu;
|
|
30
|
+
let storedSfu = storedSfus.get(sfuId);
|
|
31
|
+
if (!storedSfu) {
|
|
32
|
+
const timestamp = Date.now();
|
|
33
|
+
storedSfu = new Models.Sfu({
|
|
34
|
+
serviceId,
|
|
35
|
+
sfuId,
|
|
36
|
+
joined: BigInt(timestamp),
|
|
37
|
+
mediaUnitId,
|
|
38
|
+
timeZoneId,
|
|
39
|
+
marker,
|
|
40
|
+
sfuTransportIds: [],
|
|
41
|
+
});
|
|
42
|
+
storedSfus.set(sfuId, storedSfu);
|
|
43
|
+
reports.addSfuEventReport({
|
|
44
|
+
serviceId,
|
|
45
|
+
mediaUnitId,
|
|
46
|
+
name: "SFU_JOINED",
|
|
47
|
+
sfuId,
|
|
48
|
+
timestamp,
|
|
49
|
+
marker,
|
|
50
|
+
message: 'SFU is joined',
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
for (const sfuSample of observedSfu.samples()) {
|
|
54
|
+
if (sfuSample.customSfuEvents) {
|
|
55
|
+
for (const sfuEvent of sfuSample.customSfuEvents) {
|
|
56
|
+
reports.addSfuEventReport({
|
|
57
|
+
serviceId,
|
|
58
|
+
mediaUnitId,
|
|
59
|
+
sfuId,
|
|
60
|
+
timestamp: Date.now(),
|
|
61
|
+
...sfuEvent,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (sfuSample.extensionStats) {
|
|
66
|
+
for (const extensionStats of sfuSample.extensionStats) {
|
|
67
|
+
reports.addSfuExtensionReport({
|
|
68
|
+
serviceId,
|
|
69
|
+
mediaUnitId,
|
|
70
|
+
sfuId,
|
|
71
|
+
timestamp: Date.now(),
|
|
72
|
+
payload: extensionStats.payload,
|
|
73
|
+
extensionType: extensionStats.type,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.visitSfu = visitSfu;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Models from '../../models/Models';
|
|
2
|
+
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
|
+
import { ObservedSfuInboundRtpPad } from '../../samples/ObservedSfuInboundRtpPad';
|
|
4
|
+
export declare function visitSfuInboundRtpPad(observedSfuInboundRtpPad: ObservedSfuInboundRtpPad, storedSfuTransport: Models.SfuTransport, storedSfuInboundRtpPads: Map<string, Models.SfuInboundRtpPad>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
+
//# sourceMappingURL=visitSfuInboundRtpPad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitSfuInboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuInboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAElF,wBAAgB,qBAAqB,CACpC,wBAAwB,EAAE,wBAAwB,EAClD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,uBAAuB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,EAC7D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.visitSfuInboundRtpPad = void 0;
|
|
27
|
+
const Models = __importStar(require("../../models/Models"));
|
|
28
|
+
function visitSfuInboundRtpPad(observedSfuInboundRtpPad, storedSfuTransport, storedSfuInboundRtpPads, reports, fetchSamples) {
|
|
29
|
+
const { padId: rtpPadId } = observedSfuInboundRtpPad;
|
|
30
|
+
const { transportId: sfuTransportId } = observedSfuInboundRtpPad.sfuTransport;
|
|
31
|
+
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuInboundRtpPad.sfuTransport.sfu;
|
|
32
|
+
let storedSfuInboundRtpPad = storedSfuInboundRtpPads.get(rtpPadId);
|
|
33
|
+
if (!storedSfuInboundRtpPad) {
|
|
34
|
+
storedSfuInboundRtpPad = new Models.SfuInboundRtpPad({
|
|
35
|
+
serviceId,
|
|
36
|
+
sfuId,
|
|
37
|
+
mediaUnitId,
|
|
38
|
+
sfuTransportId,
|
|
39
|
+
added: BigInt(Date.now()),
|
|
40
|
+
marker,
|
|
41
|
+
});
|
|
42
|
+
storedSfuInboundRtpPads.set(rtpPadId, storedSfuInboundRtpPad);
|
|
43
|
+
storedSfuTransport.inboundRtpPadIds.push(rtpPadId);
|
|
44
|
+
}
|
|
45
|
+
for (const sfuInboundRtpPad of observedSfuInboundRtpPad.samples()) {
|
|
46
|
+
const report = {
|
|
47
|
+
serviceId,
|
|
48
|
+
sfuId,
|
|
49
|
+
mediaUnitId,
|
|
50
|
+
rtpPadId,
|
|
51
|
+
...sfuInboundRtpPad,
|
|
52
|
+
sfuStreamId: sfuInboundRtpPad.streamId,
|
|
53
|
+
timestamp,
|
|
54
|
+
};
|
|
55
|
+
reports.addSfuTransportReport(report);
|
|
56
|
+
}
|
|
57
|
+
if (fetchSamples) {
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.visitSfuInboundRtpPad = visitSfuInboundRtpPad;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Models from '../../models/Models';
|
|
2
|
+
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
|
+
import { ObservedSfuOutboundRtpPad } from '../../samples/ObservedSfuOutboundRtpPad';
|
|
4
|
+
export declare function visitSfuOutboundRtpPad(observedSfuOutboundRtpPad: ObservedSfuOutboundRtpPad, storedSfuTransport: Models.SfuTransport, storedSfuOutboundRtpPads: Map<string, Models.SfuOutboundRtpPad>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
+
//# sourceMappingURL=visitSfuOutboundRtpPad.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitSfuOutboundRtpPad.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuOutboundRtpPad.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAEpF,wBAAgB,sBAAsB,CACrC,yBAAyB,EAAE,yBAAyB,EACpD,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,EAC/D,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAuCrB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.visitSfuOutboundRtpPad = void 0;
|
|
27
|
+
const Models = __importStar(require("../../models/Models"));
|
|
28
|
+
function visitSfuOutboundRtpPad(observedSfuOutboundRtpPad, storedSfuTransport, storedSfuOutboundRtpPads, reports, fetchSamples) {
|
|
29
|
+
const { padId: rtpPadId } = observedSfuOutboundRtpPad;
|
|
30
|
+
const { transportId: sfuTransportId } = observedSfuOutboundRtpPad.sfuTransport;
|
|
31
|
+
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuOutboundRtpPad.sfuTransport.sfu;
|
|
32
|
+
let storedSfuOutboundRtpPad = storedSfuOutboundRtpPads.get(rtpPadId);
|
|
33
|
+
if (!storedSfuOutboundRtpPad) {
|
|
34
|
+
storedSfuOutboundRtpPad = new Models.SfuOutboundRtpPad({
|
|
35
|
+
serviceId,
|
|
36
|
+
sfuId,
|
|
37
|
+
mediaUnitId,
|
|
38
|
+
sfuTransportId,
|
|
39
|
+
added: BigInt(Date.now()),
|
|
40
|
+
marker,
|
|
41
|
+
});
|
|
42
|
+
storedSfuOutboundRtpPads.set(rtpPadId, storedSfuOutboundRtpPad);
|
|
43
|
+
storedSfuTransport.outboundRtpPadIds.push(rtpPadId);
|
|
44
|
+
}
|
|
45
|
+
for (const sfuOutboundRtpPad of observedSfuOutboundRtpPad.samples()) {
|
|
46
|
+
const report = {
|
|
47
|
+
serviceId,
|
|
48
|
+
sfuId,
|
|
49
|
+
mediaUnitId,
|
|
50
|
+
rtpPadId,
|
|
51
|
+
...sfuOutboundRtpPad,
|
|
52
|
+
sfuStreamId: sfuOutboundRtpPad.streamId,
|
|
53
|
+
sfuSinkId: sfuOutboundRtpPad.sinkId,
|
|
54
|
+
timestamp,
|
|
55
|
+
};
|
|
56
|
+
reports.addSfuTransportReport(report);
|
|
57
|
+
}
|
|
58
|
+
if (fetchSamples) {
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.visitSfuOutboundRtpPad = visitSfuOutboundRtpPad;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Models from '../../models/Models';
|
|
2
|
+
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
|
+
import { ObservedSfuSctpChannel } from '../../samples/ObservedSfuSctpChannel';
|
|
4
|
+
export declare function visitSfuSctpChannel(observedSfuSctpChannel: ObservedSfuSctpChannel, storedSfuTransport: Models.SfuTransport, storedSfuSctpChannels: Map<string, Models.SfuSctpChannel>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
+
//# sourceMappingURL=visitSfuSctpChannel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitSfuSctpChannel.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuSctpChannel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E,wBAAgB,mBAAmB,CAClC,sBAAsB,EAAE,sBAAsB,EAC9C,kBAAkB,EAAE,MAAM,CAAC,YAAY,EACvC,qBAAqB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,EACzD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAoCnB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.visitSfuSctpChannel = void 0;
|
|
27
|
+
const Models = __importStar(require("../../models/Models"));
|
|
28
|
+
function visitSfuSctpChannel(observedSfuSctpChannel, storedSfuTransport, storedSfuSctpChannels, reports, fetchSamples) {
|
|
29
|
+
const { channelId } = observedSfuSctpChannel;
|
|
30
|
+
const { transportId: sfuTransportId } = observedSfuSctpChannel.sfuTransport;
|
|
31
|
+
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuSctpChannel.sfuTransport.sfu;
|
|
32
|
+
let storedSfuSctpChannel = storedSfuSctpChannels.get(channelId);
|
|
33
|
+
if (!storedSfuSctpChannel) {
|
|
34
|
+
storedSfuSctpChannel = new Models.SfuSctpChannel({
|
|
35
|
+
serviceId,
|
|
36
|
+
sfuId,
|
|
37
|
+
mediaUnitId,
|
|
38
|
+
sfuTransportId,
|
|
39
|
+
opened: BigInt(Date.now()),
|
|
40
|
+
marker,
|
|
41
|
+
});
|
|
42
|
+
storedSfuSctpChannels.set(channelId, storedSfuSctpChannel);
|
|
43
|
+
storedSfuTransport.sctpChannelIds.push(channelId);
|
|
44
|
+
}
|
|
45
|
+
for (const sfuSctpChannel of observedSfuSctpChannel.samples()) {
|
|
46
|
+
const report = {
|
|
47
|
+
serviceId,
|
|
48
|
+
sfuId,
|
|
49
|
+
mediaUnitId,
|
|
50
|
+
...sfuSctpChannel,
|
|
51
|
+
timestamp,
|
|
52
|
+
};
|
|
53
|
+
reports.addSfuTransportReport(report);
|
|
54
|
+
}
|
|
55
|
+
if (fetchSamples) {
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.visitSfuSctpChannel = visitSfuSctpChannel;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as Models from '../../models/Models';
|
|
2
|
+
import { ReportsCollector } from '../../common/ReportsCollector';
|
|
3
|
+
import { ObservedSfuTransport } from '../../samples/ObservedSfuTransport';
|
|
4
|
+
export declare function visitSfuTransport(observedSfuTransport: ObservedSfuTransport, storedSfu: Models.Sfu, storedSfuTransports: Map<string, Models.SfuTransport>, reports: ReportsCollector, fetchSamples: boolean): void;
|
|
5
|
+
//# sourceMappingURL=visitSfuTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visitSfuTransport.d.ts","sourceRoot":"","sources":["../../../src/middlewares/visitors/visitSfuTransport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAE1E,wBAAgB,iBAAiB,CAChC,oBAAoB,EAAE,oBAAoB,EAC1C,SAAS,EAAE,MAAM,CAAC,GAAG,EACrB,mBAAmB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,EACrD,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,QAqCrB"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.visitSfuTransport = void 0;
|
|
27
|
+
const Models = __importStar(require("../../models/Models"));
|
|
28
|
+
function visitSfuTransport(observedSfuTransport, storedSfu, storedSfuTransports, reports, fetchSamples) {
|
|
29
|
+
const { transportId } = observedSfuTransport;
|
|
30
|
+
const { serviceId, sfuId, mediaUnitId, marker, minTimestamp: timestamp } = observedSfuTransport.sfu;
|
|
31
|
+
let storedSfuTransport = storedSfuTransports.get(transportId);
|
|
32
|
+
if (!storedSfuTransport) {
|
|
33
|
+
storedSfuTransport = new Models.SfuTransport({
|
|
34
|
+
serviceId,
|
|
35
|
+
sfuId,
|
|
36
|
+
mediaUnitId,
|
|
37
|
+
transportId,
|
|
38
|
+
opened: BigInt(Date.now()),
|
|
39
|
+
marker,
|
|
40
|
+
inboundRtpPadIds: [],
|
|
41
|
+
outboundRtpPadIds: [],
|
|
42
|
+
});
|
|
43
|
+
storedSfuTransports.set(transportId, storedSfuTransport);
|
|
44
|
+
storedSfu.sfuTransportIds.push(transportId);
|
|
45
|
+
}
|
|
46
|
+
for (const sfuTransport of observedSfuTransport.transportSamples()) {
|
|
47
|
+
const report = {
|
|
48
|
+
serviceId,
|
|
49
|
+
sfuId,
|
|
50
|
+
mediaUnitId,
|
|
51
|
+
...sfuTransport,
|
|
52
|
+
timestamp,
|
|
53
|
+
};
|
|
54
|
+
reports.addSfuTransportReport(report);
|
|
55
|
+
}
|
|
56
|
+
if (fetchSamples) {
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.visitSfuTransport = visitSfuTransport;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SfuSample } from '@observertc/sample-schemas-js';
|
|
2
|
+
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
3
|
+
import { ObservedSfuTransport } from './ObservedSfuTransport';
|
|
4
|
+
export interface ObservedSfu {
|
|
5
|
+
readonly serviceId: string;
|
|
6
|
+
readonly sfuId: string;
|
|
7
|
+
readonly mediaUnitId: string;
|
|
8
|
+
observedSfuTransports(): IterableIterator<ObservedSfuTransport>;
|
|
9
|
+
getObservedSfuTransport(sfuId: string): ObservedSfuTransport | undefined;
|
|
10
|
+
samples(): IterableIterator<SfuSample>;
|
|
11
|
+
readonly marker?: string;
|
|
12
|
+
readonly timeZoneId?: string;
|
|
13
|
+
minTimestamp: number;
|
|
14
|
+
maxTimestamp: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class ObservedSfuBuilder {
|
|
17
|
+
private _config;
|
|
18
|
+
private _minTimestamp?;
|
|
19
|
+
private _maxTimestamp?;
|
|
20
|
+
private _sfuTransports;
|
|
21
|
+
private _sfuSamples;
|
|
22
|
+
constructor(_config: Omit<ObservedSfu, keyof IterableIterator<ObservedPeerConnection> | 'samples' | 'observedSfuTransports' | 'getObservedSfuTransport' | 'minTimestamp' | 'maxTimestamp'>);
|
|
23
|
+
addSfuSample(sfuSample: SfuSample): void;
|
|
24
|
+
private _getOrCreateSfuTransportBuilder;
|
|
25
|
+
build(): ObservedSfu;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=ObservedSfu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ObservedSfu.d.ts","sourceRoot":"","sources":["../../src/samples/ObservedSfu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAiC,MAAM,0BAA0B,CAAC;AAEjG,OAAO,EAAE,oBAAoB,EAA+B,MAAM,wBAAwB,CAAC;AAE3F,MAAM,WAAW,WAAW;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,qBAAqB,IAAI,gBAAgB,CAAC,oBAAoB,CAAC,CAAC;IAChE,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;IACzE,OAAO,IAAI,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAEvC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAE7B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,kBAAkB;IAM7B,OAAO,CAAC,OAAO;IALhB,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,aAAa,CAAC,CAAS;IAC/B,OAAO,CAAC,cAAc,CAAkD;IACxE,OAAO,CAAC,WAAW,CAAmB;gBAE7B,OAAO,EAAE,IAAI,CACpB,WAAW,EACT,MAAM,gBAAgB,CAAC,sBAAsB,CAAC,GAC9C,SAAS,GACT,uBAAuB,GACvB,yBAAyB,GACzB,cAAc,GACd,cAAc,CAChB;IAGK,YAAY,CAAC,SAAS,EAAE,SAAS;IAwCxC,OAAO,CAAC,+BAA+B;IAWhC,KAAK,IAAI,WAAW;CAkB3B"}
|