@observertc/observer-js 0.30.2-beta → 0.30.3-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.
@@ -25,6 +25,12 @@ export type ObservedOutboundTrackStats<K extends MediaKind> = ObservedOutboundTr
25
25
  ssrc: number;
26
26
  bitrate: number;
27
27
  rttInMs?: number;
28
+
29
+ deltaLostPackets: number;
30
+ deltaSentPackets: number;
31
+ deltaSentBytes: number;
32
+ deltaSentFrames?: number;
33
+ deltaEncodedFrames?: number;
28
34
  };
29
35
 
30
36
  // export type ObservedOutboundTrackStatsUpdate<K extends MediaKind> = {
@@ -64,9 +70,22 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
64
70
  return new ObservedOutboundTrack<K>(model, peerConnection, storageProvider);
65
71
  }
66
72
 
67
- public bitrate?: number;
73
+ public bitrate = 0;
68
74
  public rttInMs?: number;
69
75
 
76
+ public totalLostPackets = 0;
77
+ public totalSentPackets = 0;
78
+ public totalSentBytes = 0;
79
+ public totalSentFrames = 0;
80
+
81
+ public deltaLostPackets = 0;
82
+ public deltaSentPackets = 0;
83
+ public deltaSentBytes = 0;
84
+ public deltaSentFrames = 0;
85
+ public deltaEncodedFrames = 0;
86
+
87
+ public created = Date.now();
88
+
70
89
  private readonly _stats = new Map<number, ObservedOutboundTrackStats<Kind>>();
71
90
  private readonly _execute = createSingleExecutor();
72
91
 
@@ -96,10 +115,6 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
96
115
  return this._model.sfuStreamId;
97
116
  }
98
117
 
99
- public get closed() {
100
- return this._closed;
101
- }
102
-
103
118
  public get remoteInboundTracks(): ReadonlyMap<string, ObservedInboundTrack<Kind>> {
104
119
  return this._remoteInboundTracks;
105
120
  }
@@ -111,7 +126,19 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
111
126
  public get updated() {
112
127
  return this._updated;
113
128
  }
129
+
130
+ public get stats(): ReadonlyMap<number, ObservedOutboundTrackStats<Kind>> {
131
+ return this._stats;
132
+ }
114
133
 
134
+ public get uptimeInMs() {
135
+ return this._updated - this.created;
136
+ }
137
+
138
+ public get closed() {
139
+ return this._closed;
140
+ }
141
+
115
142
  public close() {
116
143
  if (this._closed) return;
117
144
 
@@ -122,8 +149,15 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
122
149
  .finally(() => this.emit('close'));
123
150
  }
124
151
 
125
- public get stats(): ReadonlyMap<number, ObservedOutboundTrackStats<Kind>> {
126
- return this._stats;
152
+ public resetMetrics() {
153
+ this.bitrate = 0;
154
+ this.rttInMs = 0;
155
+
156
+ this.deltaLostPackets = 0;
157
+ this.deltaSentPackets = 0;
158
+ this.deltaSentBytes = 0;
159
+ this.deltaSentFrames = 0;
160
+ this.deltaEncodedFrames = 0;
127
161
  }
128
162
 
129
163
  public async update(sample: ObservedOutboundTrackStatsUpdate<Kind>, timestamp: number): Promise<void> {
@@ -150,13 +184,30 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
150
184
  const lastStat = this._stats.get(sample.ssrc);
151
185
  const rttInMs = sample.roundTripTime ? sample.roundTripTime * 1000 : undefined;
152
186
  const bitrate = ((sample.bytesSent ?? 0) - (lastStat?.bytesSent ?? 0)) * 8 / (elapsedTimeInMs / 1000);
153
- // const lostPackets = (sample.packetsLost ?? 0) - (lastStat?.packetsLost ?? 0);
154
- // const sentPackets = (sample.packetsSent ?? 0) - (lastStat?.packetsSent ?? 0);
187
+ const deltaLostPackets = (sample.packetsLost ?? 0) - (lastStat?.packetsLost ?? 0);
188
+ const deltaSentPackets = (sample.packetsSent ?? 0) - (lastStat?.packetsSent ?? 0);
189
+ const deltaSentBytes = (sample.bytesSent ?? 0) - (lastStat?.bytesSent ?? 0);
190
+ let deltaEncodedFrames: number | undefined;
191
+ let deltaSentFrames: number | undefined;
192
+
193
+ if (this.kind === 'video') {
194
+ const videoSample = sample as OutboundVideoTrack;
195
+ const lastVideoStats = lastStat as OutboundVideoTrack | undefined;
196
+
197
+ deltaEncodedFrames = (videoSample.framesEncoded ?? 0) - (lastVideoStats?.framesEncoded ?? 0);
198
+ deltaSentFrames = (videoSample.framesSent ?? 0) - (lastVideoStats?.framesSent ?? 0);
199
+ }
155
200
  const stats: ObservedOutboundTrackStats<Kind> = {
156
201
  ...sample,
157
202
  rttInMs,
158
203
  bitrate,
159
204
  ssrc: sample.ssrc,
205
+
206
+ deltaLostPackets,
207
+ deltaSentPackets,
208
+ deltaSentBytes,
209
+ deltaEncodedFrames,
210
+ deltaSentFrames,
160
211
  };
161
212
 
162
213
  this._stats.set(sample.ssrc, stats);
@@ -164,6 +215,16 @@ export class ObservedOutboundTrack<Kind extends MediaKind> extends EventEmitter
164
215
  this.bitrate = [ ...this._stats.values() ].reduce((acc, stat) => acc + stat.bitrate, 0);
165
216
  this.rttInMs = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.rttInMs ?? 0), 0) / (this._stats.size || 1);
