@observertc/observer-js 0.9.21-beta → 0.9.23-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/.eslintrc.json +143 -0
- package/lib/Evaluator.d.ts.map +1 -1
- package/lib/Evaluator.js +54 -47
- package/lib/Observer.d.ts +1404 -38
- package/lib/Observer.d.ts.map +1 -1
- package/lib/Observer.js +479 -176
- package/lib/common/Semaphore.d.ts.map +1 -1
- package/lib/common/callMetaReports.d.ts.map +1 -1
- package/lib/common/callMetaReports.js +1 -0
- package/lib/common/logger.d.ts.map +1 -1
- package/lib/common/logger.js +15 -15
- package/lib/common/utils.d.ts +1 -0
- package/lib/common/utils.d.ts.map +1 -1
- package/lib/common/utils.js +12 -1
- package/lib/entries/CallEntry.d.ts +611 -0
- package/lib/entries/CallEntry.d.ts.map +1 -0
- package/lib/entries/CallEntry.js +75 -0
- package/lib/entries/ClientEntry.d.ts +474 -0
- package/lib/entries/ClientEntry.d.ts.map +1 -0
- package/lib/entries/ClientEntry.js +101 -0
- package/lib/entries/InboundTrackEntry.d.ts +670 -0
- package/lib/entries/InboundTrackEntry.d.ts.map +1 -0
- package/lib/entries/InboundTrackEntry.js +76 -0
- package/lib/entries/OutboundTrackEntry.d.ts +670 -0
- package/lib/entries/OutboundTrackEntry.d.ts.map +1 -0
- package/lib/entries/OutboundTrackEntry.js +73 -0
- package/lib/entries/PeerConnectionEntry.d.ts +469 -0
- package/lib/entries/PeerConnectionEntry.d.ts.map +1 -0
- package/lib/entries/PeerConnectionEntry.js +144 -0
- package/lib/entries/SfuEntry.d.ts +150 -0
- package/lib/entries/SfuEntry.d.ts.map +1 -0
- package/lib/entries/SfuEntry.js +77 -0
- package/lib/entries/SfuInboundRtpPadEntry.d.ts +14 -0
- package/lib/entries/SfuInboundRtpPadEntry.d.ts.map +1 -0
- package/lib/entries/SfuInboundRtpPadEntry.js +49 -0
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts +14 -0
- package/lib/entries/SfuOutboundRtpPadEntry.d.ts.map +1 -0
- package/lib/entries/SfuOutboundRtpPadEntry.js +47 -0
- package/lib/entries/SfuSctpChannelEntry.d.ts +12 -0
- package/lib/entries/SfuSctpChannelEntry.d.ts.map +1 -0
- package/lib/entries/SfuSctpChannelEntry.js +43 -0
- package/lib/entries/SfuTransportEntry.d.ts +82 -0
- package/lib/entries/SfuTransportEntry.d.ts.map +1 -0
- package/lib/entries/SfuTransportEntry.js +122 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/middlewares/CallOperationsContext.d.ts.map +1 -1
- package/lib/middlewares/CallOperationsContext.js +2 -6
- package/lib/middlewares/CallProcessor.d.ts.map +1 -1
- package/lib/middlewares/CallProcessor.js +15 -6
- package/lib/middlewares/CommitTransactionMiddleware.d.ts.map +1 -1
- package/lib/middlewares/CommitTransactionMiddleware.js +22 -26
- package/lib/middlewares/DeleteOutdatedCallEntries.d.ts.map +1 -1
- package/lib/middlewares/DeleteOutdatedCallEntries.js +29 -20
- package/lib/middlewares/DeleteOutdatedSfuEntries.d.ts.map +1 -1
- package/lib/middlewares/DeleteOutdatedSfuEntries.js +27 -18
- package/lib/middlewares/Middleware.d.ts.map +1 -1
- package/lib/middlewares/Middleware.js +13 -4
- package/lib/middlewares/Processor.d.ts.map +1 -1
- package/lib/middlewares/Processor.js +18 -9
- package/lib/middlewares/TransactionContext.d.ts.map +1 -1
- package/lib/middlewares/TransactionContext.js +84 -73
- package/lib/middlewares/VisitObservedCallsMiddleware.d.ts.map +1 -1
- package/lib/middlewares/VisitObservedCallsMiddleware.js +16 -7
- package/lib/middlewares/VisitObservedSfusMiddleware.d.ts.map +1 -1
- package/lib/middlewares/VisitObservedSfusMiddleware.js +15 -6
- package/lib/middlewares/visitors/visitClient.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitClient.js +6 -18
- package/lib/middlewares/visitors/visitInboundAudioTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitInboundAudioTrack.js +17 -20
- package/lib/middlewares/visitors/visitInboundVideoTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitInboundVideoTrack.js +16 -21
- package/lib/middlewares/visitors/visitOutboundAudioTrack.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitOutboundAudioTrack.js +16 -16
- package/lib/middlewares/visitors/visitOutboundVideoTarck.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitOutboundVideoTarck.js +16 -17
- package/lib/middlewares/visitors/visitPeerConnection.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitPeerConnection.js +24 -40
- package/lib/middlewares/visitors/visitSfu.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfu.js +6 -7
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuInboundRtpPad.js +3 -7
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuOutboundRtpPad.js +3 -8
- package/lib/middlewares/visitors/visitSfuSctpChannel.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuSctpChannel.js +3 -6
- package/lib/middlewares/visitors/visitSfuTransport.d.ts.map +1 -1
- package/lib/middlewares/visitors/visitSfuTransport.js +3 -6
- package/lib/processes/closePeerConnectionProcess.d.ts.map +1 -1
- package/lib/processes/closePeerConnectionProcess.js +14 -5
- package/lib/processes/detachClientProcess.d.ts.map +1 -1
- package/lib/processes/detachClientProcess.js +20 -17
- package/lib/processes/findRemoteMatches.d.ts +2 -2
- package/lib/processes/findRemoteMatches.d.ts.map +1 -1
- package/lib/processes/findRemoteMatches.js +70 -56
- package/lib/processes/inboundTrackRemoved.d.ts.map +1 -1
- package/lib/processes/inboundTrackRemoved.js +12 -3
- package/lib/processes/joinClientProcess.d.ts.map +1 -1
- package/lib/processes/joinClientProcess.js +15 -6
- package/lib/processes/outboundTrackRemoved.d.ts.map +1 -1
- package/lib/processes/outboundTrackRemoved.js +12 -3
- package/lib/samples/ObservedCall.d.ts.map +1 -1
- package/lib/samples/ObservedCall.js +1 -5
- package/lib/samples/ObservedCalls.d.ts.map +1 -1
- package/lib/samples/ObservedClient.d.ts.map +1 -1
- package/lib/samples/ObservedClient.js +1 -9
- package/lib/samples/ObservedInboundAudioTrack.d.ts.map +1 -1
- package/lib/samples/ObservedInboundAudioTrack.js +1 -5
- package/lib/samples/ObservedInboundVideoTrack.d.ts.map +1 -1
- package/lib/samples/ObservedInboundVideoTrack.js +1 -5
- package/lib/samples/ObservedOutboundAudioTrack.d.ts.map +1 -1
- package/lib/samples/ObservedOutboundAudioTrack.js +1 -5
- package/lib/samples/ObservedOutboundVideoTrack.d.ts.map +1 -1
- package/lib/samples/ObservedOutboundVideoTrack.js +1 -5
- package/lib/samples/ObservedPeerConnection.d.ts.map +1 -1
- package/lib/samples/ObservedPeerConnection.js +1 -12
- package/lib/samples/ObservedSfu.d.ts.map +1 -1
- package/lib/samples/ObservedSfu.js +1 -8
- package/lib/samples/ObservedSfuInboundRtpPad.d.ts.map +1 -1
- package/lib/samples/ObservedSfuInboundRtpPad.js +1 -5
- package/lib/samples/ObservedSfuOutboundRtpPad.d.ts.map +1 -1
- package/lib/samples/ObservedSfuOutboundRtpPad.js +1 -5
- package/lib/samples/ObservedSfuSctpChannel.d.ts.map +1 -1
- package/lib/samples/ObservedSfuSctpChannel.js +1 -5
- package/lib/samples/ObservedSfuTransport.d.ts.map +1 -1
- package/lib/samples/ObservedSfuTransport.js +1 -8
- package/lib/samples/ObservedSfus.d.ts.map +1 -1
- package/lib/sinks/ObserverSink.d.ts.map +1 -1
- package/lib/sinks/ObserverSink.js +42 -31
- package/lib/sinks/callEventReports.js +1 -0
- package/lib/sources/ObservedCallSource.d.ts +6 -3
- package/lib/sources/ObservedCallSource.d.ts.map +1 -1
- package/lib/sources/ObservedClientSource.d.ts +3 -2
- package/lib/sources/ObservedClientSource.d.ts.map +1 -1
- package/lib/sources/ObservedSfuSource.d.ts +3 -2
- package/lib/sources/ObservedSfuSource.d.ts.map +1 -1
- package/lib/sources/Sources.d.ts +8 -4
- package/lib/sources/Sources.d.ts.map +1 -1
- package/lib/sources/Sources.js +83 -46
- package/lib/storages/ObserverStorage.d.ts.map +1 -1
- package/lib/storages/SimpleStorage.d.ts.map +1 -1
- package/lib/storages/SimpleStorage.js +40 -23
- package/package.json +1 -1
- package/src/Evaluator.ts +17 -9
- package/src/Observer.ts +230 -170
- package/src/common/Semaphore.ts +2 -0
- package/src/common/callMetaReports.ts +30 -28
- package/src/common/logger.ts +140 -132
- package/src/common/types.ts +1 -1
- package/src/common/utils.ts +12 -1
- package/src/entries/CallEntry.ts +62 -0
- package/src/entries/ClientEntry.ts +90 -0
- package/src/entries/InboundTrackEntry.ts +74 -0
- package/src/entries/OutboundTrackEntry.ts +72 -0
- package/src/entries/PeerConnectionEntry.ts +133 -0
- package/src/entries/SfuEntry.ts +62 -0
- package/src/entries/SfuInboundRtpPadEntry.ts +46 -0
- package/src/entries/SfuOutboundRtpPadEntry.ts +44 -0
- package/src/entries/SfuSctpChannelEntry.ts +39 -0
- package/src/entries/SfuTransportEntry.ts +109 -0
- package/src/index.ts +11 -0
- package/src/middlewares/CallOperationsContext.ts +9 -5
- package/src/middlewares/CallProcessor.ts +4 -2
- package/src/middlewares/CommitTransactionMiddleware.ts +8 -5
- package/src/middlewares/DeleteOutdatedCallEntries.ts +24 -16
- package/src/middlewares/DeleteOutdatedSfuEntries.ts +24 -15
- package/src/middlewares/Middleware.ts +1 -0
- package/src/middlewares/Processor.ts +10 -5
- package/src/middlewares/TransactionContext.ts +1 -2
- package/src/middlewares/VisitObservedCallsMiddleware.ts +5 -2
- package/src/middlewares/VisitObservedSfusMiddleware.ts +8 -7
- package/src/middlewares/visitors/visitClient.ts +15 -1
- package/src/middlewares/visitors/visitInboundAudioTrack.ts +4 -1
- package/src/middlewares/visitors/visitInboundVideoTrack.ts +5 -1
- package/src/middlewares/visitors/visitOutboundAudioTrack.ts +5 -1
- package/src/middlewares/visitors/visitOutboundVideoTarck.ts +5 -1
- package/src/middlewares/visitors/visitPeerConnection.ts +15 -2
- package/src/middlewares/visitors/visitSfu.ts +7 -1
- package/src/middlewares/visitors/visitSfuInboundRtpPad.ts +4 -2
- package/src/middlewares/visitors/visitSfuOutboundRtpPad.ts +3 -1
- package/src/middlewares/visitors/visitSfuSctpChannel.ts +23 -21
- package/src/middlewares/visitors/visitSfuTransport.ts +3 -1
- package/src/processes/closePeerConnectionProcess.ts +3 -0
- package/src/processes/detachClientProcess.ts +13 -4
- package/src/processes/findRemoteMatches.ts +32 -21
- package/src/processes/inboundTrackRemoved.ts +2 -0
- package/src/processes/joinClientProcess.ts +8 -2
- package/src/processes/outboundTrackRemoved.ts +2 -0
- package/src/samples/ObservedCall.ts +6 -0
- package/src/samples/ObservedCalls.ts +13 -7
- package/src/samples/ObservedClient.ts +24 -8
- package/src/samples/ObservedInboundAudioTrack.ts +3 -2
- package/src/samples/ObservedInboundVideoTrack.ts +3 -2
- package/src/samples/ObservedOutboundAudioTrack.ts +3 -2
- package/src/samples/ObservedOutboundVideoTrack.ts +3 -2
- package/src/samples/ObservedPeerConnection.ts +27 -11
- package/src/samples/ObservedSfu.ts +17 -10
- package/src/samples/ObservedSfuInboundRtpPad.ts +5 -4
- package/src/samples/ObservedSfuOutboundRtpPad.ts +5 -4
- package/src/samples/ObservedSfuSctpChannel.ts +13 -13
- package/src/samples/ObservedSfuTransport.ts +19 -7
- package/src/samples/ObservedSfus.ts +10 -5
- package/src/sinks/ObserverSink.ts +51 -44
- package/src/sinks/callEventReports.ts +1 -1
- package/src/sources/ObservedCallSource.ts +9 -6
- package/src/sources/ObservedClientSource.ts +3 -2
- package/src/sources/ObservedSfuSource.ts +4 -8
- package/src/sources/Sources.ts +107 -22
- package/src/storages/ObserverStorage.ts +1 -0
- package/src/storages/SimpleStorage.ts +44 -21
- package/tsconfig.json +7 -5
- package/.eslintrc.js +0 -27
|
@@ -27,14 +27,14 @@ export class ObservedClientBuilder {
|
|
|
27
27
|
private _clientSamples: ClientSample[] = [];
|
|
28
28
|
public constructor(
|
|
29
29
|
private _config: Omit<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
30
|
+
ObservedClient,
|
|
31
|
+
| keyof IterableIterator<ObservedPeerConnection>
|
|
32
|
+
| 'samples'
|
|
33
|
+
| 'call'
|
|
34
|
+
| 'getObservedPeerConnection'
|
|
35
|
+
| 'observedPeerConnections'
|
|
36
|
+
| 'minTimestamp'
|
|
37
|
+
| 'maxTimestamp'
|
|
38
38
|
>
|
|
39
39
|
) {}
|
|
40
40
|
|
|
@@ -44,6 +44,7 @@ export class ObservedClientBuilder {
|
|
|
44
44
|
if (clientSample.pcTransports) {
|
|
45
45
|
for (const pcTransport of clientSample.pcTransports) {
|
|
46
46
|
const builder = this._getOrCreatePcBuilder(pcTransport.peerConnectionId);
|
|
47
|
+
|
|
47
48
|
builder.addTransportSample(pcTransport);
|
|
48
49
|
if (pcTransport.label) {
|
|
49
50
|
builder.peerConnectionLabel = pcTransport.label;
|
|
@@ -56,6 +57,7 @@ export class ObservedClientBuilder {
|
|
|
56
57
|
continue;
|
|
57
58
|
}
|
|
58
59
|
const builder = this._getOrCreatePcBuilder(iceLocalCandidate.peerConnectionId);
|
|
60
|
+
|
|
59
61
|
builder.addIceLocalCandidate(iceLocalCandidate);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -65,21 +67,25 @@ export class ObservedClientBuilder {
|
|
|
65
67
|
continue;
|
|
66
68
|
}
|
|
67
69
|
const builder = this._getOrCreatePcBuilder(iceRemoteCandidate.peerConnectionId);
|
|
70
|
+
|
|
68
71
|
builder.addIceRemoveCandidate(iceRemoteCandidate);
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
if (clientSample.iceCandidatePairs) {
|
|
72
75
|
for (const iceCandidatePair of clientSample.iceCandidatePairs) {
|
|
73
76
|
const builder = this._getOrCreatePcBuilder(iceCandidatePair.peerConnectionId);
|
|
77
|
+
|
|
74
78
|
builder.addIceCandidatePair(iceCandidatePair);
|
|
75
79
|
}
|
|
76
80
|
}
|
|
77
81
|
if (clientSample.inboundAudioTracks) {
|
|
78
82
|
for (const trackSample of clientSample.inboundAudioTracks) {
|
|
79
83
|
const { trackId, peerConnectionId } = trackSample;
|
|
84
|
+
|
|
80
85
|
if (!trackId || !peerConnectionId) continue;
|
|
81
86
|
|
|
82
87
|
const builder = this._getOrCreatePcBuilder(peerConnectionId);
|
|
88
|
+
|
|
83
89
|
builder.addInboundAudioTrack(trackSample);
|
|
84
90
|
}
|
|
85
91
|
}
|
|
@@ -87,9 +93,11 @@ export class ObservedClientBuilder {
|
|
|
87
93
|
if (clientSample.inboundVideoTracks) {
|
|
88
94
|
for (const trackSample of clientSample.inboundVideoTracks) {
|
|
89
95
|
const { trackId, peerConnectionId } = trackSample;
|
|
96
|
+
|
|
90
97
|
if (!trackId || !peerConnectionId) continue;
|
|
91
98
|
|
|
92
99
|
const builder = this._getOrCreatePcBuilder(peerConnectionId);
|
|
100
|
+
|
|
93
101
|
builder.addInboundVideoTrack(trackSample);
|
|
94
102
|
}
|
|
95
103
|
}
|
|
@@ -97,9 +105,11 @@ export class ObservedClientBuilder {
|
|
|
97
105
|
if (clientSample.outboundAudioTracks) {
|
|
98
106
|
for (const trackSample of clientSample.outboundAudioTracks) {
|
|
99
107
|
const { trackId, peerConnectionId } = trackSample;
|
|
108
|
+
|
|
100
109
|
if (!trackId || !peerConnectionId) continue;
|
|
101
110
|
|
|
102
111
|
const builder = this._getOrCreatePcBuilder(peerConnectionId);
|
|
112
|
+
|
|
103
113
|
builder.addOutboundAudioTrack(trackSample);
|
|
104
114
|
}
|
|
105
115
|
}
|
|
@@ -107,9 +117,11 @@ export class ObservedClientBuilder {
|
|
|
107
117
|
if (clientSample.outboundVideoTracks) {
|
|
108
118
|
for (const trackSample of clientSample.outboundVideoTracks) {
|
|
109
119
|
const { trackId, peerConnectionId } = trackSample;
|
|
120
|
+
|
|
110
121
|
if (!trackId || !peerConnectionId) continue;
|
|
111
122
|
|
|
112
123
|
const builder = this._getOrCreatePcBuilder(peerConnectionId);
|
|
124
|
+
|
|
113
125
|
builder.addOutboundVideoTrack(trackSample);
|
|
114
126
|
}
|
|
115
127
|
}
|
|
@@ -125,12 +137,14 @@ export class ObservedClientBuilder {
|
|
|
125
137
|
|
|
126
138
|
private _getOrCreatePcBuilder(peerConnectionId: string): ObservedPeerConnectionBuilder {
|
|
127
139
|
let result = this._peerConnections.get(peerConnectionId);
|
|
140
|
+
|
|
128
141
|
if (!result) {
|
|
129
142
|
result = new ObservedPeerConnectionBuilder({
|
|
130
143
|
peerConnectionId,
|
|
131
144
|
});
|
|
132
145
|
this._peerConnections.set(peerConnectionId, result);
|
|
133
146
|
}
|
|
147
|
+
|
|
134
148
|
return result;
|
|
135
149
|
}
|
|
136
150
|
|
|
@@ -149,8 +163,10 @@ export class ObservedClientBuilder {
|
|
|
149
163
|
|
|
150
164
|
for (const builder of this._peerConnections.values()) {
|
|
151
165
|
const observedPeerConnection = builder.build(result);
|
|
166
|
+
|
|
152
167
|
observedPeerConnections.set(observedPeerConnection.peerConnectionId, observedPeerConnection);
|
|
153
168
|
}
|
|
169
|
+
|
|
154
170
|
return result;
|
|
155
171
|
}
|
|
156
172
|
}
|
|
@@ -14,8 +14,8 @@ export class ObservedInboundAudioTrackBuilder {
|
|
|
14
14
|
private _trackSamples: InboundAudioTrack[] = [];
|
|
15
15
|
public constructor(
|
|
16
16
|
private _config: Omit<
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ObservedInboundAudioTrack,
|
|
18
|
+
keyof IterableIterator<ObservedPeerConnection> | 'peerConnection' | 'samples'
|
|
19
19
|
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ export class ObservedInboundAudioTrackBuilder {
|
|
|
29
29
|
...this._config,
|
|
30
30
|
samples: () => this._trackSamples.values(),
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
return result;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -15,8 +15,8 @@ export class ObservedInboundVideoTrackBuilder {
|
|
|
15
15
|
|
|
16
16
|
public constructor(
|
|
17
17
|
private _config: Omit<
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
ObservedInboundVideoTrack,
|
|
19
|
+
keyof IterableIterator<ObservedPeerConnection> | 'peerConnection' | 'samples'
|
|
20
20
|
>
|
|
21
21
|
) {}
|
|
22
22
|
|
|
@@ -30,6 +30,7 @@ export class ObservedInboundVideoTrackBuilder {
|
|
|
30
30
|
...this._config,
|
|
31
31
|
samples: () => this._trackSamples.values(),
|
|
32
32
|
};
|
|
33
|
+
|
|
33
34
|
return result;
|
|
34
35
|
}
|
|
35
36
|
}
|
|
@@ -14,8 +14,8 @@ export class ObservedOutboundAudioTrackBuilder {
|
|
|
14
14
|
|
|
15
15
|
public constructor(
|
|
16
16
|
private _config: Omit<
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ObservedOutboundAudioTrack,
|
|
18
|
+
keyof IterableIterator<ObservedPeerConnection> | 'peerConnection' | 'samples'
|
|
19
19
|
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ export class ObservedOutboundAudioTrackBuilder {
|
|
|
29
29
|
...this._config,
|
|
30
30
|
samples: () => this._trackSamples.values(),
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
return result;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -14,8 +14,8 @@ export class ObservedOutboundVideoTrackBuilder {
|
|
|
14
14
|
|
|
15
15
|
public constructor(
|
|
16
16
|
private _config: Omit<
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
ObservedOutboundVideoTrack,
|
|
18
|
+
keyof IterableIterator<ObservedPeerConnection> | 'peerConnection' | 'samples'
|
|
19
19
|
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ export class ObservedOutboundVideoTrackBuilder {
|
|
|
29
29
|
...this._config,
|
|
30
30
|
samples: () => this._trackSamples.values(),
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
return result;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -42,17 +42,17 @@ export class ObservedPeerConnectionBuilder {
|
|
|
42
42
|
private _peerConnectionLabel?: string;
|
|
43
43
|
public constructor(
|
|
44
44
|
private _config: Omit<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
45
|
+
ObservedPeerConnection,
|
|
46
|
+
| keyof IterableIterator<ObservedPeerConnection>
|
|
47
|
+
| 'client'
|
|
48
|
+
| 'inboundAudioTracks'
|
|
49
|
+
| 'inboundVideoTracks'
|
|
50
|
+
| 'outboundAudioTracks'
|
|
51
|
+
| 'outboundVideoTracks'
|
|
52
|
+
| 'transportSamples'
|
|
53
|
+
| 'iceCandidatePairs'
|
|
54
|
+
| 'iceRemoteCandidates'
|
|
55
|
+
| 'iceLocalCandidates'
|
|
56
56
|
>
|
|
57
57
|
) {}
|
|
58
58
|
|
|
@@ -71,6 +71,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
71
71
|
inboundAudioTrackSample.sfuStreamId,
|
|
72
72
|
inboundAudioTrackSample.sfuSinkId
|
|
73
73
|
);
|
|
74
|
+
|
|
74
75
|
builder.addSample(inboundAudioTrackSample);
|
|
75
76
|
}
|
|
76
77
|
}
|
|
@@ -87,6 +88,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
87
88
|
|
|
88
89
|
private _getInboundAudioTrackBuilder(trackId: string, sfuStreamId?: string, sfuSinkId?: string): ObservedInboundAudioTrackBuilder {
|
|
89
90
|
let result = this._inboundAudioTracks.get(trackId);
|
|
91
|
+
|
|
90
92
|
if (!result) {
|
|
91
93
|
result = new ObservedInboundAudioTrackBuilder({
|
|
92
94
|
trackId,
|
|
@@ -95,6 +97,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
95
97
|
});
|
|
96
98
|
this._inboundAudioTracks.set(trackId, result);
|
|
97
99
|
}
|
|
100
|
+
|
|
98
101
|
return result;
|
|
99
102
|
}
|
|
100
103
|
|
|
@@ -104,12 +107,14 @@ export class ObservedPeerConnectionBuilder {
|
|
|
104
107
|
outboundAudioTrackSample.trackId,
|
|
105
108
|
outboundAudioTrackSample.sfuStreamId,
|
|
106
109
|
);
|
|
110
|
+
|
|
107
111
|
builder.addSample(outboundAudioTrackSample);
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
|
|
111
115
|
private _getOutboundAudioTrackBuilder(trackId: string, sfuStreamId?: string): ObservedOutboundAudioTrackBuilder {
|
|
112
116
|
let result = this._outboundAudioTracks.get(trackId);
|
|
117
|
+
|
|
113
118
|
if (!result) {
|
|
114
119
|
result = new ObservedOutboundAudioTrackBuilder({
|
|
115
120
|
trackId,
|
|
@@ -117,6 +122,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
117
122
|
});
|
|
118
123
|
this._outboundAudioTracks.set(trackId, result);
|
|
119
124
|
}
|
|
125
|
+
|
|
120
126
|
return result;
|
|
121
127
|
}
|
|
122
128
|
|
|
@@ -127,12 +133,14 @@ export class ObservedPeerConnectionBuilder {
|
|
|
127
133
|
inboundVideoTrackSample.sfuStreamId,
|
|
128
134
|
inboundVideoTrackSample.sfuSinkId,
|
|
129
135
|
);
|
|
136
|
+
|
|
130
137
|
builder.addSample(inboundVideoTrackSample);
|
|
131
138
|
}
|
|
132
139
|
}
|
|
133
140
|
|
|
134
141
|
private _getInboundVideoTrackBuilder(trackId: string, sfuStreamId?: string, sfuSinkId?: string): ObservedInboundVideoTrackBuilder {
|
|
135
142
|
let result = this._inboundVideoTracks.get(trackId);
|
|
143
|
+
|
|
136
144
|
if (!result) {
|
|
137
145
|
result = new ObservedInboundVideoTrackBuilder({
|
|
138
146
|
trackId,
|
|
@@ -141,6 +149,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
141
149
|
});
|
|
142
150
|
this._inboundVideoTracks.set(trackId, result);
|
|
143
151
|
}
|
|
152
|
+
|
|
144
153
|
return result;
|
|
145
154
|
}
|
|
146
155
|
|
|
@@ -150,12 +159,14 @@ export class ObservedPeerConnectionBuilder {
|
|
|
150
159
|
outboundVideoTrackSample.trackId,
|
|
151
160
|
outboundVideoTrackSample.sfuStreamId,
|
|
152
161
|
);
|
|
162
|
+
|
|
153
163
|
builder.addSample(outboundVideoTrackSample);
|
|
154
164
|
}
|
|
155
165
|
}
|
|
156
166
|
|
|
157
167
|
private _getOutboundVideoTrackBuilder(trackId: string, sfuStreamId?: string): ObservedOutboundVideoTrackBuilder {
|
|
158
168
|
let result = this._outboundVideoTracks.get(trackId);
|
|
169
|
+
|
|
159
170
|
if (!result) {
|
|
160
171
|
result = new ObservedOutboundVideoTrackBuilder({
|
|
161
172
|
trackId,
|
|
@@ -163,6 +174,7 @@ export class ObservedPeerConnectionBuilder {
|
|
|
163
174
|
});
|
|
164
175
|
this._outboundVideoTracks.set(trackId, result);
|
|
165
176
|
}
|
|
177
|
+
|
|
166
178
|
return result;
|
|
167
179
|
}
|
|
168
180
|
|
|
@@ -188,21 +200,25 @@ export class ObservedPeerConnectionBuilder {
|
|
|
188
200
|
|
|
189
201
|
for (const builder of this._inboundAudioTracks.values()) {
|
|
190
202
|
const observedInboundAudioTrack = builder.build(result);
|
|
203
|
+
|
|
191
204
|
inboundAudioTracks.set(observedInboundAudioTrack.trackId, observedInboundAudioTrack);
|
|
192
205
|
}
|
|
193
206
|
|
|
194
207
|
for (const builder of this._outboundAudioTracks.values()) {
|
|
195
208
|
const observedOutboundAudioTrack = builder.build(result);
|
|
209
|
+
|
|
196
210
|
outboundAudioTracks.set(observedOutboundAudioTrack.trackId, observedOutboundAudioTrack);
|
|
197
211
|
}
|
|
198
212
|
|
|
199
213
|
for (const builder of this._inboundVideoTracks.values()) {
|
|
200
214
|
const observedInboundVideoTrack = builder.build(result);
|
|
215
|
+
|
|
201
216
|
inboundVideoTracks.set(observedInboundVideoTrack.trackId, observedInboundVideoTrack);
|
|
202
217
|
}
|
|
203
218
|
|
|
204
219
|
for (const builder of this._outboundVideoTracks.values()) {
|
|
205
220
|
const observedOutboundVideoTrack = builder.build(result);
|
|
221
|
+
|
|
206
222
|
outboundVideoTracks.set(observedOutboundVideoTrack.trackId, observedOutboundVideoTrack);
|
|
207
223
|
}
|
|
208
224
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ObservedPeerConnection
|
|
3
|
-
import { ObservedCall } from './ObservedCall';
|
|
1
|
+
import { SfuSample } from '@observertc/sample-schemas-js';
|
|
2
|
+
import { ObservedPeerConnection } from './ObservedPeerConnection';
|
|
4
3
|
import { ObservedSfuTransport, ObservedSfuTransportBuilder } from './ObservedSfuTransport';
|
|
5
4
|
|
|
6
5
|
export interface ObservedSfu {
|
|
@@ -26,13 +25,13 @@ export class ObservedSfuBuilder {
|
|
|
26
25
|
private _sfuSamples: SfuSample[] = [];
|
|
27
26
|
public constructor(
|
|
28
27
|
private _config: Omit<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
ObservedSfu,
|
|
29
|
+
| keyof IterableIterator<ObservedPeerConnection>
|
|
30
|
+
| 'samples'
|
|
31
|
+
| 'observedSfuTransports'
|
|
32
|
+
| 'getObservedSfuTransport'
|
|
33
|
+
| 'minTimestamp'
|
|
34
|
+
| 'maxTimestamp'
|
|
36
35
|
>
|
|
37
36
|
) {}
|
|
38
37
|
|
|
@@ -42,6 +41,7 @@ export class ObservedSfuBuilder {
|
|
|
42
41
|
if (sfuSample.transports) {
|
|
43
42
|
for (const sfuTransport of sfuSample.transports) {
|
|
44
43
|
const builder = this._getOrCreateSfuTransportBuilder(sfuTransport.transportId);
|
|
44
|
+
|
|
45
45
|
builder.addTransportSample(sfuTransport);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -49,6 +49,7 @@ export class ObservedSfuBuilder {
|
|
|
49
49
|
if (sfuSample.inboundRtpPads) {
|
|
50
50
|
for (const inboundRtpPad of sfuSample.inboundRtpPads) {
|
|
51
51
|
const builder = this._getOrCreateSfuTransportBuilder(inboundRtpPad.transportId);
|
|
52
|
+
|
|
52
53
|
builder.addSfuInboundRtpPad(inboundRtpPad);
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -56,6 +57,7 @@ export class ObservedSfuBuilder {
|
|
|
56
57
|
if (sfuSample.outboundRtpPads) {
|
|
57
58
|
for (const outboundRtpPad of sfuSample.outboundRtpPads) {
|
|
58
59
|
const builder = this._getOrCreateSfuTransportBuilder(outboundRtpPad.transportId);
|
|
60
|
+
|
|
59
61
|
builder.addSfuOutboundRtpPad(outboundRtpPad);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
@@ -63,6 +65,7 @@ export class ObservedSfuBuilder {
|
|
|
63
65
|
if (sfuSample.sctpChannels) {
|
|
64
66
|
for (const sctpChannel of sfuSample.sctpChannels) {
|
|
65
67
|
const builder = this._getOrCreateSfuTransportBuilder(sctpChannel.transportId);
|
|
68
|
+
|
|
66
69
|
builder.addSfuSctpChannel(sctpChannel);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
@@ -78,12 +81,14 @@ export class ObservedSfuBuilder {
|
|
|
78
81
|
|
|
79
82
|
private _getOrCreateSfuTransportBuilder(transportId: string): ObservedSfuTransportBuilder {
|
|
80
83
|
let result = this._sfuTransports.get(transportId);
|
|
84
|
+
|
|
81
85
|
if (!result) {
|
|
82
86
|
result = new ObservedSfuTransportBuilder({
|
|
83
87
|
transportId,
|
|
84
88
|
});
|
|
85
89
|
this._sfuTransports.set(transportId, result);
|
|
86
90
|
}
|
|
91
|
+
|
|
87
92
|
return result;
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -101,8 +106,10 @@ export class ObservedSfuBuilder {
|
|
|
101
106
|
|
|
102
107
|
for (const builder of this._sfuTransports.values()) {
|
|
103
108
|
const observedSfuTransport = builder.build(result);
|
|
109
|
+
|
|
104
110
|
observedSfuTransports.set(observedSfuTransport.transportId, observedSfuTransport);
|
|
105
111
|
}
|
|
112
|
+
|
|
106
113
|
return result;
|
|
107
114
|
}
|
|
108
115
|
}
|
|
@@ -12,10 +12,10 @@ export class ObservedSfuInboundRtpPadBuilder {
|
|
|
12
12
|
private _samples: SfuInboundRtpPad[] = [];
|
|
13
13
|
public constructor(
|
|
14
14
|
private _config: Omit<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
ObservedSfuInboundRtpPad,
|
|
16
|
+
| keyof IterableIterator<SfuInboundRtpPad>
|
|
17
|
+
| 'sfuTransport'
|
|
18
|
+
| 'samples'
|
|
19
19
|
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ export class ObservedSfuInboundRtpPadBuilder {
|
|
|
29
29
|
...this._config,
|
|
30
30
|
samples: () => this._samples.values(),
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
return result;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -12,10 +12,10 @@ export class ObservedSfuOutboundRtpPadBuilder {
|
|
|
12
12
|
private _samples: SfuOutboundRtpPad[] = [];
|
|
13
13
|
public constructor(
|
|
14
14
|
private _config: Omit<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
ObservedSfuOutboundRtpPad,
|
|
16
|
+
| keyof IterableIterator<SfuOutboundRtpPad>
|
|
17
|
+
| 'sfuTransport'
|
|
18
|
+
| 'samples'
|
|
19
19
|
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
@@ -29,6 +29,7 @@ export class ObservedSfuOutboundRtpPadBuilder {
|
|
|
29
29
|
...this._config,
|
|
30
30
|
samples: () => this._samples.values(),
|
|
31
31
|
};
|
|
32
|
+
|
|
32
33
|
return result;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -6,30 +6,30 @@ export interface ObservedSfuSctpChannel {
|
|
|
6
6
|
readonly channelId: string;
|
|
7
7
|
|
|
8
8
|
samples(): IterableIterator<SfuSctpChannel>;
|
|
9
|
-
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
export class ObservedSfuSctpChannelBuilder {
|
|
12
12
|
private _samples: SfuSctpChannel[] = [];
|
|
13
13
|
public constructor(
|
|
14
|
-
|
|
14
|
+
private _config: Omit<
|
|
15
15
|
ObservedSfuSctpChannel,
|
|
16
16
|
| keyof IterableIterator<SfuSctpChannel>
|
|
17
17
|
| 'sfuTransport'
|
|
18
18
|
| 'samples'
|
|
19
|
-
|
|
19
|
+
>
|
|
20
20
|
) {}
|
|
21
21
|
|
|
22
22
|
public addSample(sfuSctpChannel: SfuSctpChannel) {
|
|
23
|
-
|
|
23
|
+
this._samples.push(sfuSctpChannel);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
public build(sfuTransport: ObservedSfuTransport): ObservedSfuSctpChannel {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
const result: ObservedSfuSctpChannel = {
|
|
28
|
+
sfuTransport,
|
|
29
|
+
...this._config,
|
|
30
|
+
samples: () => this._samples.values(),
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return result;
|
|
33
34
|
}
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
}
|
|
@@ -27,13 +27,13 @@ export class ObservedSfuTransportBuilder {
|
|
|
27
27
|
private _transportSamples: SfuTransport[] = [];
|
|
28
28
|
public constructor(
|
|
29
29
|
private _config: Omit<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
ObservedSfuTransport,
|
|
31
|
+
| keyof IterableIterator<ObservedSfuTransport>
|
|
32
|
+
| 'sfu'
|
|
33
|
+
| 'inboundRtpPads'
|
|
34
|
+
| 'outboundRtpPads'
|
|
35
|
+
| 'sfuSctpChannels'
|
|
36
|
+
| 'transportSamples'
|
|
37
37
|
>
|
|
38
38
|
) {}
|
|
39
39
|
|
|
@@ -44,54 +44,63 @@ export class ObservedSfuTransportBuilder {
|
|
|
44
44
|
public addSfuInboundRtpPad(inboundRtpPad: SfuInboundRtpPad) {
|
|
45
45
|
if (inboundRtpPad.padId) {
|
|
46
46
|
const builder = this._getSfuInboundRtpPadBuilder(inboundRtpPad.padId);
|
|
47
|
+
|
|
47
48
|
builder.addSample(inboundRtpPad);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
private _getSfuInboundRtpPadBuilder(padId: string): ObservedSfuInboundRtpPadBuilder {
|
|
52
53
|
let result = this._inboundRtpPads.get(padId);
|
|
54
|
+
|
|
53
55
|
if (!result) {
|
|
54
56
|
result = new ObservedSfuInboundRtpPadBuilder({
|
|
55
57
|
padId,
|
|
56
58
|
});
|
|
57
59
|
this._inboundRtpPads.set(padId, result);
|
|
58
60
|
}
|
|
61
|
+
|
|
59
62
|
return result;
|
|
60
63
|
}
|
|
61
64
|
|
|
62
65
|
public addSfuOutboundRtpPad(outboundRtpPad: SfuOutboundRtpPad) {
|
|
63
66
|
if (outboundRtpPad.padId) {
|
|
64
67
|
const builder = this._getSfuOutboundRtpPadBuilder(outboundRtpPad.padId);
|
|
68
|
+
|
|
65
69
|
builder.addSample(outboundRtpPad);
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
private _getSfuOutboundRtpPadBuilder(padId: string): ObservedSfuOutboundRtpPadBuilder {
|
|
70
74
|
let result = this._outboundRtpPads.get(padId);
|
|
75
|
+
|
|
71
76
|
if (!result) {
|
|
72
77
|
result = new ObservedSfuOutboundRtpPadBuilder({
|
|
73
78
|
padId,
|
|
74
79
|
});
|
|
75
80
|
this._outboundRtpPads.set(padId, result);
|
|
76
81
|
}
|
|
82
|
+
|
|
77
83
|
return result;
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
public addSfuSctpChannel(sfuSctpChannel: SfuSctpChannel) {
|
|
81
87
|
if (sfuSctpChannel.channelId) {
|
|
82
88
|
const builder = this._getSfuSctpChannel(sfuSctpChannel.channelId);
|
|
89
|
+
|
|
83
90
|
builder.addSample(sfuSctpChannel);
|
|
84
91
|
}
|
|
85
92
|
}
|
|
86
93
|
|
|
87
94
|
private _getSfuSctpChannel(channelId: string): ObservedSfuSctpChannelBuilder {
|
|
88
95
|
let result = this._sctpChannels.get(channelId);
|
|
96
|
+
|
|
89
97
|
if (!result) {
|
|
90
98
|
result = new ObservedSfuSctpChannelBuilder({
|
|
91
99
|
channelId,
|
|
92
100
|
});
|
|
93
101
|
this._sctpChannels.set(channelId, result);
|
|
94
102
|
}
|
|
103
|
+
|
|
95
104
|
return result;
|
|
96
105
|
}
|
|
97
106
|
|
|
@@ -112,16 +121,19 @@ export class ObservedSfuTransportBuilder {
|
|
|
112
121
|
|
|
113
122
|
for (const builder of this._inboundRtpPads.values()) {
|
|
114
123
|
const observedInboundRtpPad = builder.build(result);
|
|
124
|
+
|
|
115
125
|
sfuInboundRtpPads.set(observedInboundRtpPad.padId, observedInboundRtpPad);
|
|
116
126
|
}
|
|
117
127
|
|
|
118
128
|
for (const builder of this._outboundRtpPads.values()) {
|
|
119
129
|
const observedOutboundRtpPad = builder.build(result);
|
|
130
|
+
|
|
120
131
|
sfuOutboundRtpPads.set(observedOutboundRtpPad.padId, observedOutboundRtpPad);
|
|
121
132
|
}
|
|
122
133
|
|
|
123
134
|
for (const builder of this._sctpChannels.values()) {
|
|
124
135
|
const observedSfuSctpChannel = builder.build(result);
|
|
136
|
+
|
|
125
137
|
sfuSctpChannelsMap.set(observedSfuSctpChannel.channelId, observedSfuSctpChannel);
|
|
126
138
|
}
|
|
127
139
|
|