@observertc/observer-js 0.9.26-beta → 0.30.0-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/ObservedCall.d.ts +54 -0
- package/lib/ObservedCall.d.ts.map +1 -0
- package/lib/ObservedCall.js +166 -0
- package/lib/ObservedClient.d.ts +73 -0
- package/lib/ObservedClient.d.ts.map +1 -0
- package/lib/ObservedClient.js +487 -0
- package/lib/ObservedInboundTrack.d.ts +65 -0
- package/lib/ObservedInboundTrack.d.ts.map +1 -0
- package/lib/ObservedInboundTrack.js +192 -0
- package/lib/ObservedOutboundTrack.d.ts +55 -0
- package/lib/ObservedOutboundTrack.d.ts.map +1 -0
- package/lib/ObservedOutboundTrack.js +166 -0
- package/lib/ObservedPeerConnection.d.ts +57 -0
- package/lib/ObservedPeerConnection.d.ts.map +1 -0
- package/lib/ObservedPeerConnection.js +217 -0
- package/lib/Observer.d.ts +26 -1465
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +53 -605
- package/lib/{sinks/ObserverSink.d.ts → ReportsCollector.d.ts} +7 -23
- package/lib/ReportsCollector.d.ts.map +1 -0
- package/lib/{sinks/ObserverSink.js → ReportsCollector.js} +27 -85
- package/lib/common/ReportsCollector.d.ts +21 -24
- package/lib/common/ReportsCollector.d.ts.map +1 -1
- package/lib/common/ReportsCollector.js +24 -0
- package/lib/common/SingleExecutor.d.ts +3 -0
- package/lib/common/SingleExecutor.d.ts.map +1 -0
- package/lib/common/SingleExecutor.js +31 -0
- package/lib/common/TypedEventEmitter.d.ts +22 -0
- package/lib/common/TypedEventEmitter.d.ts.map +1 -0
- package/lib/common/TypedEventEmitter.js +11 -0
- package/lib/common/callEventReports.d.ts.map +1 -0
- package/lib/common/logger.d.ts +3 -9
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +58 -141
- package/lib/common/types.d.ts +2 -14
- package/lib/common/types.d.ts.map +1 -1
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +6 -1
- package/lib/index.d.ts +8 -19
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -2
- package/package.json +1 -1
- package/src/ObservedCall.ts +201 -0
- package/src/ObservedClient.ts +681 -0
- package/src/ObservedInboundTrack.ts +238 -0
- package/src/ObservedOutboundTrack.ts +205 -0
- package/src/ObservedPeerConnection.ts +249 -0
- package/src/Observer.ts +86 -442
- package/src/{sinks/ObserverSink.ts → ReportsCollector.ts} +29 -94
- package/src/common/ReportsCollector.ts +48 -23
- package/src/common/SingleExecutor.ts +36 -0
- package/src/common/TypedEventEmitter.ts +32 -0
- package/src/common/logger.ts +58 -161
- package/src/common/types.ts +4 -24
- package/src/common/utils.ts +6 -0
- package/src/index.ts +12 -23
- package/lib/Evaluator.d.ts +0 -43
- package/lib/Evaluator.d.ts.map +0 -1
- package/lib/Evaluator.js +0 -171
- package/lib/common/Semaphore.d.ts +0 -31
- package/lib/common/Semaphore.d.ts.map +0 -1
- package/lib/common/Semaphore.js +0 -16
- package/lib/entries/CallEntry.d.ts +0 -619
- package/lib/entries/CallEntry.d.ts.map +0 -1
- package/lib/entries/CallEntry.js +0 -75
- package/lib/entries/ClientEntry.d.ts +0 -478
- package/lib/entries/ClientEntry.d.ts.map +0 -1
- package/lib/entries/ClientEntry.js +0 -114
- package/lib/entries/InboundTrackEntry.d.ts +0 -682
- package/lib/entries/InboundTrackEntry.d.ts.map +0 -1
- package/lib/entries/InboundTrackEntry.js +0 -76
- package/lib/entries/OutboundTrackEntry.d.ts +0 -682
- package/lib/entries/OutboundTrackEntry.d.ts.map +0 -1
- package/lib/entries/OutboundTrackEntry.js +0 -73
- package/lib/entries/PeerConnectionEntry.d.ts +0 -505
- package/lib/entries/PeerConnectionEntry.d.ts.map +0 -1
- package/lib/entries/PeerConnectionEntry.js +0 -144
- package/lib/entries/SfuEntry.d.ts +0 -150
- package/lib/entries/SfuEntry.d.ts.map +0 -1
- package/lib/entries/SfuEntry.js +0 -77
- package/lib/entries/SfuInboundRtpPadEntry.d.ts +0 -14
- package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +0 -1
- package/lib/entries/SfuInboundRtpPadEntry.js +0 -49
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts +0 -14
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +0 -1
- package/lib/entries/SfuOutboundRtpPadEntry.js +0 -47
- package/lib/entries/SfuSctpChannelEntry.d.ts +0 -12
- package/lib/entries/SfuSctpChannelEntry.d.ts.map +0 -1
- package/lib/entries/SfuSctpChannelEntry.js +0 -43
- package/lib/entries/SfuTransportEntry.d.ts +0 -82
- package/lib/entries/SfuTransportEntry.d.ts.map +0 -1
- package/lib/entries/SfuTransportEntry.js +0 -122
- package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts +0 -9
- package/lib/evaluators/SetClientsCoordinateEvaluator.d.ts.map +0 -1
- package/lib/evaluators/SetClientsCoordinateEvaluator.js +0 -95
- package/lib/middlewares/CallOperationsContext.d.ts +0 -18
- package/lib/middlewares/CallOperationsContext.d.ts.map +0 -1
- package/lib/middlewares/CallOperationsContext.js +0 -27
- package/lib/middlewares/CallProcessor.d.ts +0 -6
- package/lib/middlewares/CallProcessor.d.ts.map +0 -1
- package/lib/middlewares/CallProcessor.js +0 -36
- package/lib/middlewares/CommitTransactionMiddleware.d.ts +0 -6
- package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +0 -1
- package/lib/middlewares/CommitTransactionMiddleware.js +0 -179
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts +0 -6
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +0 -1
- package/lib/middlewares/DeleteOutdatedCallEntries.js +0 -121
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts +0 -6
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +0 -1
- package/lib/middlewares/DeleteOutdatedSfuEntries.js +0 -127
- package/lib/middlewares/Middleware.d.ts +0 -3
- package/lib/middlewares/Middleware.d.ts.map +0 -1
- package/lib/middlewares/Middleware.js +0 -21
- package/lib/middlewares/Processor.d.ts +0 -9
- package/lib/middlewares/Processor.d.ts.map +0 -1
- package/lib/middlewares/Processor.js +0 -54
- package/lib/middlewares/TransactionContext.d.ts +0 -35
- package/lib/middlewares/TransactionContext.d.ts.map +0 -1
- package/lib/middlewares/TransactionContext.js +0 -90
- package/lib/middlewares/TransactoinProcessor.d.ts +0 -6
- package/lib/middlewares/TransactoinProcessor.d.ts.map +0 -1
- package/lib/middlewares/TransactoinProcessor.js +0 -17
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts +0 -7
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +0 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.js +0 -96
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts +0 -6
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +0 -1
- package/lib/middlewares/VisitObservedSfusMiddleware.js +0 -151
- package/lib/middlewares/visitors/visitClient.d.ts +0 -5
- package/lib/middlewares/visitors/visitClient.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitClient.js +0 -174
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitInboundAudioTrack.js +0 -93
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitInboundVideoTrack.js +0 -94
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts +0 -5
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitOutboundAudioTrack.js +0 -90
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts +0 -5
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitOutboundVideoTarck.js +0 -90
- package/lib/middlewares/visitors/visitPeerConnection.d.ts +0 -5
- package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitPeerConnection.js +0 -111
- package/lib/middlewares/visitors/visitSfu.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfu.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfu.js +0 -78
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +0 -56
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +0 -56
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuSctpChannel.js +0 -55
- package/lib/middlewares/visitors/visitSfuTransport.d.ts +0 -5
- package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +0 -1
- package/lib/middlewares/visitors/visitSfuTransport.js +0 -56
- package/lib/processes/closePeerConnectionProcess.d.ts +0 -10
- package/lib/processes/closePeerConnectionProcess.d.ts.map +0 -1
- package/lib/processes/closePeerConnectionProcess.js +0 -51
- package/lib/processes/detachClientProcess.d.ts +0 -14
- package/lib/processes/detachClientProcess.d.ts.map +0 -1
- package/lib/processes/detachClientProcess.js +0 -106
- package/lib/processes/findRemoteMatches.d.ts +0 -9
- package/lib/processes/findRemoteMatches.d.ts.map +0 -1
- package/lib/processes/findRemoteMatches.js +0 -96
- package/lib/processes/inboundTrackRemoved.d.ts +0 -9
- package/lib/processes/inboundTrackRemoved.d.ts.map +0 -1
- package/lib/processes/inboundTrackRemoved.js +0 -22
- package/lib/processes/joinClientProcess.d.ts +0 -11
- package/lib/processes/joinClientProcess.d.ts.map +0 -1
- package/lib/processes/joinClientProcess.js +0 -120
- package/lib/processes/outboundTrackRemoved.d.ts +0 -9
- package/lib/processes/outboundTrackRemoved.d.ts.map +0 -1
- package/lib/processes/outboundTrackRemoved.js +0 -22
- package/lib/samples/ObservedCall.d.ts +0 -17
- package/lib/samples/ObservedCall.d.ts.map +0 -1
- package/lib/samples/ObservedCall.js +0 -29
- package/lib/samples/ObservedCalls.d.ts +0 -19
- package/lib/samples/ObservedCalls.d.ts.map +0 -1
- package/lib/samples/ObservedCalls.js +0 -113
- package/lib/samples/ObservedClient.d.ts +0 -28
- package/lib/samples/ObservedClient.d.ts.map +0 -1
- package/lib/samples/ObservedClient.js +0 -110
- package/lib/samples/ObservedInboundAudioTrack.d.ts +0 -17
- package/lib/samples/ObservedInboundAudioTrack.d.ts.map +0 -1
- package/lib/samples/ObservedInboundAudioTrack.js +0 -17
- package/lib/samples/ObservedInboundVideoTrack.d.ts +0 -17
- package/lib/samples/ObservedInboundVideoTrack.d.ts.map +0 -1
- package/lib/samples/ObservedInboundVideoTrack.js +0 -17
- package/lib/samples/ObservedOutboundAudioTrack.d.ts +0 -16
- package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +0 -1
- package/lib/samples/ObservedOutboundAudioTrack.js +0 -17
- package/lib/samples/ObservedOutboundVideoTrack.d.ts +0 -16
- package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +0 -1
- package/lib/samples/ObservedOutboundVideoTrack.js +0 -17
- package/lib/samples/ObservedPeerConnection.d.ts +0 -47
- package/lib/samples/ObservedPeerConnection.d.ts.map +0 -1
- package/lib/samples/ObservedPeerConnection.js +0 -130
- package/lib/samples/ObservedSfu.d.ts +0 -27
- package/lib/samples/ObservedSfu.d.ts.map +0 -1
- package/lib/samples/ObservedSfu.js +0 -65
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts +0 -15
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +0 -1
- package/lib/samples/ObservedSfuInboundRtpPad.js +0 -17
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts +0 -15
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +0 -1
- package/lib/samples/ObservedSfuOutboundRtpPad.js +0 -17
- package/lib/samples/ObservedSfuSctpChannel.d.ts +0 -15
- package/lib/samples/ObservedSfuSctpChannel.d.ts.map +0 -1
- package/lib/samples/ObservedSfuSctpChannel.js +0 -17
- package/lib/samples/ObservedSfuTransport.d.ts +0 -30
- package/lib/samples/ObservedSfuTransport.d.ts.map +0 -1
- package/lib/samples/ObservedSfuTransport.js +0 -86
- package/lib/samples/ObservedSfus.d.ts +0 -16
- package/lib/samples/ObservedSfus.d.ts.map +0 -1
- package/lib/samples/ObservedSfus.js +0 -72
- package/lib/sinks/ObserverSink.d.ts.map +0 -1
- package/lib/sinks/callEventReports.d.ts.map +0 -1
- package/lib/sources/ObservedCallSource.d.ts +0 -18
- package/lib/sources/ObservedCallSource.d.ts.map +0 -1
- package/lib/sources/ObservedCallSource.js +0 -2
- package/lib/sources/ObservedClientSource.d.ts +0 -19
- package/lib/sources/ObservedClientSource.d.ts.map +0 -1
- package/lib/sources/ObservedClientSource.js +0 -2
- package/lib/sources/ObservedSfuSource.d.ts +0 -15
- package/lib/sources/ObservedSfuSource.d.ts.map +0 -1
- package/lib/sources/ObservedSfuSource.js +0 -2
- package/lib/sources/Sources.d.ts +0 -47
- package/lib/sources/Sources.d.ts.map +0 -1
- package/lib/sources/Sources.js +0 -211
- package/src/Evaluator.ts +0 -229
- package/src/common/Semaphore.ts +0 -45
- package/src/entries/CallEntry.ts +0 -62
- package/src/entries/ClientEntry.ts +0 -106
- package/src/entries/InboundTrackEntry.ts +0 -74
- package/src/entries/OutboundTrackEntry.ts +0 -72
- package/src/entries/PeerConnectionEntry.ts +0 -133
- package/src/entries/SfuEntry.ts +0 -62
- package/src/entries/SfuInboundRtpPadEntry.ts +0 -46
- package/src/entries/SfuOutboundRtpPadEntry.ts +0 -44
- package/src/entries/SfuSctpChannelEntry.ts +0 -39
- package/src/entries/SfuTransportEntry.ts +0 -109
- package/src/evaluators/SetClientsCoordinateEvaluator.ts +0 -78
- package/src/middlewares/CallOperationsContext.ts +0 -56
- package/src/middlewares/CallProcessor.ts +0 -38
- package/src/middlewares/CommitTransactionMiddleware.ts +0 -328
- package/src/middlewares/DeleteOutdatedCallEntries.ts +0 -159
- package/src/middlewares/DeleteOutdatedSfuEntries.ts +0 -168
- package/src/middlewares/Middleware.ts +0 -10
- package/src/middlewares/Processor.ts +0 -59
- package/src/middlewares/TransactionContext.ts +0 -176
- package/src/middlewares/TransactoinProcessor.ts +0 -28
- package/src/middlewares/VisitObservedCallsMiddleware.ts +0 -172
- package/src/middlewares/VisitObservedSfusMiddleware.ts +0 -203
- package/src/middlewares/visitors/visitClient.ts +0 -239
- package/src/middlewares/visitors/visitInboundAudioTrack.ts +0 -113
- package/src/middlewares/visitors/visitInboundVideoTrack.ts +0 -117
- package/src/middlewares/visitors/visitOutboundAudioTrack.ts +0 -100
- package/src/middlewares/visitors/visitOutboundVideoTarck.ts +0 -102
- package/src/middlewares/visitors/visitPeerConnection.ts +0 -151
- package/src/middlewares/visitors/visitSfu.ts +0 -70
- package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +0 -52
- package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +0 -53
- package/src/middlewares/visitors/visitSfuSctpChannel.ts +0 -50
- package/src/middlewares/visitors/visitSfuTransport.ts +0 -50
- package/src/processes/closePeerConnectionProcess.ts +0 -54
- package/src/processes/detachClientProcess.ts +0 -136
- package/src/processes/findRemoteMatches.ts +0 -104
- package/src/processes/inboundTrackRemoved.ts +0 -22
- package/src/processes/joinClientProcess.ts +0 -138
- package/src/processes/outboundTrackRemoved.ts +0 -22
- package/src/samples/ObservedCall.ts +0 -49
- package/src/samples/ObservedCalls.ts +0 -143
- package/src/samples/ObservedClient.ts +0 -172
- package/src/samples/ObservedInboundAudioTrack.ts +0 -35
- package/src/samples/ObservedInboundVideoTrack.ts +0 -36
- package/src/samples/ObservedOutboundAudioTrack.ts +0 -35
- package/src/samples/ObservedOutboundVideoTrack.ts +0 -35
- package/src/samples/ObservedPeerConnection.ts +0 -227
- package/src/samples/ObservedSfu.ts +0 -115
- package/src/samples/ObservedSfuInboundRtpPad.ts +0 -35
- package/src/samples/ObservedSfuOutboundRtpPad.ts +0 -35
- package/src/samples/ObservedSfuSctpChannel.ts +0 -35
- package/src/samples/ObservedSfuTransport.ts +0 -142
- package/src/samples/ObservedSfus.ts +0 -95
- package/src/sources/ObservedCallSource.ts +0 -26
- package/src/sources/ObservedClientSource.ts +0 -28
- package/src/sources/ObservedSfuSource.ts +0 -19
- package/src/sources/Sources.ts +0 -294
- /package/lib/{sinks → common}/callEventReports.d.ts +0 -0
- /package/lib/{sinks → common}/callEventReports.js +0 -0
- /package/src/{sinks → common}/callEventReports.ts +0 -0
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createDeleteOutdatedCallEntries = exports.logger = void 0;
|
|
13
|
-
const logger_1 = require("../common/logger");
|
|
14
|
-
exports.logger = (0, logger_1.createLogger)('DeleteOutdatedCallEntries');
|
|
15
|
-
function createDeleteOutdatedCallEntries(storages, maxIdleTimeInMs) {
|
|
16
|
-
const process = (transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const { clients, evaluatorContext, updatedPeerConnections, deletedPeerConnections, updatedInboundAudioTracks, deletedInboundAudioTracks, updatedInboundVideoTracks, deletedInboundVideoTracks, updatedOutboundAudioTracks, deletedOutboundAudioTracks, updatedOutboundVideoTracks, deletedOutboundVideoTracks, } = transaction;
|
|
18
|
-
const now = BigInt(Date.now());
|
|
19
|
-
const deletedCallIds = new Set(evaluatorContext.endedCalls.map((c) => c.callId).filter((id) => Boolean(id)));
|
|
20
|
-
const deletedClientIds = new Set(evaluatorContext.detachedClients.map((c) => c.clientId).filter((id) => Boolean(id)));
|
|
21
|
-
for (const [peerConnectionId, peerConnection] of storages.peerConnectionStorage.localEntries()) {
|
|
22
|
-
if (updatedPeerConnections.has(peerConnectionId)) {
|
|
23
|
-
continue;
|
|
24
|
-
}
|
|
25
|
-
const { touched, clientId, callId } = peerConnection;
|
|
26
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
27
|
-
if (!deletedCallIds.has(callId !== null && callId !== void 0 ? callId : 'not exists') &&
|
|
28
|
-
!deletedClientIds.has(clientId !== null && clientId !== void 0 ? clientId : 'not exists')) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
deletedPeerConnections.add(peerConnectionId);
|
|
33
|
-
if (clientId) {
|
|
34
|
-
let storedClient = clients.get(clientId);
|
|
35
|
-
if (storedClient) {
|
|
36
|
-
storedClient.peerConnectionIds = storedClient.peerConnectionIds.filter((pcId) => pcId !== peerConnectionId);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
storedClient = yield storages.clientStorage.get(clientId);
|
|
40
|
-
if (storedClient) {
|
|
41
|
-
storedClient.peerConnectionIds = storedClient.peerConnectionIds.filter((pcId) => pcId !== peerConnectionId);
|
|
42
|
-
yield storages.clientStorage.set(clientId, storedClient);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
for (const [trackId, inboundTrack] of storages.inboundTrackStorage.localEntries()) {
|
|
48
|
-
if (updatedInboundAudioTracks.has(trackId) || updatedInboundVideoTracks.has(trackId)) {
|
|
49
|
-
continue;
|
|
50
|
-
}
|
|
51
|
-
const { touched, clientId, callId, peerConnectionId } = inboundTrack;
|
|
52
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
53
|
-
if (!deletedCallIds.has(callId !== null && callId !== void 0 ? callId : 'not exists') &&
|
|
54
|
-
!deletedClientIds.has(clientId !== null && clientId !== void 0 ? clientId : 'not exists') &&
|
|
55
|
-
!deletedPeerConnections.has(peerConnectionId !== null && peerConnectionId !== void 0 ? peerConnectionId : 'not exists')) {
|
|
56
|
-
continue;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
switch (inboundTrack.kind) {
|
|
60
|
-
case 'audio':
|
|
61
|
-
deletedInboundAudioTracks.add(trackId);
|
|
62
|
-
break;
|
|
63
|
-
case 'video':
|
|
64
|
-
deletedInboundVideoTracks.add(trackId);
|
|
65
|
-
}
|
|
66
|
-
if (peerConnectionId) {
|
|
67
|
-
let storedPeerConnection = updatedPeerConnections.get(peerConnectionId);
|
|
68
|
-
if (!storedPeerConnection) {
|
|
69
|
-
storedPeerConnection = yield storages.peerConnectionStorage.get(peerConnectionId);
|
|
70
|
-
if (storedPeerConnection) {
|
|
71
|
-
updatedPeerConnections.set(peerConnectionId, storedPeerConnection);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
if (storedPeerConnection) {
|
|
75
|
-
storedPeerConnection.inboundTrackIds = storedPeerConnection.inboundTrackIds.filter((tId) => tId !== trackId);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
// console.warn("auodiaussdoi", updatedOutboundAudioTracks, updatedOutboundVideoTracks);
|
|
80
|
-
for (const [trackId, outboundTrack] of storages.outboundTrackStorage.localEntries()) {
|
|
81
|
-
if (updatedOutboundAudioTracks.has(trackId) || updatedOutboundVideoTracks.has(trackId)) {
|
|
82
|
-
continue;
|
|
83
|
-
}
|
|
84
|
-
const { touched, clientId, callId, peerConnectionId } = outboundTrack;
|
|
85
|
-
// console.warn("deprecated outb tracks", outboundTrack, now, touched, maxIdleTimeInMs, touched && now - touched < maxIdleTimeInMs, callId)
|
|
86
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
87
|
-
if (!deletedCallIds.has(callId !== null && callId !== void 0 ? callId : 'not exists') &&
|
|
88
|
-
!deletedClientIds.has(clientId !== null && clientId !== void 0 ? clientId : 'not exists') &&
|
|
89
|
-
!deletedPeerConnections.has(peerConnectionId !== null && peerConnectionId !== void 0 ? peerConnectionId : 'not exists')) {
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
switch (outboundTrack.kind) {
|
|
94
|
-
case 'audio':
|
|
95
|
-
deletedOutboundAudioTracks.add(trackId);
|
|
96
|
-
break;
|
|
97
|
-
case 'video':
|
|
98
|
-
deletedOutboundVideoTracks.add(trackId);
|
|
99
|
-
}
|
|
100
|
-
if (peerConnectionId) {
|
|
101
|
-
let storedPeerConnection = updatedPeerConnections.get(peerConnectionId);
|
|
102
|
-
if (!storedPeerConnection) {
|
|
103
|
-
storedPeerConnection = yield storages.peerConnectionStorage.get(peerConnectionId);
|
|
104
|
-
if (storedPeerConnection) {
|
|
105
|
-
updatedPeerConnections.set(peerConnectionId, storedPeerConnection);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
if (storedPeerConnection) {
|
|
109
|
-
storedPeerConnection.outboundTrackIds = storedPeerConnection.outboundTrackIds.filter((tId) => tId !== trackId);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
const result = (context, next) => __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
yield process(context);
|
|
116
|
-
if (next)
|
|
117
|
-
yield next(context);
|
|
118
|
-
});
|
|
119
|
-
return result;
|
|
120
|
-
}
|
|
121
|
-
exports.createDeleteOutdatedCallEntries = createDeleteOutdatedCallEntries;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Middleware } from './Middleware';
|
|
2
|
-
import { TransactionContext } from './TransactionContext';
|
|
3
|
-
import { StorageProvider } from '..';
|
|
4
|
-
export declare const logger: import("../common/logger").WrappedLogger;
|
|
5
|
-
export declare function createDeleteOutdatedSfuEntries(storages: StorageProvider, maxIdleTimeInMs: bigint): Middleware<TransactionContext>;
|
|
6
|
-
//# sourceMappingURL=DeleteOutdatedSfuEntries.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DeleteOutdatedSfuEntries.d.ts","sourceRoot":"","sources":["../../src/middlewares/DeleteOutdatedSfuEntries.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,MAAM,IAAI,CAAC;AAErC,eAAO,MAAM,MAAM,0CAA2C,CAAC;AAE/D,wBAAgB,8BAA8B,CAC7C,QAAQ,EAAE,eAAe,EACzB,eAAe,EAAE,MAAM,GACrB,UAAU,CAAC,kBAAkB,CAAC,CA6JhC"}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createDeleteOutdatedSfuEntries = exports.logger = void 0;
|
|
13
|
-
const logger_1 = require("../common/logger");
|
|
14
|
-
exports.logger = (0, logger_1.createLogger)('DeleteOutdatedSfuEntries');
|
|
15
|
-
function createDeleteOutdatedSfuEntries(storages, maxIdleTimeInMs) {
|
|
16
|
-
const process = (transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
17
|
-
const { updatedSfus, deletedSfus, updatedSfuTransports, deletedSfuTransports, updatedSfuInboundRtpPads, deletedSfuInboundRtpPads, updatedSfuOutboundRtpPads, deletedSfuOutboundRtpPads, updatedSfuSctpChannels, deletedSfuSctpChannels } = transaction;
|
|
18
|
-
const now = BigInt(Date.now());
|
|
19
|
-
for (const [sfuTransportId, sfuTransport] of storages.sfuTransportStorage.localEntries()) {
|
|
20
|
-
if (updatedSfuTransports.has(sfuTransportId)) {
|
|
21
|
-
continue;
|
|
22
|
-
}
|
|
23
|
-
const { touched, sfuId } = sfuTransport;
|
|
24
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
25
|
-
if (!deletedSfus.has(sfuId !== null && sfuId !== void 0 ? sfuId : 'not exists')) {
|
|
26
|
-
continue;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
deletedSfuTransports.add(sfuTransportId);
|
|
30
|
-
if (sfuId) {
|
|
31
|
-
let storedSfu = updatedSfus.get(sfuId);
|
|
32
|
-
if (storedSfu) {
|
|
33
|
-
storedSfu.sfuTransportIds = storedSfu.sfuTransportIds.filter((transportId) => transportId !== sfuTransportId);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
storedSfu = yield storages.sfuStorage.get(sfuId);
|
|
37
|
-
if (storedSfu) {
|
|
38
|
-
storedSfu.sfuTransportIds = storedSfu.sfuTransportIds.filter((transportId) => transportId !== sfuTransportId);
|
|
39
|
-
yield storages.sfuStorage.set(sfuId, storedSfu);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
for (const [sfuInboundPadId, sfuInboundPad] of storages.sfuInboundRtpPadStorage.localEntries()) {
|
|
45
|
-
if (updatedSfuInboundRtpPads.has(sfuInboundPadId)) {
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
const { touched, sfuTransportId, sfuId } = sfuInboundPad;
|
|
49
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
50
|
-
if (!deletedSfuTransports.has(sfuTransportId !== null && sfuTransportId !== void 0 ? sfuTransportId : 'not exists') &&
|
|
51
|
-
!deletedSfus.has(sfuId !== null && sfuId !== void 0 ? sfuId : 'not exists')) {
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
deletedSfuInboundRtpPads.add(sfuInboundPadId);
|
|
56
|
-
if (sfuTransportId) {
|
|
57
|
-
let storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
58
|
-
if (!storedSfuTransport) {
|
|
59
|
-
storedSfuTransport = yield storages.sfuTransportStorage.get(sfuTransportId);
|
|
60
|
-
if (storedSfuTransport) {
|
|
61
|
-
updatedSfuTransports.set(sfuTransportId, storedSfuTransport);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (storedSfuTransport) {
|
|
65
|
-
storedSfuTransport.inboundRtpPadIds = storedSfuTransport.inboundRtpPadIds.filter((tId) => tId !== sfuInboundPadId);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
for (const [sfuOutboundPadId, sfuOutboundPad] of storages.sfuOutboundRtpPadStorage.localEntries()) {
|
|
70
|
-
if (updatedSfuOutboundRtpPads.has(sfuOutboundPadId)) {
|
|
71
|
-
continue;
|
|
72
|
-
}
|
|
73
|
-
const { touched, sfuTransportId, sfuId } = sfuOutboundPad;
|
|
74
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
75
|
-
if (!deletedSfuTransports.has(sfuTransportId !== null && sfuTransportId !== void 0 ? sfuTransportId : 'not exists') &&
|
|
76
|
-
!deletedSfus.has(sfuId !== null && sfuId !== void 0 ? sfuId : 'not exists')) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
deletedSfuOutboundRtpPads.add(sfuOutboundPadId);
|
|
81
|
-
if (sfuTransportId) {
|
|
82
|
-
let storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
83
|
-
if (!storedSfuTransport) {
|
|
84
|
-
storedSfuTransport = yield storages.sfuTransportStorage.get(sfuTransportId);
|
|
85
|
-
if (storedSfuTransport) {
|
|
86
|
-
updatedSfuTransports.set(sfuTransportId, storedSfuTransport);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
if (storedSfuTransport) {
|
|
90
|
-
storedSfuTransport.outboundRtpPadIds = storedSfuTransport.outboundRtpPadIds.filter((tId) => tId !== sfuOutboundPadId);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
for (const [sctpChannelId, sctpChannel] of storages.sfuSctpChannelStorage.localEntries()) {
|
|
95
|
-
if (updatedSfuSctpChannels.has(sctpChannelId)) {
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
const { touched, sfuTransportId, sfuId } = sctpChannel;
|
|
99
|
-
if (touched && now - touched < maxIdleTimeInMs) {
|
|
100
|
-
if (!deletedSfuTransports.has(sfuTransportId !== null && sfuTransportId !== void 0 ? sfuTransportId : 'not exists') &&
|
|
101
|
-
!deletedSfus.has(sfuId !== null && sfuId !== void 0 ? sfuId : 'not exists')) {
|
|
102
|
-
continue;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
deletedSfuSctpChannels.add(sctpChannelId);
|
|
106
|
-
if (sfuTransportId) {
|
|
107
|
-
let storedSfuTransport = updatedSfuTransports.get(sfuTransportId);
|
|
108
|
-
if (!storedSfuTransport) {
|
|
109
|
-
storedSfuTransport = yield storages.sfuTransportStorage.get(sfuTransportId);
|
|
110
|
-
if (storedSfuTransport) {
|
|
111
|
-
updatedSfuTransports.set(sfuTransportId, storedSfuTransport);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (storedSfuTransport) {
|
|
115
|
-
storedSfuTransport.sctpChannelIds = storedSfuTransport.sctpChannelIds.filter((tId) => tId !== sctpChannelId);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
const result = (context, next) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
yield process(context);
|
|
122
|
-
if (next)
|
|
123
|
-
yield next(context);
|
|
124
|
-
});
|
|
125
|
-
return result;
|
|
126
|
-
}
|
|
127
|
-
exports.createDeleteOutdatedSfuEntries = createDeleteOutdatedSfuEntries;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Middleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/Middleware.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAE9E,wBAAgB,gCAAgC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,iBAOvF"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createMiddlewareFromAsyncProcess = void 0;
|
|
13
|
-
function createMiddlewareFromAsyncProcess(process) {
|
|
14
|
-
const middleware = (input, next) => __awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
yield process(input);
|
|
16
|
-
if (next)
|
|
17
|
-
yield next(input);
|
|
18
|
-
});
|
|
19
|
-
return middleware;
|
|
20
|
-
}
|
|
21
|
-
exports.createMiddlewareFromAsyncProcess = createMiddlewareFromAsyncProcess;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Middleware } from './Middleware';
|
|
2
|
-
export interface Processor<T> {
|
|
3
|
-
use(value: T): Promise<void | T>;
|
|
4
|
-
addMiddleware(...middlewares: Middleware<T>[]): Processor<T>;
|
|
5
|
-
removeMiddleware(...middlewares: Middleware<T>[]): Processor<T>;
|
|
6
|
-
getSize(): number;
|
|
7
|
-
}
|
|
8
|
-
export declare function createProcessor<T>(...processes: Middleware<T>[]): Processor<T>;
|
|
9
|
-
//# sourceMappingURL=Processor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Processor.d.ts","sourceRoot":"","sources":["../../src/middlewares/Processor.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAI1C,MAAM,WAAW,SAAS,CAAC,CAAC;IAC3B,GAAG,CAAC,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC;IACjC,aAAa,CAAC,GAAG,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7D,gBAAgB,CAAC,GAAG,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAChE,OAAO,IAAI,MAAM,CAAC;CAClB;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,GAAG,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CA8C9E"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createProcessor = void 0;
|
|
13
|
-
const logger_1 = require("../common/logger");
|
|
14
|
-
const logger = (0, logger_1.createLogger)('Middleware');
|
|
15
|
-
function createProcessor(...processes) {
|
|
16
|
-
const stack = [...processes];
|
|
17
|
-
const result = {
|
|
18
|
-
addMiddleware: (...middlewares) => {
|
|
19
|
-
if (middlewares && 0 < middlewares.length) {
|
|
20
|
-
stack.push(...middlewares);
|
|
21
|
-
}
|
|
22
|
-
return result;
|
|
23
|
-
},
|
|
24
|
-
removeMiddleware: (...middlewares) => {
|
|
25
|
-
if (middlewares && 0 < middlewares.length) {
|
|
26
|
-
for (const middleware of middlewares) {
|
|
27
|
-
const index = stack.indexOf(middleware);
|
|
28
|
-
if (0 < index)
|
|
29
|
-
stack.splice(index, 1);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return result;
|
|
33
|
-
},
|
|
34
|
-
use: (value) => __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const executeMiddleware = (input, index) => __awaiter(this, void 0, void 0, function* () {
|
|
36
|
-
if (index >= stack.length) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const process = stack[index];
|
|
40
|
-
const next = (nextInput) => __awaiter(this, void 0, void 0, function* () { return yield executeMiddleware(nextInput, index + 1); });
|
|
41
|
-
return process(input, next).catch((err) => {
|
|
42
|
-
logger.error(`Error occurred executing process ${process.name}`, err);
|
|
43
|
-
return;
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
return executeMiddleware(value, 0);
|
|
47
|
-
}),
|
|
48
|
-
getSize: () => {
|
|
49
|
-
return stack.length;
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
return result;
|
|
53
|
-
}
|
|
54
|
-
exports.createProcessor = createProcessor;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { StorageProvider } from '../storages/StorageProvider';
|
|
2
|
-
import * as Models from '../models/Models';
|
|
3
|
-
import { ObservedCalls } from '../samples/ObservedCalls';
|
|
4
|
-
import { EvaluatorContext } from '../common/types';
|
|
5
|
-
import { Writable } from '../common/utils';
|
|
6
|
-
import { ObservedSfus } from '../samples/ObservedSfus';
|
|
7
|
-
export type TransactionContext = {
|
|
8
|
-
id: string;
|
|
9
|
-
observedCalls: ObservedCalls;
|
|
10
|
-
observedSfus: ObservedSfus;
|
|
11
|
-
clients: ReadonlyMap<string, Models.Client>;
|
|
12
|
-
updatedPeerConnections: Map<string, Models.PeerConnection>;
|
|
13
|
-
deletedPeerConnections: Set<string>;
|
|
14
|
-
updatedInboundAudioTracks: Map<string, Models.InboundTrack>;
|
|
15
|
-
deletedInboundAudioTracks: Set<string>;
|
|
16
|
-
updatedOutboundAudioTracks: Map<string, Models.OutboundTrack>;
|
|
17
|
-
deletedOutboundAudioTracks: Set<string>;
|
|
18
|
-
updatedInboundVideoTracks: Map<string, Models.InboundTrack>;
|
|
19
|
-
deletedInboundVideoTracks: Set<string>;
|
|
20
|
-
updatedOutboundVideoTracks: Map<string, Models.OutboundTrack>;
|
|
21
|
-
deletedOutboundVideoTracks: Set<string>;
|
|
22
|
-
updatedSfus: Map<string, Models.Sfu>;
|
|
23
|
-
deletedSfus: Set<string>;
|
|
24
|
-
updatedSfuTransports: Map<string, Models.SfuTransport>;
|
|
25
|
-
deletedSfuTransports: Set<string>;
|
|
26
|
-
updatedSfuInboundRtpPads: Map<string, Models.SfuInboundRtpPad>;
|
|
27
|
-
deletedSfuInboundRtpPads: Set<string>;
|
|
28
|
-
updatedSfuOutboundRtpPads: Map<string, Models.SfuOutboundRtpPad>;
|
|
29
|
-
deletedSfuOutboundRtpPads: Set<string>;
|
|
30
|
-
updatedSfuSctpChannels: Map<string, Models.SfuSctpChannel>;
|
|
31
|
-
deletedSfuSctpChannels: Set<string>;
|
|
32
|
-
evaluatorContext: Writable<Omit<EvaluatorContext, 'observedCalls' | 'observedSfus'>>;
|
|
33
|
-
};
|
|
34
|
-
export declare function createTransactionContext(evaluatorContext: EvaluatorContext, storageProvider: StorageProvider, observedCalls: ObservedCalls, observedSfus: ObservedSfus): Promise<TransactionContext>;
|
|
35
|
-
//# sourceMappingURL=TransactionContext.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionContext.d.ts","sourceRoot":"","sources":["../../src/middlewares/TransactionContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,MAAM,kBAAkB,GAAG;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,YAAY,CAAC;IAE3B,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAE5C,sBAAsB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC3D,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEpC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5D,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,0BAA0B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9D,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAExC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IAC5D,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,0BAA0B,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC;IAC9D,0BAA0B,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAExC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;IACrC,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEzB,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;IACvD,oBAAoB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAElC,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAC;IAC/D,wBAAwB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEtC,yBAAyB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACjE,yBAAyB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAEvC,sBAAsB,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAC3D,sBAAsB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAGpC,gBAAgB,EAAE,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,eAAe,GAAG,cAAc,CAAC,CAAC,CAAC;CACrF,CAAC;AAEF,wBAAsB,wBAAwB,CAC7C,gBAAgB,EAAE,gBAAgB,EAClC,eAAe,EAAE,eAAe,EAChC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GACxB,OAAO,CAAC,kBAAkB,CAAC,CAyH7B"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createTransactionContext = void 0;
|
|
13
|
-
const uuid_1 = require("uuid");
|
|
14
|
-
function createTransactionContext(evaluatorContext, storageProvider, observedCalls, observedSfus) {
|
|
15
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const { clientStorage, peerConnectionStorage, inboundTrackStorage, outboundTrackStorage, sfuStorage, sfuTransportStorage, sfuInboundRtpPadStorage, sfuOutboundRtpPadStorage, sfuSctpChannelStorage, } = storageProvider;
|
|
17
|
-
const [[clients, peerConnections, inboundAudioTrackEntries, inboundVideoTrackEntries, outboundAudioTrackEntries, outboundVideoTrackEntries,], [sfus, sfuTransports, sfuInboundRtpPads, sfuOutboundRtpPads, sfuSctpChannels]] = yield Promise.all([
|
|
18
|
-
Promise.all([
|
|
19
|
-
clientStorage.getAll(observedCalls.clientIds()),
|
|
20
|
-
peerConnectionStorage.getAll(observedCalls.peerConnectionIds()),
|
|
21
|
-
inboundTrackStorage.getAll(observedCalls.inboundAudioTrackIds()),
|
|
22
|
-
inboundTrackStorage.getAll(observedCalls.inboundVideoTrackIds()),
|
|
23
|
-
outboundTrackStorage.getAll(observedCalls.outboundAudioTrackIds()),
|
|
24
|
-
outboundTrackStorage.getAll(observedCalls.outboundVideoTrackIds()),
|
|
25
|
-
]),
|
|
26
|
-
Promise.all([
|
|
27
|
-
sfuStorage.getAll(observedSfus.sfuIds()),
|
|
28
|
-
sfuTransportStorage.getAll(observedSfus.sfuTransportIds()),
|
|
29
|
-
sfuInboundRtpPadStorage.getAll(observedCalls.peerConnectionIds()),
|
|
30
|
-
sfuOutboundRtpPadStorage.getAll(observedCalls.peerConnectionIds()),
|
|
31
|
-
sfuSctpChannelStorage.getAll(observedCalls.peerConnectionIds()),
|
|
32
|
-
])
|
|
33
|
-
]);
|
|
34
|
-
// const peerConnectionIds = Array.from(clients.values()).flatMap((client) => client.peerConnectionIds);
|
|
35
|
-
// const sfuTransportIds = Array.from(sfus.values()).flatMap((sfu) => sfu.sfuTransportIds);
|
|
36
|
-
// const [peerConnections, sfuTransports] = await Promise.all([
|
|
37
|
-
// peerConnectionStorage.getAll(peerConnectionIds),
|
|
38
|
-
// sfuTransportStorage.getAll(sfuTransportIds),
|
|
39
|
-
// ]);
|
|
40
|
-
// const peerConnectionValues = Array.from(peerConnections.values());
|
|
41
|
-
// const inboundTrackIds = peerConnectionValues.flatMap((pc) => pc.inboundTrackIds);
|
|
42
|
-
// const outboundTrackIds = peerConnectionValues.flatMap((pc) => pc.outboundTrackIds);
|
|
43
|
-
// const sfuTransportValues = Array.from(sfuTransports.values());
|
|
44
|
-
// const sfuInboundRtpPadIds = sfuTransportValues.flatMap((sfuTransport) => sfuTransport.inboundRtpPadIds);
|
|
45
|
-
// const sfuOutboundRtpPadIds = sfuTransportValues.flatMap((sfuTransport) => sfuTransport.outboundRtpPadIds);
|
|
46
|
-
// const sfuSctpChannelIds = sfuTransportValues.flatMap((sfuTransport) => sfuTransport.sctpChannelIds);
|
|
47
|
-
// const [inboundTracks, outboundTracks, sfuInboundRtpPads, sfuOutboundRtpPads, sfuSctpChannels] = await Promise.all([
|
|
48
|
-
// inboundTrackStorage.getAll(inboundTrackIds),
|
|
49
|
-
// outboundTrackStorage.getAll(outboundTrackIds),
|
|
50
|
-
// sfuInboundRtpPadStorage.getAll(sfuInboundRtpPadIds),
|
|
51
|
-
// sfuOutboundRtpPadStorage.getAll(sfuOutboundRtpPadIds),
|
|
52
|
-
// sfuSctpChannelStorage.getAll(sfuSctpChannelIds),
|
|
53
|
-
// ]);
|
|
54
|
-
// const inboundTrackEntries = Array.from(inboundTracks);
|
|
55
|
-
// const outboundTrackEntries = Array.from(outboundTracks);
|
|
56
|
-
// const inboundAudioTrackEntries = inboundTrackEntries.filter((e) => e[1].kind === 'audio');
|
|
57
|
-
// const inboundVideoTrackEntries = inboundTrackEntries.filter((e) => e[1].kind === 'video');
|
|
58
|
-
// const outboundAudioTrackEntries = outboundTrackEntries.filter((e) => e[1].kind === 'audio');
|
|
59
|
-
// const outboundVideoTrackEntries = outboundTrackEntries.filter((e) => e[1].kind === 'video');
|
|
60
|
-
const transactionContext = {
|
|
61
|
-
id: (0, uuid_1.v4)(),
|
|
62
|
-
observedCalls,
|
|
63
|
-
observedSfus,
|
|
64
|
-
clients,
|
|
65
|
-
updatedPeerConnections: new Map(peerConnections.entries()),
|
|
66
|
-
deletedPeerConnections: new Set(),
|
|
67
|
-
updatedInboundAudioTracks: new Map(inboundAudioTrackEntries),
|
|
68
|
-
deletedInboundAudioTracks: new Set(),
|
|
69
|
-
updatedInboundVideoTracks: new Map(inboundVideoTrackEntries),
|
|
70
|
-
deletedInboundVideoTracks: new Set(),
|
|
71
|
-
updatedOutboundAudioTracks: new Map(outboundAudioTrackEntries),
|
|
72
|
-
deletedOutboundAudioTracks: new Set(),
|
|
73
|
-
updatedOutboundVideoTracks: new Map(outboundVideoTrackEntries),
|
|
74
|
-
deletedOutboundVideoTracks: new Set(),
|
|
75
|
-
updatedSfus: new Map(sfus.entries()),
|
|
76
|
-
deletedSfus: new Set(),
|
|
77
|
-
updatedSfuTransports: new Map(sfuTransports.entries()),
|
|
78
|
-
deletedSfuTransports: new Set(),
|
|
79
|
-
updatedSfuInboundRtpPads: new Map(sfuInboundRtpPads.entries()),
|
|
80
|
-
deletedSfuInboundRtpPads: new Set(),
|
|
81
|
-
updatedSfuOutboundRtpPads: new Map(sfuOutboundRtpPads.entries()),
|
|
82
|
-
deletedSfuOutboundRtpPads: new Set(),
|
|
83
|
-
updatedSfuSctpChannels: new Map(sfuSctpChannels.entries()),
|
|
84
|
-
deletedSfuSctpChannels: new Set(),
|
|
85
|
-
evaluatorContext,
|
|
86
|
-
};
|
|
87
|
-
return transactionContext;
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
exports.createTransactionContext = createTransactionContext;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { ReportsCollector } from '../common/ReportsCollector';
|
|
2
|
-
import { StorageProvider } from '../storages/StorageProvider';
|
|
3
|
-
import { Processor } from './Processor';
|
|
4
|
-
import { TransactionContext } from './TransactionContext';
|
|
5
|
-
export declare function createTransactionProcessor(storageProvider: StorageProvider, reportsCollector: ReportsCollector, fetchSamples: boolean, maxIdleTimeInMs: bigint, findRemoteMatches?: boolean): Processor<TransactionContext>;
|
|
6
|
-
//# sourceMappingURL=TransactoinProcessor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TransactoinProcessor.d.ts","sourceRoot":"","sources":["../../src/middlewares/TransactoinProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAI9D,OAAO,EAAE,SAAS,EAAmB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAI1D,wBAAgB,0BAA0B,CACzC,eAAe,EAAE,eAAe,EAChC,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,OAAO,EACrB,eAAe,EAAE,MAAM,EACvB,iBAAiB,CAAC,EAAE,OAAO,GACzB,SAAS,CAAC,kBAAkB,CAAC,CAW/B"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createTransactionProcessor = void 0;
|
|
4
|
-
const CommitTransactionMiddleware_1 = require("./CommitTransactionMiddleware");
|
|
5
|
-
const DeleteOutdatedCallEntries_1 = require("./DeleteOutdatedCallEntries");
|
|
6
|
-
const DeleteOutdatedSfuEntries_1 = require("./DeleteOutdatedSfuEntries");
|
|
7
|
-
const Processor_1 = require("./Processor");
|
|
8
|
-
const VisitObservedCallsMiddleware_1 = require("./VisitObservedCallsMiddleware");
|
|
9
|
-
const VisitObservedSfusMiddleware_1 = require("./VisitObservedSfusMiddleware");
|
|
10
|
-
function createTransactionProcessor(storageProvider, reportsCollector, fetchSamples, maxIdleTimeInMs, findRemoteMatches) {
|
|
11
|
-
return (0, Processor_1.createProcessor)(
|
|
12
|
-
// all of these middlewares must execute sequentially!
|
|
13
|
-
(0, VisitObservedCallsMiddleware_1.createVisitObservedCallsMiddleware)(storageProvider, reportsCollector, fetchSamples, findRemoteMatches), (0, VisitObservedSfusMiddleware_1.createVisitObservedSfusMiddleware)(reportsCollector, fetchSamples), (0, DeleteOutdatedCallEntries_1.createDeleteOutdatedCallEntries)(storageProvider, maxIdleTimeInMs), (0, DeleteOutdatedSfuEntries_1.createDeleteOutdatedSfuEntries)(storageProvider, maxIdleTimeInMs),
|
|
14
|
-
// must be the last one!
|
|
15
|
-
(0, CommitTransactionMiddleware_1.createCommitTransactionMiddleware)(storageProvider, reportsCollector));
|
|
16
|
-
}
|
|
17
|
-
exports.createTransactionProcessor = createTransactionProcessor;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Middleware } from './Middleware';
|
|
2
|
-
import { TransactionContext } from './TransactionContext';
|
|
3
|
-
import { ReportsCollector } from '../common/ReportsCollector';
|
|
4
|
-
import { StorageProvider } from '../storages/StorageProvider';
|
|
5
|
-
export declare const logger: import("../common/logger").WrappedLogger;
|
|
6
|
-
export declare function createVisitObservedCallsMiddleware(storages: StorageProvider, reports: ReportsCollector, fetchSamples: boolean, findRemoteMatches?: boolean): Middleware<TransactionContext>;
|
|
7
|
-
//# sourceMappingURL=VisitObservedCallsMiddleware.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"VisitObservedCallsMiddleware.d.ts","sourceRoot":"","sources":["../../src/middlewares/VisitObservedCallsMiddleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAS9D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,eAAO,MAAM,MAAM,0CAA+C,CAAC;AAInE,wBAAgB,kCAAkC,CACjD,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,gBAAgB,EACzB,YAAY,EAAE,OAAO,EACrB,iBAAiB,CAAC,EAAE,OAAO,GACzB,UAAU,CAAC,kBAAkB,CAAC,CAoJhC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.createVisitObservedCallsMiddleware = exports.logger = void 0;
|
|
13
|
-
const visitClient_1 = require("./visitors/visitClient");
|
|
14
|
-
const visitPeerConnection_1 = require("./visitors/visitPeerConnection");
|
|
15
|
-
const logger_1 = require("../common/logger");
|
|
16
|
-
const visitInboundAudioTrack_1 = require("./visitors/visitInboundAudioTrack");
|
|
17
|
-
const visitOutboundAudioTrack_1 = require("./visitors/visitOutboundAudioTrack");
|
|
18
|
-
const visitOutboundVideoTarck_1 = require("./visitors/visitOutboundVideoTarck");
|
|
19
|
-
const visitInboundVideoTrack_1 = require("./visitors/visitInboundVideoTrack");
|
|
20
|
-
const findRemoteMatches_1 = require("../processes/findRemoteMatches");
|
|
21
|
-
exports.logger = (0, logger_1.createLogger)('VisitObservedCallsMiddleware');
|
|
22
|
-
const emptyMap = new Map();
|
|
23
|
-
function createVisitObservedCallsMiddleware(storages, reports, fetchSamples, findRemoteMatches) {
|
|
24
|
-
const process = (transaction) => __awaiter(this, void 0, void 0, function* () {
|
|
25
|
-
var _a, _b, _c, _d;
|
|
26
|
-
const { observedCalls, clients, updatedPeerConnections, updatedInboundAudioTracks, updatedInboundVideoTracks, updatedOutboundAudioTracks, updatedOutboundVideoTracks, } = transaction;
|
|
27
|
-
const visitedPeerConnectionIds = new Set();
|
|
28
|
-
const visitedInboundAudioTrackIds = new Set();
|
|
29
|
-
const visitedInboundVideoTrackIds = new Set();
|
|
30
|
-
const visitedOutboundAudioTrackIds = new Set();
|
|
31
|
-
const visitedOutboundVideoTrackIds = new Set();
|
|
32
|
-
const { remoteTrackIds, remotePeerConnectionIds, remoteClientIds } = !findRemoteMatches ? {
|
|
33
|
-
remoteTrackIds: emptyMap,
|
|
34
|
-
remotePeerConnectionIds: emptyMap,
|
|
35
|
-
remoteClientIds: emptyMap,
|
|
36
|
-
} : yield (0, findRemoteMatches_1.findRemoteMatches)(storages, clients, new Map([...updatedInboundAudioTracks, ...updatedInboundVideoTracks]));
|
|
37
|
-
const now = BigInt(Date.now());
|
|
38
|
-
const fakeTouched = { touched: BigInt(0) };
|
|
39
|
-
for (const observedCall of observedCalls.observedCalls()) {
|
|
40
|
-
const { callId, serviceId, roomId } = observedCall;
|
|
41
|
-
for (const observedClient of observedCall.observedClients()) {
|
|
42
|
-
const { clientId } = observedClient;
|
|
43
|
-
const storedClient = clients.get(clientId);
|
|
44
|
-
if (!storedClient) {
|
|
45
|
-
// should not happen as client joined must have run before this
|
|
46
|
-
exports.logger.warn('Client has not been registered');
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
(0, visitClient_1.visitClient)(observedClient, storedClient, reports, fetchSamples);
|
|
50
|
-
for (const observedPeerConnection of observedClient.observedPeerConnections()) {
|
|
51
|
-
const { peerConnectionId } = observedPeerConnection;
|
|
52
|
-
(0, visitPeerConnection_1.visitPeerConnection)(observedPeerConnection, storedClient, updatedPeerConnections, reports, fetchSamples);
|
|
53
|
-
const storedPeerConnection = updatedPeerConnections.get(peerConnectionId);
|
|
54
|
-
if (!storedPeerConnection) {
|
|
55
|
-
// should not happen, as the visit function should add the peer connection if it does not exists
|
|
56
|
-
exports.logger.warn(`PeerConnection ${peerConnectionId} has not been registered for client: ${clientId}, call ${callId}, room: ${roomId}, service: ${serviceId}`);
|
|
57
|
-
continue;
|
|
58
|
-
}
|
|
59
|
-
storedPeerConnection.touched = now;
|
|
60
|
-
visitedPeerConnectionIds.add(peerConnectionId);
|
|
61
|
-
for (const observedInboundAudioTrack of observedPeerConnection.inboundAudioTracks()) {
|
|
62
|
-
const { trackId } = observedInboundAudioTrack;
|
|
63
|
-
(0, visitInboundAudioTrack_1.visitInboundAudioTrack)(observedInboundAudioTrack, storedPeerConnection, updatedInboundAudioTracks, reports, fetchSamples, remoteTrackIds.get(trackId), remotePeerConnectionIds.get(trackId), remoteClientIds.get(trackId));
|
|
64
|
-
visitedInboundAudioTrackIds.add(trackId);
|
|
65
|
-
((_a = updatedInboundAudioTracks.get(trackId)) !== null && _a !== void 0 ? _a : fakeTouched).touched = now;
|
|
66
|
-
}
|
|
67
|
-
for (const observedInboundVideoTrack of observedPeerConnection.inboundVideoTracks()) {
|
|
68
|
-
const { trackId } = observedInboundVideoTrack;
|
|
69
|
-
(0, visitInboundVideoTrack_1.visitInboundVideoTrack)(observedInboundVideoTrack, storedPeerConnection, updatedInboundVideoTracks, reports, fetchSamples, remoteTrackIds.get(trackId), remotePeerConnectionIds.get(trackId), remoteClientIds.get(trackId));
|
|
70
|
-
visitedInboundVideoTrackIds.add(trackId);
|
|
71
|
-
((_b = updatedInboundVideoTracks.get(trackId)) !== null && _b !== void 0 ? _b : fakeTouched).touched = now;
|
|
72
|
-
}
|
|
73
|
-
for (const observedOutboundAudioTrack of observedPeerConnection.outboundAudioTracks()) {
|
|
74
|
-
const { trackId } = observedOutboundAudioTrack;
|
|
75
|
-
(0, visitOutboundAudioTrack_1.visitOutboundAudioTrack)(observedOutboundAudioTrack, storedPeerConnection, updatedOutboundAudioTracks, reports, fetchSamples);
|
|
76
|
-
visitedOutboundAudioTrackIds.add(trackId);
|
|
77
|
-
((_c = updatedOutboundAudioTracks.get(trackId)) !== null && _c !== void 0 ? _c : fakeTouched).touched = now;
|
|
78
|
-
}
|
|
79
|
-
for (const observedOutboundVideoTrack of observedPeerConnection.outboundVideoTracks()) {
|
|
80
|
-
const { trackId } = observedOutboundVideoTrack;
|
|
81
|
-
(0, visitOutboundVideoTarck_1.visitOutboundVideoTrack)(observedOutboundVideoTrack, storedPeerConnection, updatedOutboundVideoTracks, reports, fetchSamples);
|
|
82
|
-
visitedOutboundVideoTrackIds.add(trackId);
|
|
83
|
-
((_d = updatedOutboundVideoTracks.get(trackId)) !== null && _d !== void 0 ? _d : fakeTouched).touched = now;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
const result = (context, next) => __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
yield process(context);
|
|
91
|
-
if (next)
|
|
92
|
-
yield next(context);
|
|
93
|
-
});
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
exports.createVisitObservedCallsMiddleware = createVisitObservedCallsMiddleware;
|