166
217
 
218
+ this.totalLostPackets = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.packetsLost ?? 0), 0);
219
+ this.totalSentPackets = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.packetsSent ?? 0), 0);
220
+ this.totalSentBytes = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.bytesSent ?? 0), 0);
221
+
222
+ this.deltaEncodedFrames = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.deltaEncodedFrames ?? 0), 0);
223
+ this.deltaSentFrames = [ ...this._stats.values() ].reduce((acc, stat) => acc + (stat.deltaSentFrames ?? 0), 0);
224
+ this.deltaLostPackets = [ ...this._stats.values() ].reduce((acc, stat) => acc + stat.deltaLostPackets, 0);
225
+ this.deltaSentPackets = [ ...this._stats.values() ].reduce((acc, stat) => acc + stat.deltaSentPackets, 0);
226
+ this.deltaSentBytes = [ ...this._stats.values() ].reduce((acc, stat) => acc + stat.deltaSentBytes, 0);
227
+
167
228
  // setting up sfu connection as it is not always available at the first sample
168
229
  if (sample.sfuStreamId && !this._model.sfuStreamId) {
169
230
  this._model.sfuStreamId = sample.sfuStreamId;
@@ -56,27 +56,35 @@ export class ObservedPeerConnection extends EventEmitter {
56
56
  return new ObservedPeerConnection(model, client, storageProvider);
57
57
  }
58
58
 
59
+ public created = Date.now();
60
+
59
61
  public totalInboundPacketsLost = 0;
60
62
  public totalInboundPacketsReceived = 0;
61
- public totalOutboundPacketsLost = 0;
62
- public totalOutboundPacketsReceived = 0;
63
63
  public totalOutboundPacketsSent = 0;
64
64
  public totalDataChannelBytesSent = 0;
65
65
  public totalDataChannelBytesReceived = 0;
66
+
66
67
  public totalSentAudioBytes = 0;
67
68
  public totalSentVideoBytes = 0;
69
+ public totalSentAudioPackets = 0;
70
+ public totalSentVideoPackets = 0;
71
+ public totalReceivedAudioPacktes = 0;
72
+ public totalReceivedVideoPackets = 0;
68
73
  public totalReceivedAudioBytes = 0;
69
74
  public totalReceivedVideoBytes = 0;
70
75
 
71
- public deltaInboundPacketsLost = 0;
72
- public deltaInboundPacketsReceived = 0;
73
- public deltaOutboundPacketsLost = 0;
74
- public deltaOutboundPacketsReceived = 0;
75
- public deltaOutboundPacketsSent = 0;
76
+ public deltaInboundLostPackets = 0;
77
+ public deltaInboundReceivedPackets = 0;
78
+ public deltaOutboundSentPackets = 0;
76
79
  public deltaDataChannelBytesSent = 0;
77
80
  public deltaDataChannelBytesReceived = 0;
81
+ public deltaInboundReceivedBytes = 0;
82
+ public deltaOutboundSentBytes = 0;
83
+
78
84
  public deltaReceivedAudioBytes = 0;
79
85
  public deltaReceivedVideoBytes = 0;
86
+ public deltaReceivedAudioPackets = 0;
87
+ public deltaReceivedVideoPackets = 0;
80
88
  public deltaSentAudioBytes = 0;
81
89
  public deltaSentVideoBytes = 0;
82
90
  public sendingAudioBitrate = 0;
@@ -148,6 +156,10 @@ export class ObservedPeerConnection extends EventEmitter {
148
156
  return this._outboundVideoTracks;
149
157
  }
150
158
 
159
+ public get uptimeInMs() {
160
+ return this._updated - this.created;
161
+ }
162
+
151
163
  public get closed() {
152
164
  return this._closed;
153
165
  }
@@ -166,16 +178,15 @@ export class ObservedPeerConnection extends EventEmitter {
166
178
  .finally(() => this.emit('close'));
167
179
  }
168
180
 
169
- public updateMetrics() {
170
- this.deltaInboundPacketsLost = 0;
171
- this.deltaInboundPacketsReceived = 0;
172
- this.deltaOutboundPacketsLost = 0;
173
- this.deltaOutboundPacketsReceived = 0;
174
- this.deltaOutboundPacketsSent = 0;
175
- this.sendingAudioBitrate = 0;
176
- this.sendingVideoBitrate = 0;
177
- this.receivingAudioBitrate = 0;
178
- this.receivingVideoBitrate = 0;
181
+ public getTrack(trackId: string): ObservedInboundTrack<'audio'> | ObservedInboundTrack<'video'> | ObservedOutboundTrack<'audio'> | ObservedOutboundTrack<'video'> | undefined {
182
+ return this._inboundAudioTracks.get(trackId) ?? this._inboundVideoTracks.get(trackId) ?? this._outboundAudioTracks.get(trackId) ?? this._outboundVideoTracks.get(trackId);
183
+ }
184
+
185
+ public resetMetrics() {
186
+ this.deltaInboundLostPackets = 0;
187
+ this.deltaInboundReceivedPackets = 0;
188
+ this.deltaOutboundSentPackets = 0;
189
+
179
190
  this.deltaDataChannelBytesSent = 0;
180
191
  this.deltaDataChannelBytesReceived = 0;
181
192
  this.deltaReceivedAudioBytes = 0;
@@ -183,13 +194,101 @@ export class ObservedPeerConnection extends EventEmitter {
183
194
  this.deltaSentAudioBytes = 0;
184
195
  this.deltaSentVideoBytes = 0;
185
196
 
197
+ this._inboundAudioTracks.forEach((track) => track.resetMetrics());
198
+ this._inboundVideoTracks.forEach((track) => track.resetMetrics());
199
+ this._outboundAudioTracks.forEach((track) => track.resetMetrics());
200
+ this._outboundVideoTracks.forEach((track) => track.resetMetrics());
201
+ }
202
+
203
+ public updateMetrics() {
204
+ this.totalInboundPacketsLost = 0;
205
+ this.totalInboundPacketsReceived = 0;
206
+ this.totalOutboundPacketsSent = 0;
207
+ this.totalDataChannelBytesSent = 0;
208
+ this.totalDataChannelBytesReceived = 0;
209
+
210
+ this.totalSentAudioBytes = 0;
211
+ this.totalSentVideoBytes = 0;
212
+ this.totalReceivedAudioBytes = 0;
213
+ this.totalReceivedVideoBytes = 0;
214
+ this.sendingAudioBitrate = 0;
215
+ this.sendingVideoBitrate = 0;
216
+ this.receivingAudioBitrate = 0;
217
+ this.receivingVideoBitrate = 0;
218
+
219
+ let sumRttInS = 0;
220
+
186
221
  this._inboundAudioTracks.forEach((track) => {
187
- this.deltaReceivedAudioBytes += track.receivedPackets;
222
+ this.deltaInboundLostPackets += track.deltaLostPackets;
223
+ this.deltaInboundReceivedPackets += track.deltaReceivedPackets;
224
+ this.deltaInboundReceivedBytes += track.deltaBytesReceived;
225
+
226
+ this.deltaReceivedAudioBytes += track.deltaBytesReceived;
227
+ this.deltaReceivedAudioPackets += track.deltaReceivedPackets;
228
+
229
+ this.receivingAudioBitrate += track.bitrate;
230
+
231
+ this.totalInboundPacketsLost += track.totalLostPackets;
232
+ this.totalInboundPacketsReceived += track.totalReceivedPackets;
233
+ this.totalReceivedAudioBytes += track.totalBytesReceived;
234
+ this.totalReceivedAudioPacktes += track.totalReceivedPackets;
235
+
236
+ sumRttInS = (track.rttInMs ?? 0) / 1000.0;
188
237
  });
189
238
 
190
239
  this._inboundVideoTracks.forEach((track) => {
191
- this.deltaReceivedVideoBytes += track.receivedPackets;
240
+ this.deltaInboundLostPackets += track.deltaLostPackets;
241
+ this.deltaInboundReceivedPackets += track.deltaReceivedPackets;
242
+ this.deltaInboundReceivedBytes += track.deltaBytesReceived;
243
+
244
+ this.deltaReceivedVideoBytes += track.deltaBytesReceived;
245
+ this.deltaReceivedVideoPackets += track.deltaReceivedPackets;
246
+
247
+ this.receivingVideoBitrate += track.bitrate;
248
+
249
+ this.totalInboundPacketsLost += track.totalLostPackets;
250
+ this.totalInboundPacketsReceived += track.totalReceivedPackets;
251
+ this.totalReceivedVideoBytes += track.totalBytesReceived;
252
+ this.totalReceivedVideoPackets += track.totalReceivedPackets;
253
+
254
+ sumRttInS = (track.rttInMs ?? 0) / 1000.0;
255
+ });
256
+
257
+ this._outboundAudioTracks.forEach((track) => {
258
+ this.deltaOutboundSentPackets += track.deltaSentPackets;
259
+ this.deltaOutboundSentBytes += track.deltaSentBytes;
260
+
261
+ this.deltaSentAudioBytes += track.deltaSentBytes;
262
+ this.deltaSentAudioBytes += track.deltaSentPackets;
263
+
264
+ this.sendingAudioBitrate += track.bitrate;
265
+
266
+ this.totalOutboundPacketsSent += track.totalSentPackets;
267
+ this.totalSentAudioBytes += track.totalSentBytes;
268
+ this.totalSentAudioPackets += track.totalSentPackets;
269
+
270
+ sumRttInS = (track.rttInMs ?? 0) / 1000.0;
271
+ });
272
+
273
+ this._outboundVideoTracks.forEach((track) => {
274
+ this.deltaOutboundSentPackets += track.deltaSentPackets;
275
+ this.deltaOutboundSentBytes += track.deltaSentBytes;
276
+
277
+ this.deltaSentVideoBytes += track.deltaSentBytes;
278
+ this.deltaSentVideoBytes += track.deltaSentPackets;
279
+
280
+ this.sendingVideoBitrate += track.bitrate;
281
+
282
+ this.totalOutboundPacketsSent += track.totalSentPackets;
283
+ this.totalSentVideoBytes += track.totalSentBytes;
284
+ this.totalSentVideoPackets += track.totalSentPackets;
285
+
286
+ sumRttInS = (track.rttInMs ?? 0) / 1000.0;
192
287
  });
288
+
289
+ const nrOfBelongings = this._inboundAudioTracks.size + this._inboundVideoTracks.size + this._outboundAudioTracks.size + this._outboundVideoTracks.size;
290
+
291
+ this.avgRttInS = 0 < nrOfBelongings ? sumRttInS / nrOfBelongings : undefined;
193
292
  }
194
293
 
195
294
  public update(sample: PeerConnectionTransport, timestamp: number) {
@@ -228,6 +327,13 @@ export class ObservedPeerConnection extends EventEmitter {
228
327
  kind: 'audio',
229
328
  trackId: config.trackId,
230
329
  }, this, this._storageProvider);
330
+
331
+ const pendingTracksTimestamp = this.client.ωpendingCreatedTracksTimestamp.get(result.trackId);
332
+
333
+ if (pendingTracksTimestamp) {
334
+ this.client.ωpendingCreatedTracksTimestamp.delete(result.trackId);
335
+ result.created = pendingTracksTimestamp;
336
+ }
231
337
 
232
338
  result.on('close', () => {
233
339
  this._inboundAudioTracks.delete(result.trackId);
@@ -250,6 +356,13 @@ export class ObservedPeerConnection extends EventEmitter {
250
356
  kind: 'video',
251
357
  trackId: config.trackId,
252
358
  }, this, this._storageProvider);
359
+
360
+ const pendingTracksTimestamp = this.client.ωpendingCreatedTracksTimestamp.get(result.trackId);
361
+
362
+ if (pendingTracksTimestamp) {
363
+ this.client.ωpendingCreatedTracksTimestamp.delete(result.trackId);
364
+ result.created = pendingTracksTimestamp;
365
+ }
253
366
 
254
367
  result.on('close', () => {
255
368
  this._inboundVideoTracks.delete(result.trackId);
@@ -273,6 +386,13 @@ export class ObservedPeerConnection extends EventEmitter {
273
386
  trackId: config.trackId,
274
387
  }, this, this._storageProvider);
275
388
 
389
+ const pendingTracksTimestamp = this.client.ωpendingCreatedTracksTimestamp.get(result.trackId);
390
+
391
+ if (pendingTracksTimestamp) {
392
+ this.client.ωpendingCreatedTracksTimestamp.delete(result.trackId);
393
+ result.created = pendingTracksTimestamp;
394
+ }
395
+
276
396
  result.on('close', () => {
277
397
  this._outboundAudioTracks.delete(result.trackId);
278
398
  this._model.outboundTrackIds = this._model.outboundTrackIds.filter((id) => id !== result.trackId);
@@ -299,6 +419,13 @@ export class ObservedPeerConnection extends EventEmitter {
299
419
  trackId: config.trackId,
300
420
  }, this, this._storageProvider);
301
421
 
422
+ const pendingTracksTimestamp = this.client.ωpendingCreatedTracksTimestamp.get(result.trackId);
423
+
424
+ if (pendingTracksTimestamp) {
425
+ this.client.ωpendingCreatedTracksTimestamp.delete(result.trackId);
426
+ result.created = pendingTracksTimestamp;
427
+ }
428
+
302
429
  result.on('close', () => {
303
430
  this._outboundVideoTracks.delete(result.trackId);
304
431
  result.sfuStreamId && this.client.call.sfuStreamIdToOutboundVideoTrack.set(result.sfuStreamId, result);
@@ -1,23 +0,0 @@
1
- import { CallEventReport, CallMetaReport, ClientDataChannelReport, ClientExtensionReport, IceCandidatePairReport, InboundAudioTrackReport, InboundVideoTrackReport, ObserverEventReport, OutboundAudioTrackReport, OutboundVideoTrackReport, PeerConnectionTransportReport, SfuEventReport, SfuExtensionReport, SfuInboundRtpPadReport, SfuMetaReport, SfuOutboundRtpPadReport, SfuSctpStreamReport, SFUTransportReport } from '@observertc/report-schemas-js';
2
- export type ObservedReports = ReturnType<typeof createObservedReports>;
3
- export declare function createObservedReports(): {
4
- callEventReports: CallEventReport[];
5
- callMetaReports: CallMetaReport[];
6
- clientDataChannelReports: ClientDataChannelReport[];
7
- clientExtensionReports: ClientExtensionReport[];
8
- iceCandidatePairReports: IceCandidatePairReport[];
9
- inboundAudioTrackReports: InboundAudioTrackReport[];
10
- inboundVideoTrackReports: InboundVideoTrackReport[];
11
- observerEventReports: ObserverEventReport[];
12
- outboundAudioTrackReports: OutboundAudioTrackReport[];
13
- outboundVideoTrackReports: OutboundVideoTrackReport[];
14
- peerConnectionTransportReports: PeerConnectionTransportReport[];
15
- sfuEventReports: SfuEventReport[];
16
- sfuExtensionReports: SfuExtensionReport[];
17
- sfuInboundRtpPadReports: SfuInboundRtpPadReport[];
18
- sfuMetaReports: SfuMetaReport[];
19
- sfuOutboundRtpPadReports: SfuOutboundRtpPadReport[];
20
- sfuSctpStreamReports: SfuSctpStreamReport[];
21
- sfuTransportReports: SFUTransportReport[];
22
- };
23
- //# sourceMappingURL=ReportsCollector.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ReportsCollector.d.ts","sourceRoot":"","sources":["../../src/common/ReportsCollector.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,EACd,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,cAAc,EACd,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,uBAAuB,EACvB,mBAAmB,EACnB,kBAAkB,EAClB,MAAM,+BAA+B,CAAC;AA4BvC,MAAM,MAAM,eAAe,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,wBAAgB,qBAAqB;;;;;;;;;;;;;;;;;;;EAqBpC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createObservedReports = void 0;
4
- function createObservedReports() {
5
- return {
6
- callEventReports: [],
7
- callMetaReports: [],
8
- clientDataChannelReports: [],
9
- clientExtensionReports: [],
10
- iceCandidatePairReports: [],
11
- inboundAudioTrackReports: [],
12
- inboundVideoTrackReports: [],
13
- observerEventReports: [],
14
- outboundAudioTrackReports: [],
15
- outboundVideoTrackReports: [],
16
- peerConnectionTransportReports: [],
17
- sfuEventReports: [],
18
- sfuExtensionReports: [],
19
- sfuInboundRtpPadReports: [],
20
- sfuMetaReports: [],
21
- sfuOutboundRtpPadReports: [],
22
- sfuSctpStreamReports: [],
23
- sfuTransportReports: [],
24
- };
25
- }
26
- exports.createObservedReports = createObservedReports;
@@ -1,71 +0,0 @@
1
- import {
2
- CallEventReport,
3
- CallMetaReport,
4
- ClientDataChannelReport,
5
- ClientExtensionReport,
6
- IceCandidatePairReport,
7
- InboundAudioTrackReport,
8
- InboundVideoTrackReport,
9
- ObserverEventReport,
10
- OutboundAudioTrackReport,
11
- OutboundVideoTrackReport,
12
- PeerConnectionTransportReport,
13
- SfuEventReport,
14
- SfuExtensionReport,
15
- SfuInboundRtpPadReport,
16
- SfuMetaReport,
17
- SfuOutboundRtpPadReport,
18
- SfuSctpStreamReport,
19
- SFUTransportReport,
20
- } from '@observertc/report-schemas-js';
21
-
22
- // export interface ReportsCollector {
23
- // addCallEventReport(report: CallEventReport): void;
24
- // addCallMetaReport(report: CallMetaReport): void;
25
- // addClientDataChannelReport(report: ClientDataChannelReport): void;
26
- // addClientExtensionReport(report: ClientExtensionReport): void;
27
- // addIceCandidatePairReport(report: IceCandidatePairReport): void;
28
- // addInboundAudioTrackReport(report: InboundAudioTrackReport): void;
29
- // addInboundVideoTrackReport(report: InboundVideoTrackReport): void;
30
- // addPeerConnectionTransportReports(report: PeerConnectionTransportReport): void;
31
- // addObserverEventReport(report: ObserverEventReport): void;
32
- // addOutboundAudioTrackReport(report: OutboundAudioTrackReport): void;
33
- // addOutboundVideoTrackReport(report: OutboundVideoTrackReport): void;
34
- // addSfuEventReport(report: SfuEventReport): void;
35
- // addSfuExtensionReport(report: SfuExtensionReport): void;
36
- // addSfuInboundRtpPadReport(report: SfuInboundRtpPadReport): void;
37
- // addSfuOutboundRtpPadReport(report: SfuOutboundRtpPadReport): void;
38
- // addSfuSctpStreamReport(report: SfuSctpStreamReport): void;
39
- // addSfuTransportReport(report: SFUTransportReport): void;
40
- // addSfuMetaReport(report: SfuMetaReport): void;
41
-
42
- // getCallEventReports(): CallEventReport[];
43
- // getClientExtensionReports(): ClientExtensionReport[];
44
- // getSfuEventReports(): SfuEventReport[];
45
- // getSfuExtensionReports(): SfuExtensionReport[];
46
- // }
47
-
48
- export type ObservedReports = ReturnType<typeof createObservedReports>;
49
-
50
- export function createObservedReports() {
51
- return {
52
- callEventReports: [] as CallEventReport[],
53
- callMetaReports: [] as CallMetaReport[],
54
- clientDataChannelReports: [] as ClientDataChannelReport[],
55
- clientExtensionReports: [] as ClientExtensionReport[],
56
- iceCandidatePairReports: [] as IceCandidatePairReport[],
57
- inboundAudioTrackReports: [] as InboundAudioTrackReport[],
58
- inboundVideoTrackReports: [] as InboundVideoTrackReport[],
59
- observerEventReports: [] as ObserverEventReport[],
60
- outboundAudioTrackReports: [] as OutboundAudioTrackReport[],
61
- outboundVideoTrackReports: [] as OutboundVideoTrackReport[],
62
- peerConnectionTransportReports: [] as PeerConnectionTransportReport[],
63
- sfuEventReports: [] as SfuEventReport[],
64
- sfuExtensionReports: [] as SfuExtensionReport[],
65
- sfuInboundRtpPadReports: [] as SfuInboundRtpPadReport[],
66
- sfuMetaReports: [] as SfuMetaReport[],
67
- sfuOutboundRtpPadReports: [] as SfuOutboundRtpPadReport[],
68
- sfuSctpStreamReports: [] as SfuSctpStreamReport[],
69
- sfuTransportReports: [] as SFUTransportReport[],
70
- };
71
- }