@webex/plugin-meetings 3.3.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +7 -2
- package/dist/breakouts/index.js.map +1 -1
- package/dist/constants.js +11 -4
- package/dist/constants.js.map +1 -1
- package/dist/interpretation/index.js +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/selfUtils.js +0 -5
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/MediaConnectionAwaiter.js +70 -15
- package/dist/media/MediaConnectionAwaiter.js.map +1 -1
- package/dist/media/index.js +12 -0
- package/dist/media/index.js.map +1 -1
- package/dist/meeting/connectionStateHandler.js +67 -0
- package/dist/meeting/connectionStateHandler.js.map +1 -0
- package/dist/meeting/index.js +552 -357
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +7 -0
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +6 -1
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/util.js +1 -0
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/index.js +4 -4
- package/dist/meeting-info/index.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +2 -2
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/util.js +17 -17
- package/dist/meeting-info/util.js.map +1 -1
- package/dist/meeting-info/utilv2.js +16 -16
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/collection.js +1 -1
- package/dist/meetings/collection.js.map +1 -1
- package/dist/meetings/index.js +37 -33
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/meetings.types.js +8 -0
- package/dist/meetings/meetings.types.js.map +1 -1
- package/dist/meetings/util.js +3 -2
- package/dist/meetings/util.js.map +1 -1
- package/dist/metrics/constants.js +2 -1
- package/dist/metrics/constants.js.map +1 -1
- package/dist/metrics/index.js +57 -0
- package/dist/metrics/index.js.map +1 -1
- package/dist/personal-meeting-room/index.js +1 -1
- package/dist/personal-meeting-room/index.js.map +1 -1
- package/dist/reachability/clusterReachability.js +108 -53
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +415 -56
- package/dist/reachability/index.js.map +1 -1
- package/dist/types/constants.d.ts +11 -3
- package/dist/types/media/MediaConnectionAwaiter.d.ts +24 -4
- package/dist/types/meeting/connectionStateHandler.d.ts +30 -0
- package/dist/types/meeting/index.d.ts +27 -7
- package/dist/types/meeting/locusMediaRequest.d.ts +2 -0
- package/dist/types/meeting-info/index.d.ts +3 -2
- package/dist/types/meeting-info/meeting-info-v2.d.ts +3 -2
- package/dist/types/meeting-info/util.d.ts +5 -4
- package/dist/types/meeting-info/utilv2.d.ts +3 -2
- package/dist/types/meetings/collection.d.ts +3 -2
- package/dist/types/meetings/index.d.ts +4 -3
- package/dist/types/meetings/meetings.types.d.ts +9 -0
- package/dist/types/metrics/constants.d.ts +1 -0
- package/dist/types/metrics/index.d.ts +15 -0
- package/dist/types/reachability/clusterReachability.d.ts +31 -3
- package/dist/types/reachability/index.d.ts +93 -2
- package/dist/webinar/index.js +1 -1
- package/package.json +23 -23
- package/src/breakouts/index.ts +7 -1
- package/src/constants.ts +13 -17
- package/src/locus-info/selfUtils.ts +0 -5
- package/src/media/MediaConnectionAwaiter.ts +89 -14
- package/src/media/index.ts +13 -0
- package/src/meeting/connectionStateHandler.ts +65 -0
- package/src/meeting/index.ts +526 -292
- package/src/meeting/locusMediaRequest.ts +5 -0
- package/src/meeting/muteState.ts +6 -1
- package/src/meeting/util.ts +1 -0
- package/src/meeting-info/index.ts +9 -6
- package/src/meeting-info/meeting-info-v2.ts +4 -4
- package/src/meeting-info/util.ts +23 -28
- package/src/meeting-info/utilv2.ts +18 -24
- package/src/meetings/collection.ts +3 -3
- package/src/meetings/index.ts +39 -40
- package/src/meetings/meetings.types.ts +11 -0
- package/src/meetings/util.ts +5 -4
- package/src/metrics/constants.ts +1 -0
- package/src/metrics/index.ts +44 -0
- package/src/personal-meeting-room/index.ts +2 -2
- package/src/reachability/clusterReachability.ts +86 -25
- package/src/reachability/index.ts +316 -27
- package/test/unit/spec/breakouts/index.ts +51 -32
- package/test/unit/spec/locus-info/selfUtils.js +25 -23
- package/test/unit/spec/media/MediaConnectionAwaiter.ts +131 -32
- package/test/unit/spec/media/index.ts +42 -27
- package/test/unit/spec/meeting/connectionStateHandler.ts +102 -0
- package/test/unit/spec/meeting/index.js +758 -179
- package/test/unit/spec/meeting/locusMediaRequest.ts +7 -0
- package/test/unit/spec/meeting/muteState.js +24 -0
- package/test/unit/spec/meeting-info/index.js +4 -4
- package/test/unit/spec/meeting-info/meetinginfov2.js +24 -28
- package/test/unit/spec/meeting-info/request.js +2 -2
- package/test/unit/spec/meeting-info/utilv2.js +41 -49
- package/test/unit/spec/meetings/index.js +14 -0
- package/test/unit/spec/metrics/index.js +126 -0
- package/test/unit/spec/multistream/mediaRequestManager.ts +2 -2
- package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -2
- package/test/unit/spec/reachability/clusterReachability.ts +116 -22
- package/test/unit/spec/reachability/index.ts +1153 -84
- package/test/unit/spec/rtcMetrics/index.ts +1 -0
- package/dist/mediaQualityMetrics/config.js +0 -321
- package/dist/mediaQualityMetrics/config.js.map +0 -1
- package/dist/statsAnalyzer/global.js +0 -44
- package/dist/statsAnalyzer/global.js.map +0 -1
- package/dist/statsAnalyzer/index.js +0 -1072
- package/dist/statsAnalyzer/index.js.map +0 -1
- package/dist/statsAnalyzer/mqaUtil.js +0 -368
- package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -247
- package/dist/types/statsAnalyzer/global.d.ts +0 -36
- package/dist/types/statsAnalyzer/index.d.ts +0 -217
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/src/mediaQualityMetrics/config.ts +0 -255
- package/src/statsAnalyzer/global.ts +0 -37
- package/src/statsAnalyzer/index.ts +0 -1318
- package/src/statsAnalyzer/mqaUtil.ts +0 -463
- package/test/unit/spec/stats-analyzer/index.js +0 -1819
|
@@ -1,1819 +0,0 @@
|
|
|
1
|
-
import 'jsdom-global/register';
|
|
2
|
-
import chai from 'chai';
|
|
3
|
-
import chaiAsPromised from 'chai-as-promised';
|
|
4
|
-
import sinon from 'sinon';
|
|
5
|
-
import {ConnectionState} from '@webex/internal-media-core';
|
|
6
|
-
|
|
7
|
-
import {StatsAnalyzer, EVENTS} from '../../../../src/statsAnalyzer';
|
|
8
|
-
import NetworkQualityMonitor from '../../../../src/networkQualityMonitor';
|
|
9
|
-
import testUtils from '../../../utils/testUtils';
|
|
10
|
-
import {MEDIA_DEVICES, MQA_INTERVAL, _UNKNOWN_} from '@webex/plugin-meetings/src/constants';
|
|
11
|
-
import LoggerProxy from '../../../../src/common/logs/logger-proxy';
|
|
12
|
-
import LoggerConfig from '../../../../src/common/logs/logger-config';
|
|
13
|
-
|
|
14
|
-
const {assert} = chai;
|
|
15
|
-
|
|
16
|
-
chai.use(chaiAsPromised);
|
|
17
|
-
sinon.assert.expose(chai.assert, {prefix: ''});
|
|
18
|
-
|
|
19
|
-
describe('plugin-meetings', () => {
|
|
20
|
-
describe('StatsAnalyzer', () => {
|
|
21
|
-
describe('parseStatsResult', () => {
|
|
22
|
-
const sandbox = sinon.createSandbox();
|
|
23
|
-
let statsAnalyzer;
|
|
24
|
-
|
|
25
|
-
const initialConfig = {};
|
|
26
|
-
const defaultStats = {};
|
|
27
|
-
|
|
28
|
-
beforeEach(() => {
|
|
29
|
-
const networkQualityMonitor = new NetworkQualityMonitor(initialConfig);
|
|
30
|
-
|
|
31
|
-
statsAnalyzer = new StatsAnalyzer(
|
|
32
|
-
initialConfig,
|
|
33
|
-
() => ({}),
|
|
34
|
-
networkQualityMonitor,
|
|
35
|
-
defaultStats
|
|
36
|
-
);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
afterEach(() => {
|
|
40
|
-
sandbox.reset();
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
it('should call processOutboundRTPResult', () => {
|
|
44
|
-
const calledSpy = sandbox.spy(statsAnalyzer, 'processOutboundRTPResult');
|
|
45
|
-
statsAnalyzer.parseGetStatsResult({type: 'outbound-rtp'}, 'video-send');
|
|
46
|
-
assert(calledSpy.calledOnce);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it('should call processInboundRTPResult', () => {
|
|
50
|
-
const calledSpy = sandbox.spy(statsAnalyzer, 'processInboundRTPResult');
|
|
51
|
-
statsAnalyzer.parseGetStatsResult({type: 'inbound-rtp'}, 'video-recv');
|
|
52
|
-
assert(calledSpy.calledOnce);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it('should call compareSentAndReceived', () => {
|
|
56
|
-
const calledSpy = sandbox.spy(statsAnalyzer, 'compareSentAndReceived');
|
|
57
|
-
statsAnalyzer.parseGetStatsResult({type: 'remote-outbound-rtp'}, 'video-send');
|
|
58
|
-
assert(calledSpy.calledOnce);
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
it('should call parseCandidate', () => {
|
|
62
|
-
const calledSpy = sandbox.spy(statsAnalyzer, 'parseCandidate');
|
|
63
|
-
statsAnalyzer.parseGetStatsResult({type: 'local-candidate'}, 'video-send');
|
|
64
|
-
assert(calledSpy.calledOnce);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('processOutboundRTPResult should create the correct stats results for audio', () => {
|
|
68
|
-
// establish the `statsResults` object.
|
|
69
|
-
statsAnalyzer.parseGetStatsResult({type: 'none'}, 'audio-send', true);
|
|
70
|
-
|
|
71
|
-
statsAnalyzer.processOutboundRTPResult(
|
|
72
|
-
{
|
|
73
|
-
bytesSent: 50000,
|
|
74
|
-
codecId: 'RTCCodec_1_Outbound_111',
|
|
75
|
-
headerBytesSent: 25000,
|
|
76
|
-
id: 'RTCOutboundRTPAudioStream_123456789',
|
|
77
|
-
kind: 'audio',
|
|
78
|
-
mediaSourceId: 'RTCAudioSource_2',
|
|
79
|
-
mediaType: 'audio',
|
|
80
|
-
nackCount: 1,
|
|
81
|
-
packetsSent: 3600,
|
|
82
|
-
remoteId: 'RTCRemoteInboundRtpAudioStream_123456789',
|
|
83
|
-
ssrc: 123456789,
|
|
84
|
-
targetBitrate: 256000,
|
|
85
|
-
timestamp: 1707341489336,
|
|
86
|
-
trackId: 'RTCMediaStreamTrack_sender_2',
|
|
87
|
-
transportId: 'RTCTransport_0_1',
|
|
88
|
-
type: 'outbound-rtp',
|
|
89
|
-
requestedBitrate: 10000,
|
|
90
|
-
},
|
|
91
|
-
'audio-send',
|
|
92
|
-
true
|
|
93
|
-
);
|
|
94
|
-
|
|
95
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.headerBytesSent, 25000);
|
|
96
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.totalBytesSent, 50000);
|
|
97
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.totalNackCount, 1);
|
|
98
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.totalPacketsSent, 3600);
|
|
99
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.requestedBitrate, 10000);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
it('processOutboundRTPResult should create the correct stats results for video', () => {
|
|
103
|
-
// establish the `statsResults` object for video.
|
|
104
|
-
statsAnalyzer.parseGetStatsResult({type: 'none'}, 'video-send', true);
|
|
105
|
-
|
|
106
|
-
statsAnalyzer.processOutboundRTPResult(
|
|
107
|
-
{
|
|
108
|
-
bytesSent: 250000,
|
|
109
|
-
codecId: 'RTCCodec_1_Outbound_107',
|
|
110
|
-
headerBytesSent: 50000,
|
|
111
|
-
id: 'RTCOutboundRTPVideoStream_987654321',
|
|
112
|
-
kind: 'video',
|
|
113
|
-
mediaSourceId: 'RTCVideoSource_3',
|
|
114
|
-
mediaType: 'video',
|
|
115
|
-
nackCount: 5,
|
|
116
|
-
packetsSent: 15000,
|
|
117
|
-
remoteId: 'RTCRemoteInboundRtpVideoStream_987654321',
|
|
118
|
-
retransmittedBytesSent: 500,
|
|
119
|
-
retransmittedPacketsSent: 10,
|
|
120
|
-
ssrc: 987654321,
|
|
121
|
-
targetBitrate: 1024000,
|
|
122
|
-
timestamp: 1707341489336,
|
|
123
|
-
trackId: 'RTCMediaStreamTrack_sender_3',
|
|
124
|
-
transportId: 'RTCTransport_0_2',
|
|
125
|
-
type: 'outbound-rtp',
|
|
126
|
-
requestedBitrate: 50000,
|
|
127
|
-
},
|
|
128
|
-
'video-send',
|
|
129
|
-
true
|
|
130
|
-
);
|
|
131
|
-
|
|
132
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-send'].send.headerBytesSent, 50000);
|
|
133
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-send'].send.totalBytesSent, 250000);
|
|
134
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-send'].send.totalNackCount, 5);
|
|
135
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-send'].send.totalPacketsSent, 15000);
|
|
136
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-send'].send.requestedBitrate, 50000);
|
|
137
|
-
assert.strictEqual(
|
|
138
|
-
statsAnalyzer.statsResults['video-send'].send.totalRtxPacketsSent,
|
|
139
|
-
10
|
|
140
|
-
);
|
|
141
|
-
assert.strictEqual(
|
|
142
|
-
statsAnalyzer.statsResults['video-send'].send.totalRtxBytesSent,
|
|
143
|
-
500
|
|
144
|
-
);
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it('processInboundRTPResult should create the correct stats results for audio', () => {
|
|
148
|
-
// establish the `statsResults` object.
|
|
149
|
-
statsAnalyzer.parseGetStatsResult({type: 'none'}, 'audio-recv-1', false);
|
|
150
|
-
|
|
151
|
-
statsAnalyzer.processInboundRTPResult(
|
|
152
|
-
{
|
|
153
|
-
audioLevel: 0,
|
|
154
|
-
bytesReceived: 509,
|
|
155
|
-
codecId: 'RTCCodec_6_Inbound_111',
|
|
156
|
-
concealedSamples: 200000,
|
|
157
|
-
concealmentEvents: 13,
|
|
158
|
-
fecPacketsDiscarded: 1,
|
|
159
|
-
fecPacketsReceived: 1,
|
|
160
|
-
headerBytesReceived: 250,
|
|
161
|
-
id: 'RTCInboundRTPAudioStream_123456789',
|
|
162
|
-
insertedSamplesForDeceleration: 0,
|
|
163
|
-
jitter: 0.012,
|
|
164
|
-
jitterBufferDelay: 1000,
|
|
165
|
-
jitterBufferEmittedCount: 10000,
|
|
166
|
-
kind: 'audio',
|
|
167
|
-
lastPacketReceivedTimestamp: 1707341488529,
|
|
168
|
-
mediaType: 'audio',
|
|
169
|
-
packetsDiscarded: 0,
|
|
170
|
-
packetsLost: 0,
|
|
171
|
-
packetsReceived: 12,
|
|
172
|
-
remoteId: 'RTCRemoteOutboundRTPAudioStream_123456789',
|
|
173
|
-
removedSamplesForAcceleration: 0,
|
|
174
|
-
silentConcealedSamples: 200000,
|
|
175
|
-
ssrc: 123456789,
|
|
176
|
-
timestamp: 1707341489419,
|
|
177
|
-
totalAudioEnergy: 133,
|
|
178
|
-
totalSamplesDuration: 7,
|
|
179
|
-
totalSamplesReceived: 300000,
|
|
180
|
-
trackId: 'RTCMediaStreamTrack_receiver_76',
|
|
181
|
-
transportId: 'RTCTransport_0_1',
|
|
182
|
-
type: 'inbound-rtp',
|
|
183
|
-
requestedBitrate: 10000,
|
|
184
|
-
},
|
|
185
|
-
'audio-recv-1',
|
|
186
|
-
false
|
|
187
|
-
);
|
|
188
|
-
|
|
189
|
-
assert.strictEqual(
|
|
190
|
-
statsAnalyzer.statsResults['audio-recv-1'].recv.totalPacketsReceived,
|
|
191
|
-
12
|
|
192
|
-
);
|
|
193
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.fecPacketsDiscarded, 1);
|
|
194
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.fecPacketsReceived, 1);
|
|
195
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.totalBytesReceived, 509);
|
|
196
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.requestedBitrate, 10000);
|
|
197
|
-
assert.strictEqual(
|
|
198
|
-
statsAnalyzer.statsResults['audio-recv-1'].recv.headerBytesReceived,
|
|
199
|
-
250
|
|
200
|
-
);
|
|
201
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.audioLevel, 0);
|
|
202
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.totalAudioEnergy, 133);
|
|
203
|
-
assert.strictEqual(
|
|
204
|
-
statsAnalyzer.statsResults['audio-recv-1'].recv.totalSamplesReceived,
|
|
205
|
-
300000
|
|
206
|
-
);
|
|
207
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-recv-1'].recv.totalSamplesDecoded, 0);
|
|
208
|
-
assert.strictEqual(
|
|
209
|
-
statsAnalyzer.statsResults['audio-recv-1'].recv.concealedSamples,
|
|
210
|
-
200000
|
|
211
|
-
);
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
it('processInboundRTPResult should create the correct stats results for video', () => {
|
|
215
|
-
// establish the `statsResults` object for video.
|
|
216
|
-
statsAnalyzer.parseGetStatsResult({type: 'none'}, 'video-recv', false);
|
|
217
|
-
|
|
218
|
-
statsAnalyzer.processInboundRTPResult(
|
|
219
|
-
{
|
|
220
|
-
bytesReceived: 100000,
|
|
221
|
-
codecId: 'RTCCodec_6_Inbound_107',
|
|
222
|
-
fecPacketsDiscarded: 2,
|
|
223
|
-
fecPacketsReceived: 2,
|
|
224
|
-
headerBytesReceived: 10000,
|
|
225
|
-
id: 'RTCInboundRTPVideoStream_987654321',
|
|
226
|
-
jitter: 0.05,
|
|
227
|
-
jitterBufferDelay: 5000,
|
|
228
|
-
jitterBufferEmittedCount: 50000,
|
|
229
|
-
kind: 'video',
|
|
230
|
-
lastPacketReceivedTimestamp: 1707341488529,
|
|
231
|
-
mediaType: 'video',
|
|
232
|
-
packetsDiscarded: 5,
|
|
233
|
-
packetsLost: 10,
|
|
234
|
-
packetsReceived: 1500,
|
|
235
|
-
remoteId: 'RTCRemoteOutboundRTPVideoStream_987654321',
|
|
236
|
-
ssrc: 987654321,
|
|
237
|
-
timestamp: 1707341489419,
|
|
238
|
-
trackId: 'RTCMediaStreamTrack_receiver_3',
|
|
239
|
-
transportId: 'RTCTransport_0_2',
|
|
240
|
-
type: 'inbound-rtp',
|
|
241
|
-
requestedBitrate: 50000,
|
|
242
|
-
retransmittedBytesReceived: 500,
|
|
243
|
-
retransmittedPacketsReceived: 10,
|
|
244
|
-
},
|
|
245
|
-
'video-recv',
|
|
246
|
-
false
|
|
247
|
-
);
|
|
248
|
-
|
|
249
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.totalPacketsReceived, 1500);
|
|
250
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.fecPacketsDiscarded, 2);
|
|
251
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.fecPacketsReceived, 2);
|
|
252
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.totalBytesReceived, 100000);
|
|
253
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.requestedBitrate, 50000);
|
|
254
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.headerBytesReceived, 10000);
|
|
255
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.totalRtxBytesReceived, 500);
|
|
256
|
-
assert.strictEqual(statsAnalyzer.statsResults['video-recv'].recv.totalRtxPacketsReceived, 10);
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
it('parseAudioSource should create the correct stats results', () => {
|
|
261
|
-
// establish the `statsResults` object.
|
|
262
|
-
statsAnalyzer.parseGetStatsResult({type: 'none'}, 'audio-send', true);
|
|
263
|
-
|
|
264
|
-
statsAnalyzer.parseAudioSource(
|
|
265
|
-
{
|
|
266
|
-
audioLevel: 0.03,
|
|
267
|
-
echoReturnLoss: -30,
|
|
268
|
-
echoReturnLossEnhancement: 0.17,
|
|
269
|
-
id: 'RTCAudioSource_2',
|
|
270
|
-
kind: 'audio',
|
|
271
|
-
timestamp: 1707341488160.012,
|
|
272
|
-
totalAudioEnergy: 0.001,
|
|
273
|
-
totalSamplesDuration: 4.5,
|
|
274
|
-
trackIdentifier: '2207e5bf-c595-4301-93f7-283994d8143f',
|
|
275
|
-
type: 'media-source',
|
|
276
|
-
},
|
|
277
|
-
'audio-send',
|
|
278
|
-
true
|
|
279
|
-
);
|
|
280
|
-
|
|
281
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.audioLevel, 0.03);
|
|
282
|
-
assert.strictEqual(statsAnalyzer.statsResults['audio-send'].send.totalAudioEnergy, 0.001);
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
|
|
286
|
-
describe('compareSentAndReceived()', () => {
|
|
287
|
-
let statsAnalyzer;
|
|
288
|
-
let sandBoxSpy;
|
|
289
|
-
|
|
290
|
-
const initialConfig = {
|
|
291
|
-
videoPacketLossRatioThreshold: 9,
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
const defaultStats = {
|
|
295
|
-
resolutions: {},
|
|
296
|
-
internal: {
|
|
297
|
-
'video-send-1': {
|
|
298
|
-
send: {
|
|
299
|
-
totalPacketsLostOnReceiver: 10,
|
|
300
|
-
},
|
|
301
|
-
},
|
|
302
|
-
},
|
|
303
|
-
'video-send-1': {
|
|
304
|
-
send: {
|
|
305
|
-
packetsSent: 2,
|
|
306
|
-
meanRemoteJitter: [],
|
|
307
|
-
meanRoundTripTime: [],
|
|
308
|
-
},
|
|
309
|
-
},
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
const statusResult = {
|
|
313
|
-
type: 'remote-inbound-rtp',
|
|
314
|
-
packetsLost: 11,
|
|
315
|
-
rttThreshold: 501,
|
|
316
|
-
jitterThreshold: 501,
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
const sandbox = sinon.createSandbox();
|
|
320
|
-
|
|
321
|
-
beforeEach(() => {
|
|
322
|
-
const networkQualityMonitor = new NetworkQualityMonitor(initialConfig);
|
|
323
|
-
|
|
324
|
-
statsAnalyzer = new StatsAnalyzer(
|
|
325
|
-
initialConfig,
|
|
326
|
-
() => ({}),
|
|
327
|
-
networkQualityMonitor,
|
|
328
|
-
defaultStats
|
|
329
|
-
);
|
|
330
|
-
|
|
331
|
-
sandBoxSpy = sandbox.spy(
|
|
332
|
-
statsAnalyzer.networkQualityMonitor,
|
|
333
|
-
'determineUplinkNetworkQuality'
|
|
334
|
-
);
|
|
335
|
-
});
|
|
336
|
-
|
|
337
|
-
afterEach(() => {
|
|
338
|
-
sandbox.restore();
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
it('should trigger determineUplinkNetworkQuality with specific arguments', async () => {
|
|
342
|
-
await statsAnalyzer.parseGetStatsResult(statusResult, 'video-send-1', true);
|
|
343
|
-
|
|
344
|
-
assert.calledOnce(statsAnalyzer.networkQualityMonitor.determineUplinkNetworkQuality);
|
|
345
|
-
assert(
|
|
346
|
-
sandBoxSpy.calledWith({
|
|
347
|
-
mediaType: 'video-send-1',
|
|
348
|
-
remoteRtpResults: statusResult,
|
|
349
|
-
statsAnalyzerCurrentStats: statsAnalyzer.statsResults,
|
|
350
|
-
})
|
|
351
|
-
);
|
|
352
|
-
});
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
describe('startAnalyzer', () => {
|
|
356
|
-
let clock;
|
|
357
|
-
let pc;
|
|
358
|
-
let networkQualityMonitor;
|
|
359
|
-
let statsAnalyzer;
|
|
360
|
-
let mqeData;
|
|
361
|
-
let loggerSpy;
|
|
362
|
-
let receiveSlot;
|
|
363
|
-
|
|
364
|
-
let receivedEventsData = {
|
|
365
|
-
local: {},
|
|
366
|
-
remote: {},
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
const initialConfig = {
|
|
370
|
-
analyzerInterval: 1000,
|
|
371
|
-
};
|
|
372
|
-
|
|
373
|
-
let fakeStats;
|
|
374
|
-
|
|
375
|
-
const sandbox = sinon.createSandbox();
|
|
376
|
-
|
|
377
|
-
const resetReceivedEvents = () => {
|
|
378
|
-
receivedEventsData = {
|
|
379
|
-
local: {},
|
|
380
|
-
remote: {},
|
|
381
|
-
};
|
|
382
|
-
};
|
|
383
|
-
|
|
384
|
-
before(() => {
|
|
385
|
-
LoggerConfig.set({enable: false});
|
|
386
|
-
LoggerProxy.set();
|
|
387
|
-
loggerSpy = sandbox.spy(LoggerProxy.logger, 'info');
|
|
388
|
-
});
|
|
389
|
-
|
|
390
|
-
beforeEach(() => {
|
|
391
|
-
clock = sinon.useFakeTimers();
|
|
392
|
-
receiveSlot = undefined;
|
|
393
|
-
|
|
394
|
-
resetReceivedEvents();
|
|
395
|
-
|
|
396
|
-
// bytesReceived and bytesSent need to be non-zero in order for StatsAnalyzer to parse any other values
|
|
397
|
-
fakeStats = {
|
|
398
|
-
audio: {
|
|
399
|
-
senders: [
|
|
400
|
-
{
|
|
401
|
-
localTrackLabel: 'fake-microphone',
|
|
402
|
-
report: [
|
|
403
|
-
{
|
|
404
|
-
type: 'outbound-rtp',
|
|
405
|
-
bytesSent: 1,
|
|
406
|
-
packetsSent: 0,
|
|
407
|
-
},
|
|
408
|
-
{
|
|
409
|
-
type: 'remote-inbound-rtp',
|
|
410
|
-
packetsLost: 0,
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
type: 'candidate-pair',
|
|
414
|
-
state: 'succeeded',
|
|
415
|
-
localCandidateId: 'fake-candidate-id',
|
|
416
|
-
},
|
|
417
|
-
{
|
|
418
|
-
type: 'candidate-pair',
|
|
419
|
-
state: 'failed',
|
|
420
|
-
localCandidateId: 'bad-candidate-id',
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
type: 'local-candidate',
|
|
424
|
-
id: 'fake-candidate-id',
|
|
425
|
-
protocol: 'tcp',
|
|
426
|
-
},
|
|
427
|
-
],
|
|
428
|
-
},
|
|
429
|
-
],
|
|
430
|
-
receivers: [
|
|
431
|
-
{
|
|
432
|
-
report: [
|
|
433
|
-
{
|
|
434
|
-
type: 'inbound-rtp',
|
|
435
|
-
bytesReceived: 1,
|
|
436
|
-
fecPacketsDiscarded: 0,
|
|
437
|
-
fecPacketsReceived: 0,
|
|
438
|
-
packetsLost: 0,
|
|
439
|
-
packetsReceived: 0,
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
type: 'remote-outbound-rtp',
|
|
443
|
-
},
|
|
444
|
-
{
|
|
445
|
-
type: 'candidate-pair',
|
|
446
|
-
state: 'succeeded',
|
|
447
|
-
localCandidateId: 'fake-candidate-id',
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
type: 'candidate-pair',
|
|
451
|
-
state: 'failed',
|
|
452
|
-
localCandidateId: 'bad-candidate-id',
|
|
453
|
-
},
|
|
454
|
-
{
|
|
455
|
-
type: 'local-candidate',
|
|
456
|
-
id: 'fake-candidate-id',
|
|
457
|
-
protocol: 'tcp',
|
|
458
|
-
},
|
|
459
|
-
],
|
|
460
|
-
},
|
|
461
|
-
],
|
|
462
|
-
},
|
|
463
|
-
video: {
|
|
464
|
-
senders: [
|
|
465
|
-
{
|
|
466
|
-
localTrackLabel: 'fake-camera',
|
|
467
|
-
report: [
|
|
468
|
-
{
|
|
469
|
-
type: 'outbound-rtp',
|
|
470
|
-
bytesSent: 1,
|
|
471
|
-
framesSent: 0,
|
|
472
|
-
packetsSent: 0,
|
|
473
|
-
},
|
|
474
|
-
{
|
|
475
|
-
type: 'remote-inbound-rtp',
|
|
476
|
-
packetsLost: 0,
|
|
477
|
-
},
|
|
478
|
-
{
|
|
479
|
-
type: 'candidate-pair',
|
|
480
|
-
state: 'succeeded',
|
|
481
|
-
localCandidateId: 'fake-candidate-id',
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
type: 'candidate-pair',
|
|
485
|
-
state: 'failed',
|
|
486
|
-
localCandidateId: 'bad-candidate-id',
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
type: 'local-candidate',
|
|
490
|
-
id: 'fake-candidate-id',
|
|
491
|
-
protocol: 'tcp',
|
|
492
|
-
},
|
|
493
|
-
],
|
|
494
|
-
},
|
|
495
|
-
],
|
|
496
|
-
receivers: [
|
|
497
|
-
{
|
|
498
|
-
report: [
|
|
499
|
-
{
|
|
500
|
-
type: 'inbound-rtp',
|
|
501
|
-
bytesReceived: 1,
|
|
502
|
-
frameHeight: 720,
|
|
503
|
-
frameWidth: 1280,
|
|
504
|
-
framesDecoded: 0,
|
|
505
|
-
framesReceived: 0,
|
|
506
|
-
packetsLost: 0,
|
|
507
|
-
packetsReceived: 0,
|
|
508
|
-
},
|
|
509
|
-
{
|
|
510
|
-
type: 'remote-outbound-rtp',
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
type: 'candidate-pair',
|
|
514
|
-
state: 'succeeded',
|
|
515
|
-
localCandidateId: 'fake-candidate-id',
|
|
516
|
-
},
|
|
517
|
-
{
|
|
518
|
-
type: 'candidate-pair',
|
|
519
|
-
state: 'failed',
|
|
520
|
-
localCandidateId: 'bad-candidate-id',
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
type: 'local-candidate',
|
|
524
|
-
id: 'fake-candidate-id',
|
|
525
|
-
protocol: 'tcp',
|
|
526
|
-
},
|
|
527
|
-
],
|
|
528
|
-
},
|
|
529
|
-
],
|
|
530
|
-
},
|
|
531
|
-
share: {
|
|
532
|
-
senders: [
|
|
533
|
-
{
|
|
534
|
-
localTrackLabel: 'fake-share',
|
|
535
|
-
report: [
|
|
536
|
-
{
|
|
537
|
-
type: 'outbound-rtp',
|
|
538
|
-
bytesSent: 1,
|
|
539
|
-
framesSent: 0,
|
|
540
|
-
packetsSent: 0,
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
type: 'remote-inbound-rtp',
|
|
544
|
-
packetsLost: 0,
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
type: 'candidate-pair',
|
|
548
|
-
state: 'succeeded',
|
|
549
|
-
localCandidateId: 'fake-candidate-id',
|
|
550
|
-
},
|
|
551
|
-
{
|
|
552
|
-
type: 'candidate-pair',
|
|
553
|
-
state: 'failed',
|
|
554
|
-
localCandidateId: 'bad-candidate-id',
|
|
555
|
-
},
|
|
556
|
-
{
|
|
557
|
-
type: 'local-candidate',
|
|
558
|
-
id: 'fake-candidate-id',
|
|
559
|
-
protocol: 'tcp',
|
|
560
|
-
},
|
|
561
|
-
],
|
|
562
|
-
},
|
|
563
|
-
],
|
|
564
|
-
receivers: [
|
|
565
|
-
{
|
|
566
|
-
report: [
|
|
567
|
-
{
|
|
568
|
-
type: 'inbound-rtp',
|
|
569
|
-
bytesReceived: 1,
|
|
570
|
-
frameHeight: 720,
|
|
571
|
-
frameWidth: 1280,
|
|
572
|
-
framesDecoded: 0,
|
|
573
|
-
framesReceived: 0,
|
|
574
|
-
packetsLost: 0,
|
|
575
|
-
packetsReceived: 0,
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
type: 'remote-outbound-rtp',
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
type: 'candidate-pair',
|
|
582
|
-
state: 'succeeded',
|
|
583
|
-
localCandidateId: 'fake-candidate-id',
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
type: 'candidate-pair',
|
|
587
|
-
state: 'failed',
|
|
588
|
-
localCandidateId: 'bad-candidate-id',
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
type: 'local-candidate',
|
|
592
|
-
id: 'fake-candidate-id',
|
|
593
|
-
protocol: 'tcp',
|
|
594
|
-
},
|
|
595
|
-
],
|
|
596
|
-
},
|
|
597
|
-
],
|
|
598
|
-
},
|
|
599
|
-
};
|
|
600
|
-
|
|
601
|
-
pc = {
|
|
602
|
-
getConnectionState: sinon.stub().returns(ConnectionState.Connected),
|
|
603
|
-
getTransceiverStats: sinon.stub().resolves({
|
|
604
|
-
audio: {
|
|
605
|
-
senders: [fakeStats.audio.senders[0]],
|
|
606
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
607
|
-
},
|
|
608
|
-
video: {
|
|
609
|
-
senders: [fakeStats.video.senders[0]],
|
|
610
|
-
receivers: [fakeStats.video.receivers[0]],
|
|
611
|
-
},
|
|
612
|
-
screenShareAudio: {
|
|
613
|
-
senders: [fakeStats.audio.senders[0]],
|
|
614
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
615
|
-
},
|
|
616
|
-
screenShareVideo: {
|
|
617
|
-
senders: [fakeStats.share.senders[0]],
|
|
618
|
-
receivers: [fakeStats.share.receivers[0]],
|
|
619
|
-
},
|
|
620
|
-
}),
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
networkQualityMonitor = new NetworkQualityMonitor(initialConfig);
|
|
624
|
-
|
|
625
|
-
statsAnalyzer = new StatsAnalyzer(initialConfig, () => receiveSlot, networkQualityMonitor);
|
|
626
|
-
|
|
627
|
-
statsAnalyzer.on(EVENTS.LOCAL_MEDIA_STARTED, (data) => {
|
|
628
|
-
receivedEventsData.local.started = data;
|
|
629
|
-
});
|
|
630
|
-
statsAnalyzer.on(EVENTS.LOCAL_MEDIA_STOPPED, (data) => {
|
|
631
|
-
receivedEventsData.local.stopped = data;
|
|
632
|
-
});
|
|
633
|
-
statsAnalyzer.on(EVENTS.REMOTE_MEDIA_STARTED, (data) => {
|
|
634
|
-
receivedEventsData.remote.started = data;
|
|
635
|
-
});
|
|
636
|
-
statsAnalyzer.on(EVENTS.REMOTE_MEDIA_STOPPED, (data) => {
|
|
637
|
-
receivedEventsData.remote.stopped = data;
|
|
638
|
-
});
|
|
639
|
-
statsAnalyzer.on(EVENTS.MEDIA_QUALITY, ({data}) => {
|
|
640
|
-
mqeData = data;
|
|
641
|
-
});
|
|
642
|
-
});
|
|
643
|
-
|
|
644
|
-
afterEach(() => {
|
|
645
|
-
sandbox.reset();
|
|
646
|
-
clock.restore();
|
|
647
|
-
});
|
|
648
|
-
|
|
649
|
-
const startStatsAnalyzer = async (mediaStatus, lastEmittedEvents) => {
|
|
650
|
-
statsAnalyzer.updateMediaStatus(mediaStatus);
|
|
651
|
-
statsAnalyzer.startAnalyzer(pc);
|
|
652
|
-
statsAnalyzer.lastEmittedStartStopEvent = lastEmittedEvents || {};
|
|
653
|
-
|
|
654
|
-
await testUtils.flushPromises();
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
const mergeProperties = (
|
|
658
|
-
target,
|
|
659
|
-
properties,
|
|
660
|
-
keyValue = 'fake-candidate-id',
|
|
661
|
-
matchKey = 'type',
|
|
662
|
-
matchValue = 'local-candidate'
|
|
663
|
-
) => {
|
|
664
|
-
for (let key in target) {
|
|
665
|
-
if (target.hasOwnProperty(key)) {
|
|
666
|
-
if (typeof target[key] === 'object') {
|
|
667
|
-
mergeProperties(target[key], properties, keyValue, matchKey, matchValue);
|
|
668
|
-
}
|
|
669
|
-
if (key === 'id' && target[key] === keyValue && target[matchKey] === matchValue) {
|
|
670
|
-
Object.assign(target, properties);
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
|
|
676
|
-
const progressTime = async (time = initialConfig.analyzerInterval) => {
|
|
677
|
-
await clock.tickAsync(time);
|
|
678
|
-
await testUtils.flushPromises();
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
const checkReceivedEvent = ({expected}) => {
|
|
682
|
-
// check that we got the REMOTE_MEDIA_STARTED event for audio
|
|
683
|
-
assert.deepEqual(receivedEventsData.local.started, expected.local?.started);
|
|
684
|
-
assert.deepEqual(receivedEventsData.local.stopped, expected.local?.stopped);
|
|
685
|
-
assert.deepEqual(receivedEventsData.remote.started, expected.remote?.started);
|
|
686
|
-
assert.deepEqual(receivedEventsData.remote.stopped, expected.remote?.stopped);
|
|
687
|
-
};
|
|
688
|
-
|
|
689
|
-
const checkMqeData = () => {
|
|
690
|
-
for (const data of [
|
|
691
|
-
mqeData.audioTransmit,
|
|
692
|
-
mqeData.audioReceive,
|
|
693
|
-
mqeData.videoTransmit,
|
|
694
|
-
mqeData.videoReceive,
|
|
695
|
-
]) {
|
|
696
|
-
assert.strictEqual(data.length, 2);
|
|
697
|
-
assert.strictEqual(data[0].common.common.isMain, true);
|
|
698
|
-
assert.strictEqual(data[1].common.common.isMain, false);
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].receivedFrameSize, 3600);
|
|
702
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].receivedHeight, 720);
|
|
703
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].receivedWidth, 1280);
|
|
704
|
-
};
|
|
705
|
-
|
|
706
|
-
it('emits LOCAL_MEDIA_STARTED and LOCAL_MEDIA_STOPPED events for audio', async () => {
|
|
707
|
-
await startStatsAnalyzer({expected: {sendAudio: true}});
|
|
708
|
-
|
|
709
|
-
// check that we haven't received any events yet
|
|
710
|
-
checkReceivedEvent({expected: {}});
|
|
711
|
-
|
|
712
|
-
// setup a mock to return some values higher the previous ones
|
|
713
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 10;
|
|
714
|
-
|
|
715
|
-
await progressTime();
|
|
716
|
-
|
|
717
|
-
// check that we got the LOCAL_MEDIA_STARTED event for audio
|
|
718
|
-
checkReceivedEvent({expected: {local: {started: {type: 'audio'}}}});
|
|
719
|
-
|
|
720
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
721
|
-
resetReceivedEvents();
|
|
722
|
-
await progressTime();
|
|
723
|
-
checkReceivedEvent({expected: {local: {stopped: {type: 'audio'}}}});
|
|
724
|
-
});
|
|
725
|
-
|
|
726
|
-
it('emits LOCAL_MEDIA_STARTED and LOCAL_MEDIA_STOPPED events for video', async () => {
|
|
727
|
-
await startStatsAnalyzer({expected: {sendVideo: true}});
|
|
728
|
-
|
|
729
|
-
// check that we haven't received any events yet
|
|
730
|
-
checkReceivedEvent({expected: {}});
|
|
731
|
-
|
|
732
|
-
// setup a mock to return some values higher the previous ones
|
|
733
|
-
fakeStats.video.senders[0].report[0].framesSent += 1;
|
|
734
|
-
|
|
735
|
-
await progressTime();
|
|
736
|
-
|
|
737
|
-
// check that we got the LOCAL_MEDIA_STARTED event for audio
|
|
738
|
-
checkReceivedEvent({expected: {local: {started: {type: 'video'}}}});
|
|
739
|
-
|
|
740
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
741
|
-
resetReceivedEvents();
|
|
742
|
-
await progressTime();
|
|
743
|
-
checkReceivedEvent({expected: {local: {stopped: {type: 'video'}}}});
|
|
744
|
-
});
|
|
745
|
-
|
|
746
|
-
it('emits LOCAL_MEDIA_STARTED and LOCAL_MEDIA_STOPPED events for share', async () => {
|
|
747
|
-
await startStatsAnalyzer({expected: {sendShare: true}});
|
|
748
|
-
|
|
749
|
-
// check that we haven't received any events yet
|
|
750
|
-
checkReceivedEvent({expected: {}});
|
|
751
|
-
|
|
752
|
-
// setup a mock to return some values higher the previous ones
|
|
753
|
-
fakeStats.share.senders[0].report[0].framesSent += 1;
|
|
754
|
-
|
|
755
|
-
await progressTime();
|
|
756
|
-
|
|
757
|
-
// check that we got the LOCAL_MEDIA_STARTED event for audio
|
|
758
|
-
checkReceivedEvent({expected: {local: {started: {type: 'share'}}}});
|
|
759
|
-
|
|
760
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
761
|
-
resetReceivedEvents();
|
|
762
|
-
await progressTime();
|
|
763
|
-
checkReceivedEvent({expected: {local: {stopped: {type: 'share'}}}});
|
|
764
|
-
});
|
|
765
|
-
|
|
766
|
-
it('emits REMOTE_MEDIA_STARTED and REMOTE_MEDIA_STOPPED events for audio', async () => {
|
|
767
|
-
await startStatsAnalyzer({expected: {receiveAudio: true}});
|
|
768
|
-
|
|
769
|
-
// check that we haven't received any events yet
|
|
770
|
-
checkReceivedEvent({expected: {}});
|
|
771
|
-
|
|
772
|
-
// setup a mock to return some values higher the previous ones
|
|
773
|
-
fakeStats.audio.receivers[0].report[0].packetsReceived += 5;
|
|
774
|
-
|
|
775
|
-
await progressTime();
|
|
776
|
-
// check that we got the REMOTE_MEDIA_STARTED event for audio
|
|
777
|
-
checkReceivedEvent({expected: {remote: {started: {type: 'audio'}}}});
|
|
778
|
-
|
|
779
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
780
|
-
resetReceivedEvents();
|
|
781
|
-
await progressTime();
|
|
782
|
-
|
|
783
|
-
checkReceivedEvent({expected: {remote: {stopped: {type: 'audio'}}}});
|
|
784
|
-
});
|
|
785
|
-
|
|
786
|
-
it('emits REMOTE_MEDIA_STARTED and REMOTE_MEDIA_STOPPED events for video', async () => {
|
|
787
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
788
|
-
|
|
789
|
-
// check that we haven't received any events yet
|
|
790
|
-
checkReceivedEvent({expected: {}});
|
|
791
|
-
|
|
792
|
-
// setup a mock to return some values higher the previous ones
|
|
793
|
-
fakeStats.video.receivers[0].report[0].framesDecoded += 1;
|
|
794
|
-
|
|
795
|
-
await progressTime();
|
|
796
|
-
// check that we got the REMOTE_MEDIA_STARTED event for video
|
|
797
|
-
checkReceivedEvent({expected: {remote: {started: {type: 'video'}}}});
|
|
798
|
-
|
|
799
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
800
|
-
resetReceivedEvents();
|
|
801
|
-
await progressTime();
|
|
802
|
-
|
|
803
|
-
checkReceivedEvent({expected: {remote: {stopped: {type: 'video'}}}});
|
|
804
|
-
});
|
|
805
|
-
|
|
806
|
-
it('emits REMOTE_MEDIA_STARTED and REMOTE_MEDIA_STOPPED events for share', async () => {
|
|
807
|
-
await startStatsAnalyzer({expected: {receiveShare: true}});
|
|
808
|
-
|
|
809
|
-
// check that we haven't received any events yet
|
|
810
|
-
checkReceivedEvent({expected: {}});
|
|
811
|
-
|
|
812
|
-
// setup a mock to return some values higher the previous ones
|
|
813
|
-
fakeStats.share.receivers[0].report[0].framesDecoded += 1;
|
|
814
|
-
|
|
815
|
-
await progressTime();
|
|
816
|
-
// check that we got the REMOTE_MEDIA_STARTED event for video
|
|
817
|
-
checkReceivedEvent({expected: {remote: {started: {type: 'share'}}}});
|
|
818
|
-
|
|
819
|
-
// now advance the clock and the mock still returns same values, so only "stopped" event should be triggered
|
|
820
|
-
resetReceivedEvents();
|
|
821
|
-
await progressTime();
|
|
822
|
-
|
|
823
|
-
checkReceivedEvent({expected: {remote: {stopped: {type: 'share'}}}});
|
|
824
|
-
});
|
|
825
|
-
|
|
826
|
-
it('emits the correct MEDIA_QUALITY events', async () => {
|
|
827
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
828
|
-
|
|
829
|
-
await progressTime();
|
|
830
|
-
|
|
831
|
-
// Check that the mqe data has been emitted and is correctly computed.
|
|
832
|
-
checkMqeData();
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
it('emits the correct transportType in MEDIA_QUALITY events', async () => {
|
|
836
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
837
|
-
|
|
838
|
-
await progressTime();
|
|
839
|
-
|
|
840
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.transportType, 'TCP');
|
|
841
|
-
assert.strictEqual(mqeData.videoReceive[0].common.transportType, 'TCP');
|
|
842
|
-
});
|
|
843
|
-
|
|
844
|
-
it('emits the correct transportType in MEDIA_QUALITY events when using a TURN server', async () => {
|
|
845
|
-
fakeStats.audio.senders[0].report[4].relayProtocol = 'tls';
|
|
846
|
-
fakeStats.video.senders[0].report[4].relayProtocol = 'tls';
|
|
847
|
-
fakeStats.audio.receivers[0].report[4].relayProtocol = 'tls';
|
|
848
|
-
fakeStats.video.receivers[0].report[4].relayProtocol = 'tls';
|
|
849
|
-
|
|
850
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
851
|
-
|
|
852
|
-
await progressTime();
|
|
853
|
-
|
|
854
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.transportType, 'TLS');
|
|
855
|
-
assert.strictEqual(mqeData.videoReceive[0].common.transportType, 'TLS');
|
|
856
|
-
});
|
|
857
|
-
|
|
858
|
-
it('emits the correct peripherals in MEDIA_QUALITY events', async () => {
|
|
859
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
860
|
-
|
|
861
|
-
await progressTime();
|
|
862
|
-
|
|
863
|
-
assert.strictEqual(
|
|
864
|
-
mqeData.intervalMetadata.peripherals.find((val) => val.name === MEDIA_DEVICES.MICROPHONE)
|
|
865
|
-
.information,
|
|
866
|
-
'fake-microphone'
|
|
867
|
-
);
|
|
868
|
-
assert.strictEqual(
|
|
869
|
-
mqeData.intervalMetadata.peripherals.find((val) => val.name === MEDIA_DEVICES.CAMERA)
|
|
870
|
-
.information,
|
|
871
|
-
'fake-camera'
|
|
872
|
-
);
|
|
873
|
-
});
|
|
874
|
-
|
|
875
|
-
it('emits the correct peripherals in MEDIA_QUALITY events when localTrackLabel is undefined', async () => {
|
|
876
|
-
fakeStats.audio.senders[0].localTrackLabel = undefined;
|
|
877
|
-
fakeStats.video.senders[0].localTrackLabel = undefined;
|
|
878
|
-
|
|
879
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
880
|
-
|
|
881
|
-
await progressTime();
|
|
882
|
-
|
|
883
|
-
assert.strictEqual(
|
|
884
|
-
mqeData.intervalMetadata.peripherals.find((val) => val.name === MEDIA_DEVICES.MICROPHONE)
|
|
885
|
-
.information,
|
|
886
|
-
_UNKNOWN_
|
|
887
|
-
);
|
|
888
|
-
assert.strictEqual(
|
|
889
|
-
mqeData.intervalMetadata.peripherals.find((val) => val.name === MEDIA_DEVICES.CAMERA)
|
|
890
|
-
.information,
|
|
891
|
-
_UNKNOWN_
|
|
892
|
-
);
|
|
893
|
-
});
|
|
894
|
-
|
|
895
|
-
it('emits the correct transmittedFrameRate/receivedFrameRate', async () => {
|
|
896
|
-
it('at the start of the stats analyzer', async () => {
|
|
897
|
-
await startStatsAnalyzer();
|
|
898
|
-
assert.strictEqual(mqeData.videoTransmit[0].streams[0].common.transmittedFrameRate, 0);
|
|
899
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].common.receivedFrameRate, 0);
|
|
900
|
-
});
|
|
901
|
-
|
|
902
|
-
it('after frames are sent and received', async () => {
|
|
903
|
-
fakeStats.video.senders[0].report[0].framesSent += 300;
|
|
904
|
-
fakeStats.video.receivers[0].report[0].framesReceived += 300;
|
|
905
|
-
await progressTime(MQA_INTERVAL);
|
|
906
|
-
|
|
907
|
-
// 300 frames in 60 seconds = 5 frames per second
|
|
908
|
-
assert.strictEqual(mqeData.videoTransmit[0].streams[0].common.transmittedFrameRate, 5);
|
|
909
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].common.receivedFrameRate, 5);
|
|
910
|
-
});
|
|
911
|
-
});
|
|
912
|
-
|
|
913
|
-
it('emits the correct rtpPackets', async () => {
|
|
914
|
-
it('at the start of the stats analyzer', async () => {
|
|
915
|
-
await startStatsAnalyzer();
|
|
916
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.rtpPackets, 0);
|
|
917
|
-
assert.strictEqual(mqeData.audioTransmit[0].streams[0].common.rtpPackets, 0);
|
|
918
|
-
assert.strictEqual(mqeData.audioReceive[0].common.rtpPackets, 0);
|
|
919
|
-
assert.strictEqual(mqeData.audioReceive[0].streams[0].common.rtpPackets, 0);
|
|
920
|
-
assert.strictEqual(mqeData.videoTransmit[0].common.rtpPackets, 0);
|
|
921
|
-
assert.strictEqual(mqeData.videoTransmit[0].streams[0].common.rtpPackets, 0);
|
|
922
|
-
assert.strictEqual(mqeData.videoReceive[0].common.rtpPackets, 0);
|
|
923
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].common.rtpPackets, 0);
|
|
924
|
-
});
|
|
925
|
-
|
|
926
|
-
it('after packets are sent', async () => {
|
|
927
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 5;
|
|
928
|
-
fakeStats.video.senders[0].report[0].packetsSent += 5;
|
|
929
|
-
await progressTime(MQA_INTERVAL);
|
|
930
|
-
|
|
931
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.rtpPackets, 5);
|
|
932
|
-
assert.strictEqual(mqeData.audioTransmit[0].streams[0].common.rtpPackets, 5);
|
|
933
|
-
assert.strictEqual(mqeData.videoTransmit[0].common.rtpPackets, 5);
|
|
934
|
-
assert.strictEqual(mqeData.videoTransmit[0].streams[0].common.rtpPackets, 5);
|
|
935
|
-
});
|
|
936
|
-
|
|
937
|
-
it('after packets are received', async () => {
|
|
938
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 10;
|
|
939
|
-
fakeStats.video.senders[0].report[0].packetsSent += 10;
|
|
940
|
-
fakeStats.audio.receivers[0].report[0].packetsReceived += 10;
|
|
941
|
-
fakeStats.video.receivers[0].report[0].packetsReceived += 10;
|
|
942
|
-
await progressTime(MQA_INTERVAL);
|
|
943
|
-
|
|
944
|
-
assert.strictEqual(mqeData.audioReceive[0].common.rtpPackets, 10);
|
|
945
|
-
assert.strictEqual(mqeData.audioReceive[0].streams[0].common.rtpPackets, 10);
|
|
946
|
-
assert.strictEqual(mqeData.videoReceive[0].common.rtpPackets, 10);
|
|
947
|
-
assert.strictEqual(mqeData.videoReceive[0].streams[0].common.rtpPackets, 10);
|
|
948
|
-
});
|
|
949
|
-
});
|
|
950
|
-
|
|
951
|
-
it('emits the correct fecPackets', async () => {
|
|
952
|
-
it('at the start of the stats analyzer', async () => {
|
|
953
|
-
await startStatsAnalyzer();
|
|
954
|
-
assert.strictEqual(mqeData.audioReceive[0].common.fecPackets, 0);
|
|
955
|
-
});
|
|
956
|
-
|
|
957
|
-
it('after FEC packets are received', async () => {
|
|
958
|
-
fakeStats.audio.receivers[0].report[0].fecPacketsReceived += 5;
|
|
959
|
-
await progressTime(MQA_INTERVAL);
|
|
960
|
-
|
|
961
|
-
assert.strictEqual(mqeData.audioReceive[0].common.fecPackets, 5);
|
|
962
|
-
});
|
|
963
|
-
|
|
964
|
-
it('after FEC packets are received and some FEC packets are discarded', async () => {
|
|
965
|
-
fakeStats.audio.receivers[0].report[0].fecPacketsReceived += 15;
|
|
966
|
-
fakeStats.audio.receivers[0].report[0].fecPacketsDiscarded += 5;
|
|
967
|
-
await progressTime(MQA_INTERVAL);
|
|
968
|
-
|
|
969
|
-
assert.strictEqual(mqeData.audioReceive[0].common.fecPackets, 10);
|
|
970
|
-
});
|
|
971
|
-
});
|
|
972
|
-
|
|
973
|
-
it('emits the correct mediaHopByHopLost/rtpHopByHopLost', async () => {
|
|
974
|
-
it('at the start of the stats analyzer', async () => {
|
|
975
|
-
await startStatsAnalyzer();
|
|
976
|
-
assert.strictEqual(mqeData.audioReceive[0].common.mediaHopByHopLost, 0);
|
|
977
|
-
assert.strictEqual(mqeData.audioReceive[0].common.rtpHopByHopLost, 0);
|
|
978
|
-
assert.strictEqual(mqeData.videoReceive[0].common.mediaHopByHopLost, 0);
|
|
979
|
-
assert.strictEqual(mqeData.videoReceive[0].common.rtpHopByHopLost, 0);
|
|
980
|
-
});
|
|
981
|
-
|
|
982
|
-
it('after packets are lost', async () => {
|
|
983
|
-
fakeStats.audio.receivers[0].report[0].packetsLost += 5;
|
|
984
|
-
fakeStats.video.receivers[0].report[0].packetsLost += 5;
|
|
985
|
-
await progressTime(MQA_INTERVAL);
|
|
986
|
-
|
|
987
|
-
assert.strictEqual(mqeData.audioReceive[0].common.mediaHopByHopLost, 5);
|
|
988
|
-
assert.strictEqual(mqeData.audioReceive[0].common.rtpHopByHopLost, 5);
|
|
989
|
-
assert.strictEqual(mqeData.videoReceive[0].common.mediaHopByHopLost, 5);
|
|
990
|
-
assert.strictEqual(mqeData.videoReceive[0].common.rtpHopByHopLost, 5);
|
|
991
|
-
});
|
|
992
|
-
});
|
|
993
|
-
|
|
994
|
-
it('emits the correct remoteLossRate', async () => {
|
|
995
|
-
it('at the start of the stats analyzer', async () => {
|
|
996
|
-
await startStatsAnalyzer();
|
|
997
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.remoteLossRate, 0);
|
|
998
|
-
assert.strictEqual(mqeData.videoTransmit[0].common.remoteLossRate, 0);
|
|
999
|
-
});
|
|
1000
|
-
|
|
1001
|
-
it('after packets are sent', async () => {
|
|
1002
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 100;
|
|
1003
|
-
fakeStats.video.senders[0].report[0].packetsSent += 100;
|
|
1004
|
-
await progressTime(MQA_INTERVAL);
|
|
1005
|
-
|
|
1006
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.remoteLossRate, 0);
|
|
1007
|
-
assert.strictEqual(mqeData.videoTransmit[0].common.remoteLossRate, 0);
|
|
1008
|
-
});
|
|
1009
|
-
|
|
1010
|
-
it('after packets are sent and some packets are lost', async () => {
|
|
1011
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 200;
|
|
1012
|
-
fakeStats.audio.senders[0].report[1].packetsLost += 10;
|
|
1013
|
-
fakeStats.video.senders[0].report[0].packetsSent += 200;
|
|
1014
|
-
fakeStats.video.senders[0].report[1].packetsLost += 10;
|
|
1015
|
-
await progressTime(MQA_INTERVAL);
|
|
1016
|
-
|
|
1017
|
-
assert.strictEqual(mqeData.audioTransmit[0].common.remoteLossRate, 5);
|
|
1018
|
-
assert.strictEqual(mqeData.videoTransmit[0].common.remoteLossRate, 5);
|
|
1019
|
-
});
|
|
1020
|
-
});
|
|
1021
|
-
|
|
1022
|
-
it('has the correct localIpAddress set when the candidateType is host', async () => {
|
|
1023
|
-
await startStatsAnalyzer();
|
|
1024
|
-
|
|
1025
|
-
await progressTime();
|
|
1026
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), '');
|
|
1027
|
-
mergeProperties(fakeStats, {address: 'test', candidateType: 'host'});
|
|
1028
|
-
await progressTime();
|
|
1029
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), 'test');
|
|
1030
|
-
});
|
|
1031
|
-
|
|
1032
|
-
it('has the correct localIpAddress set when the candidateType is prflx and relayProtocol is set', async () => {
|
|
1033
|
-
await startStatsAnalyzer();
|
|
1034
|
-
|
|
1035
|
-
await progressTime();
|
|
1036
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), '');
|
|
1037
|
-
mergeProperties(fakeStats, {
|
|
1038
|
-
relayProtocol: 'test',
|
|
1039
|
-
address: 'test2',
|
|
1040
|
-
candidateType: 'prflx',
|
|
1041
|
-
});
|
|
1042
|
-
await progressTime();
|
|
1043
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), 'test2');
|
|
1044
|
-
});
|
|
1045
|
-
|
|
1046
|
-
it('has the correct localIpAddress set when the candidateType is prflx and relayProtocol is not set', async () => {
|
|
1047
|
-
await startStatsAnalyzer();
|
|
1048
|
-
|
|
1049
|
-
await progressTime();
|
|
1050
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), '');
|
|
1051
|
-
mergeProperties(fakeStats, {
|
|
1052
|
-
relatedAddress: 'relatedAddress',
|
|
1053
|
-
address: 'test2',
|
|
1054
|
-
candidateType: 'prflx',
|
|
1055
|
-
});
|
|
1056
|
-
await progressTime();
|
|
1057
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), 'relatedAddress');
|
|
1058
|
-
});
|
|
1059
|
-
|
|
1060
|
-
it('has no localIpAddress set when the candidateType is invalid', async () => {
|
|
1061
|
-
await startStatsAnalyzer();
|
|
1062
|
-
|
|
1063
|
-
await progressTime();
|
|
1064
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), '');
|
|
1065
|
-
mergeProperties(fakeStats, {candidateType: 'invalid'});
|
|
1066
|
-
await progressTime();
|
|
1067
|
-
assert.strictEqual(statsAnalyzer.getLocalIpAddress(), '');
|
|
1068
|
-
});
|
|
1069
|
-
|
|
1070
|
-
it('logs a message when audio send packets do not increase', async () => {
|
|
1071
|
-
await startStatsAnalyzer(
|
|
1072
|
-
{expected: {sendAudio: true}},
|
|
1073
|
-
{audio: {local: EVENTS.LOCAL_MEDIA_STARTED}}
|
|
1074
|
-
);
|
|
1075
|
-
|
|
1076
|
-
// don't increase the packets when time progresses.
|
|
1077
|
-
await progressTime();
|
|
1078
|
-
|
|
1079
|
-
assert(
|
|
1080
|
-
loggerSpy.calledWith(
|
|
1081
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No audio RTP packets sent'
|
|
1082
|
-
)
|
|
1083
|
-
);
|
|
1084
|
-
});
|
|
1085
|
-
|
|
1086
|
-
it('does not log a message when audio send packets increase', async () => {
|
|
1087
|
-
await startStatsAnalyzer(
|
|
1088
|
-
{expected: {sendAudio: true}},
|
|
1089
|
-
{audio: {local: EVENTS.LOCAL_MEDIA_STOPPED}}
|
|
1090
|
-
);
|
|
1091
|
-
|
|
1092
|
-
fakeStats.audio.senders[0].report[0].packetsSent += 5;
|
|
1093
|
-
await progressTime();
|
|
1094
|
-
|
|
1095
|
-
assert(
|
|
1096
|
-
loggerSpy.neverCalledWith(
|
|
1097
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No audio RTP packets sent'
|
|
1098
|
-
)
|
|
1099
|
-
);
|
|
1100
|
-
});
|
|
1101
|
-
|
|
1102
|
-
it('logs a message when video send packets do not increase', async () => {
|
|
1103
|
-
await startStatsAnalyzer(
|
|
1104
|
-
{expected: {sendVideo: true}},
|
|
1105
|
-
{video: {local: EVENTS.LOCAL_MEDIA_STARTED}}
|
|
1106
|
-
);
|
|
1107
|
-
|
|
1108
|
-
// don't increase the packets when time progresses.
|
|
1109
|
-
await progressTime();
|
|
1110
|
-
|
|
1111
|
-
assert(
|
|
1112
|
-
loggerSpy.calledWith(
|
|
1113
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No video RTP packets sent'
|
|
1114
|
-
)
|
|
1115
|
-
);
|
|
1116
|
-
});
|
|
1117
|
-
|
|
1118
|
-
it('does not log a message when video send packets increase', async () => {
|
|
1119
|
-
await startStatsAnalyzer(
|
|
1120
|
-
{expected: {sendVideo: true}},
|
|
1121
|
-
{video: {local: EVENTS.LOCAL_MEDIA_STOPPED}}
|
|
1122
|
-
);
|
|
1123
|
-
|
|
1124
|
-
fakeStats.video.senders[0].report[0].packetsSent += 5;
|
|
1125
|
-
await progressTime();
|
|
1126
|
-
|
|
1127
|
-
assert(
|
|
1128
|
-
loggerSpy.neverCalledWith(
|
|
1129
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No video RTP packets sent'
|
|
1130
|
-
)
|
|
1131
|
-
);
|
|
1132
|
-
});
|
|
1133
|
-
|
|
1134
|
-
it('logs a message when share send packets do not increase', async () => {
|
|
1135
|
-
await startStatsAnalyzer(
|
|
1136
|
-
{expected: {sendShare: true}},
|
|
1137
|
-
{share: {local: EVENTS.LOCAL_MEDIA_STARTED}}
|
|
1138
|
-
);
|
|
1139
|
-
|
|
1140
|
-
// don't increase the packets when time progresses.
|
|
1141
|
-
await progressTime();
|
|
1142
|
-
|
|
1143
|
-
assert(
|
|
1144
|
-
loggerSpy.calledWith(
|
|
1145
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No share RTP packets sent'
|
|
1146
|
-
)
|
|
1147
|
-
);
|
|
1148
|
-
});
|
|
1149
|
-
|
|
1150
|
-
it('does not log a message when share send packets increase', async () => {
|
|
1151
|
-
await startStatsAnalyzer(
|
|
1152
|
-
{expected: {sendShare: true}},
|
|
1153
|
-
{share: {local: EVENTS.LOCAL_MEDIA_STOPPED}}
|
|
1154
|
-
);
|
|
1155
|
-
|
|
1156
|
-
fakeStats.share.senders[0].report[0].packetsSent += 5;
|
|
1157
|
-
await progressTime();
|
|
1158
|
-
|
|
1159
|
-
assert(
|
|
1160
|
-
loggerSpy.neverCalledWith(
|
|
1161
|
-
'StatsAnalyzer:index#compareLastStatsResult --> No share RTP packets sent'
|
|
1162
|
-
)
|
|
1163
|
-
);
|
|
1164
|
-
});
|
|
1165
|
-
|
|
1166
|
-
['avatar', 'invalid', 'no source', 'bandwidth limited', 'policy violation'].forEach(
|
|
1167
|
-
(sourceState) => {
|
|
1168
|
-
it(`does not log a message when no packets are recieved for a receive slot with sourceState "${sourceState}"`, async () => {
|
|
1169
|
-
receiveSlot = {
|
|
1170
|
-
sourceState,
|
|
1171
|
-
csi: 2,
|
|
1172
|
-
id: '4',
|
|
1173
|
-
};
|
|
1174
|
-
|
|
1175
|
-
await startStatsAnalyzer();
|
|
1176
|
-
|
|
1177
|
-
// don't increase the packets when time progresses.
|
|
1178
|
-
await progressTime();
|
|
1179
|
-
|
|
1180
|
-
assert.neverCalledWith(
|
|
1181
|
-
loggerSpy,
|
|
1182
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for receive slot id: "4" and csi: 2. Total packets received on slot: ',
|
|
1183
|
-
0
|
|
1184
|
-
);
|
|
1185
|
-
});
|
|
1186
|
-
}
|
|
1187
|
-
);
|
|
1188
|
-
|
|
1189
|
-
it(`logs a message if no packets are sent`, async () => {
|
|
1190
|
-
receiveSlot = {
|
|
1191
|
-
sourceState: 'live',
|
|
1192
|
-
csi: 2,
|
|
1193
|
-
id: '4',
|
|
1194
|
-
};
|
|
1195
|
-
await startStatsAnalyzer();
|
|
1196
|
-
|
|
1197
|
-
// don't increase the packets when time progresses.
|
|
1198
|
-
await progressTime();
|
|
1199
|
-
|
|
1200
|
-
assert.calledWith(
|
|
1201
|
-
loggerSpy,
|
|
1202
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for mediaType: video-recv-0, receive slot id: "4" and csi: 2. Total packets received on slot: ',
|
|
1203
|
-
0
|
|
1204
|
-
);
|
|
1205
|
-
|
|
1206
|
-
assert.calledWith(
|
|
1207
|
-
loggerSpy,
|
|
1208
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No frames received for mediaType: video-recv-0, receive slot id: "4" and csi: 2. Total frames received on slot: ',
|
|
1209
|
-
0
|
|
1210
|
-
);
|
|
1211
|
-
|
|
1212
|
-
assert.calledWith(
|
|
1213
|
-
loggerSpy,
|
|
1214
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No frames decoded for mediaType: video-recv-0, receive slot id: "4" and csi: 2. Total frames decoded on slot: ',
|
|
1215
|
-
0
|
|
1216
|
-
);
|
|
1217
|
-
|
|
1218
|
-
assert.calledWith(
|
|
1219
|
-
loggerSpy,
|
|
1220
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for mediaType: audio-recv-0, receive slot id: "4" and csi: 2. Total packets received on slot: ',
|
|
1221
|
-
0
|
|
1222
|
-
);
|
|
1223
|
-
|
|
1224
|
-
assert.calledWith(
|
|
1225
|
-
loggerSpy,
|
|
1226
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for mediaType: video-share-recv-0, receive slot id: "4" and csi: 2. Total packets received on slot: ',
|
|
1227
|
-
0
|
|
1228
|
-
);
|
|
1229
|
-
|
|
1230
|
-
assert.calledWith(
|
|
1231
|
-
loggerSpy,
|
|
1232
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No frames received for mediaType: video-share-recv-0, receive slot id: "4" and csi: 2. Total frames received on slot: ',
|
|
1233
|
-
0
|
|
1234
|
-
);
|
|
1235
|
-
assert.calledWith(
|
|
1236
|
-
loggerSpy,
|
|
1237
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No frames decoded for mediaType: video-share-recv-0, receive slot id: "4" and csi: 2. Total frames decoded on slot: ',
|
|
1238
|
-
0
|
|
1239
|
-
);
|
|
1240
|
-
assert.calledWith(
|
|
1241
|
-
loggerSpy,
|
|
1242
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for mediaType: audio-share-recv-0, receive slot id: "4" and csi: 2. Total packets received on slot: ',
|
|
1243
|
-
0
|
|
1244
|
-
);
|
|
1245
|
-
});
|
|
1246
|
-
|
|
1247
|
-
it(`does not log a message if receiveSlot is undefined`, async () => {
|
|
1248
|
-
await startStatsAnalyzer();
|
|
1249
|
-
|
|
1250
|
-
// don't increase the packets when time progresses.
|
|
1251
|
-
await progressTime();
|
|
1252
|
-
|
|
1253
|
-
assert.neverCalledWith(
|
|
1254
|
-
loggerSpy,
|
|
1255
|
-
'StatsAnalyzer:index#processInboundRTPResult --> No packets received for receive slot "". Total packets received on slot: ',
|
|
1256
|
-
0
|
|
1257
|
-
);
|
|
1258
|
-
});
|
|
1259
|
-
|
|
1260
|
-
it('has the correct number of senders and receivers (2)', async () => {
|
|
1261
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
1262
|
-
|
|
1263
|
-
await progressTime();
|
|
1264
|
-
|
|
1265
|
-
assert.lengthOf(mqeData.audioTransmit, 2);
|
|
1266
|
-
assert.lengthOf(mqeData.audioReceive, 2);
|
|
1267
|
-
assert.lengthOf(mqeData.videoTransmit, 2);
|
|
1268
|
-
assert.lengthOf(mqeData.videoReceive, 2);
|
|
1269
|
-
});
|
|
1270
|
-
|
|
1271
|
-
it('has one stream per sender/reciever', async () => {
|
|
1272
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
1273
|
-
|
|
1274
|
-
await progressTime();
|
|
1275
|
-
|
|
1276
|
-
assert.deepEqual(mqeData.audioTransmit[0].streams, [
|
|
1277
|
-
{
|
|
1278
|
-
common: {
|
|
1279
|
-
codec: 'opus',
|
|
1280
|
-
csi: [],
|
|
1281
|
-
requestedBitrate: 0,
|
|
1282
|
-
requestedFrames: 0,
|
|
1283
|
-
rtpPackets: 0,
|
|
1284
|
-
ssci: 0,
|
|
1285
|
-
transmittedBitrate: 0.13333333333333333,
|
|
1286
|
-
transmittedFrameRate: 0,
|
|
1287
|
-
},
|
|
1288
|
-
transmittedKeyFrames: 0,
|
|
1289
|
-
requestedKeyFrames: 0,
|
|
1290
|
-
requestedBitrate: 0,
|
|
1291
|
-
},
|
|
1292
|
-
]);
|
|
1293
|
-
assert.deepEqual(mqeData.audioTransmit[1].streams, [
|
|
1294
|
-
{
|
|
1295
|
-
common: {
|
|
1296
|
-
codec: 'opus',
|
|
1297
|
-
csi: [],
|
|
1298
|
-
requestedBitrate: 0,
|
|
1299
|
-
requestedFrames: 0,
|
|
1300
|
-
rtpPackets: 0,
|
|
1301
|
-
ssci: 0,
|
|
1302
|
-
transmittedBitrate: 0.13333333333333333,
|
|
1303
|
-
transmittedFrameRate: 0,
|
|
1304
|
-
},
|
|
1305
|
-
transmittedKeyFrames: 0,
|
|
1306
|
-
requestedKeyFrames: 0,
|
|
1307
|
-
requestedBitrate: 0,
|
|
1308
|
-
},
|
|
1309
|
-
]);
|
|
1310
|
-
assert.deepEqual(mqeData.audioReceive[0].streams, [
|
|
1311
|
-
{
|
|
1312
|
-
common: {
|
|
1313
|
-
codec: 'opus',
|
|
1314
|
-
concealedFrames: 0,
|
|
1315
|
-
csi: [],
|
|
1316
|
-
maxConcealRunLength: 0,
|
|
1317
|
-
optimalBitrate: 0,
|
|
1318
|
-
optimalFrameRate: 0,
|
|
1319
|
-
receivedBitrate: 0.13333333333333333,
|
|
1320
|
-
receivedFrameRate: 0,
|
|
1321
|
-
renderedFrameRate: 0,
|
|
1322
|
-
requestedBitrate: 0,
|
|
1323
|
-
requestedFrameRate: 0,
|
|
1324
|
-
rtpEndToEndLost: 0,
|
|
1325
|
-
maxRtpJitter: 0,
|
|
1326
|
-
meanRtpJitter: 0,
|
|
1327
|
-
rtpPackets: 0,
|
|
1328
|
-
ssci: 0,
|
|
1329
|
-
rtpJitter: 0,
|
|
1330
|
-
framesDropped: 0,
|
|
1331
|
-
framesReceived: 0,
|
|
1332
|
-
},
|
|
1333
|
-
},
|
|
1334
|
-
]);
|
|
1335
|
-
assert.deepEqual(mqeData.audioReceive[1].streams, [
|
|
1336
|
-
{
|
|
1337
|
-
common: {
|
|
1338
|
-
codec: 'opus',
|
|
1339
|
-
concealedFrames: 0,
|
|
1340
|
-
csi: [],
|
|
1341
|
-
maxConcealRunLength: 0,
|
|
1342
|
-
optimalBitrate: 0,
|
|
1343
|
-
optimalFrameRate: 0,
|
|
1344
|
-
receivedBitrate: 0.13333333333333333,
|
|
1345
|
-
receivedFrameRate: 0,
|
|
1346
|
-
renderedFrameRate: 0,
|
|
1347
|
-
requestedBitrate: 0,
|
|
1348
|
-
requestedFrameRate: 0,
|
|
1349
|
-
rtpEndToEndLost: 0,
|
|
1350
|
-
maxRtpJitter: 0,
|
|
1351
|
-
meanRtpJitter: 0,
|
|
1352
|
-
rtpPackets: 0,
|
|
1353
|
-
ssci: 0,
|
|
1354
|
-
rtpJitter: 0,
|
|
1355
|
-
framesDropped: 0,
|
|
1356
|
-
framesReceived: 0,
|
|
1357
|
-
},
|
|
1358
|
-
},
|
|
1359
|
-
]);
|
|
1360
|
-
assert.deepEqual(mqeData.videoTransmit[0].streams, [
|
|
1361
|
-
{
|
|
1362
|
-
common: {
|
|
1363
|
-
codec: 'H264',
|
|
1364
|
-
csi: [],
|
|
1365
|
-
duplicateSsci: 0,
|
|
1366
|
-
requestedBitrate: 0,
|
|
1367
|
-
requestedFrames: 0,
|
|
1368
|
-
rtpPackets: 0,
|
|
1369
|
-
ssci: 0,
|
|
1370
|
-
transmittedBitrate: 0.13333333333333333,
|
|
1371
|
-
transmittedFrameRate: 0,
|
|
1372
|
-
},
|
|
1373
|
-
h264CodecProfile: 'BP',
|
|
1374
|
-
isAvatar: false,
|
|
1375
|
-
isHardwareEncoded: false,
|
|
1376
|
-
localConfigurationChanges: 2,
|
|
1377
|
-
maxFrameQp: 0,
|
|
1378
|
-
maxNoiseLevel: 0,
|
|
1379
|
-
minRegionQp: 0,
|
|
1380
|
-
remoteConfigurationChanges: 0,
|
|
1381
|
-
requestedFrameSize: 0,
|
|
1382
|
-
requestedKeyFrames: 0,
|
|
1383
|
-
transmittedFrameSize: 0,
|
|
1384
|
-
transmittedHeight: 0,
|
|
1385
|
-
transmittedKeyFrames: 0,
|
|
1386
|
-
transmittedKeyFramesClient: 0,
|
|
1387
|
-
transmittedKeyFramesConfigurationChange: 0,
|
|
1388
|
-
transmittedKeyFramesFeedback: 0,
|
|
1389
|
-
transmittedKeyFramesLocalDrop: 0,
|
|
1390
|
-
transmittedKeyFramesOtherLayer: 0,
|
|
1391
|
-
transmittedKeyFramesPeriodic: 0,
|
|
1392
|
-
transmittedKeyFramesSceneChange: 0,
|
|
1393
|
-
transmittedKeyFramesStartup: 0,
|
|
1394
|
-
transmittedKeyFramesUnknown: 0,
|
|
1395
|
-
transmittedWidth: 0,
|
|
1396
|
-
requestedBitrate: 0,
|
|
1397
|
-
},
|
|
1398
|
-
]);
|
|
1399
|
-
assert.deepEqual(mqeData.videoTransmit[1].streams, [
|
|
1400
|
-
{
|
|
1401
|
-
common: {
|
|
1402
|
-
codec: 'H264',
|
|
1403
|
-
csi: [],
|
|
1404
|
-
duplicateSsci: 0,
|
|
1405
|
-
requestedBitrate: 0,
|
|
1406
|
-
requestedFrames: 0,
|
|
1407
|
-
rtpPackets: 0,
|
|
1408
|
-
ssci: 0,
|
|
1409
|
-
transmittedBitrate: 0.13333333333333333,
|
|
1410
|
-
transmittedFrameRate: 0,
|
|
1411
|
-
},
|
|
1412
|
-
h264CodecProfile: 'BP',
|
|
1413
|
-
isAvatar: false,
|
|
1414
|
-
isHardwareEncoded: false,
|
|
1415
|
-
localConfigurationChanges: 2,
|
|
1416
|
-
maxFrameQp: 0,
|
|
1417
|
-
maxNoiseLevel: 0,
|
|
1418
|
-
minRegionQp: 0,
|
|
1419
|
-
remoteConfigurationChanges: 0,
|
|
1420
|
-
requestedBitrate: 0,
|
|
1421
|
-
requestedFrameSize: 0,
|
|
1422
|
-
requestedKeyFrames: 0,
|
|
1423
|
-
transmittedFrameSize: 0,
|
|
1424
|
-
transmittedHeight: 0,
|
|
1425
|
-
transmittedKeyFrames: 0,
|
|
1426
|
-
transmittedKeyFramesClient: 0,
|
|
1427
|
-
transmittedKeyFramesConfigurationChange: 0,
|
|
1428
|
-
transmittedKeyFramesFeedback: 0,
|
|
1429
|
-
transmittedKeyFramesLocalDrop: 0,
|
|
1430
|
-
transmittedKeyFramesOtherLayer: 0,
|
|
1431
|
-
transmittedKeyFramesPeriodic: 0,
|
|
1432
|
-
transmittedKeyFramesSceneChange: 0,
|
|
1433
|
-
transmittedKeyFramesStartup: 0,
|
|
1434
|
-
transmittedKeyFramesUnknown: 0,
|
|
1435
|
-
transmittedWidth: 0,
|
|
1436
|
-
},
|
|
1437
|
-
]);
|
|
1438
|
-
assert.deepEqual(mqeData.videoReceive[0].streams, [
|
|
1439
|
-
{
|
|
1440
|
-
common: {
|
|
1441
|
-
codec: 'H264',
|
|
1442
|
-
concealedFrames: 0,
|
|
1443
|
-
csi: [],
|
|
1444
|
-
maxConcealRunLength: 0,
|
|
1445
|
-
optimalBitrate: 0,
|
|
1446
|
-
optimalFrameRate: 0,
|
|
1447
|
-
receivedBitrate: 0.13333333333333333,
|
|
1448
|
-
receivedFrameRate: 0,
|
|
1449
|
-
renderedFrameRate: 0,
|
|
1450
|
-
requestedBitrate: 0,
|
|
1451
|
-
requestedFrameRate: 0,
|
|
1452
|
-
rtpEndToEndLost: 0,
|
|
1453
|
-
rtpJitter: 0,
|
|
1454
|
-
rtpPackets: 0,
|
|
1455
|
-
ssci: 0,
|
|
1456
|
-
framesDropped: 0,
|
|
1457
|
-
},
|
|
1458
|
-
h264CodecProfile: 'BP',
|
|
1459
|
-
isActiveSpeaker: true,
|
|
1460
|
-
optimalFrameSize: 0,
|
|
1461
|
-
receivedFrameSize: 3600,
|
|
1462
|
-
receivedHeight: 720,
|
|
1463
|
-
receivedKeyFrames: 0,
|
|
1464
|
-
receivedKeyFramesForRequest: 0,
|
|
1465
|
-
receivedKeyFramesSourceChange: 0,
|
|
1466
|
-
receivedKeyFramesUnknown: 0,
|
|
1467
|
-
receivedWidth: 1280,
|
|
1468
|
-
requestedFrameSize: 0,
|
|
1469
|
-
requestedKeyFrames: 0,
|
|
1470
|
-
},
|
|
1471
|
-
]);
|
|
1472
|
-
assert.deepEqual(mqeData.videoReceive[1].streams, [
|
|
1473
|
-
{
|
|
1474
|
-
common: {
|
|
1475
|
-
codec: 'H264',
|
|
1476
|
-
concealedFrames: 0,
|
|
1477
|
-
csi: [],
|
|
1478
|
-
maxConcealRunLength: 0,
|
|
1479
|
-
optimalBitrate: 0,
|
|
1480
|
-
optimalFrameRate: 0,
|
|
1481
|
-
receivedBitrate: 0.13333333333333333,
|
|
1482
|
-
receivedFrameRate: 0,
|
|
1483
|
-
renderedFrameRate: 0,
|
|
1484
|
-
requestedBitrate: 0,
|
|
1485
|
-
requestedFrameRate: 0,
|
|
1486
|
-
rtpEndToEndLost: 0,
|
|
1487
|
-
rtpJitter: 0,
|
|
1488
|
-
rtpPackets: 0,
|
|
1489
|
-
ssci: 0,
|
|
1490
|
-
framesDropped: 0,
|
|
1491
|
-
},
|
|
1492
|
-
h264CodecProfile: 'BP',
|
|
1493
|
-
isActiveSpeaker: true,
|
|
1494
|
-
optimalFrameSize: 0,
|
|
1495
|
-
receivedFrameSize: 3600,
|
|
1496
|
-
receivedHeight: 720,
|
|
1497
|
-
receivedKeyFrames: 0,
|
|
1498
|
-
receivedKeyFramesForRequest: 0,
|
|
1499
|
-
receivedKeyFramesSourceChange: 0,
|
|
1500
|
-
receivedKeyFramesUnknown: 0,
|
|
1501
|
-
receivedWidth: 1280,
|
|
1502
|
-
requestedFrameSize: 0,
|
|
1503
|
-
requestedKeyFrames: 0,
|
|
1504
|
-
},
|
|
1505
|
-
]);
|
|
1506
|
-
});
|
|
1507
|
-
|
|
1508
|
-
it('has three streams for video receivers when three exist', async () => {
|
|
1509
|
-
pc.getTransceiverStats = sinon.stub().resolves({
|
|
1510
|
-
audio: {
|
|
1511
|
-
senders: [fakeStats.audio.senders[0]],
|
|
1512
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
1513
|
-
},
|
|
1514
|
-
video: {
|
|
1515
|
-
senders: [fakeStats.video.senders[0]],
|
|
1516
|
-
receivers: [
|
|
1517
|
-
fakeStats.video.receivers[0],
|
|
1518
|
-
fakeStats.video.receivers[0],
|
|
1519
|
-
fakeStats.video.receivers[0],
|
|
1520
|
-
],
|
|
1521
|
-
},
|
|
1522
|
-
screenShareAudio: {
|
|
1523
|
-
senders: [fakeStats.audio.senders[0]],
|
|
1524
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
1525
|
-
},
|
|
1526
|
-
screenShareVideo: {
|
|
1527
|
-
senders: [fakeStats.video.senders[0]],
|
|
1528
|
-
receivers: [fakeStats.video.receivers[0]],
|
|
1529
|
-
},
|
|
1530
|
-
});
|
|
1531
|
-
|
|
1532
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
1533
|
-
|
|
1534
|
-
await progressTime();
|
|
1535
|
-
|
|
1536
|
-
assert.deepEqual(mqeData.videoReceive[0].streams, [
|
|
1537
|
-
{
|
|
1538
|
-
common: {
|
|
1539
|
-
codec: 'H264',
|
|
1540
|
-
concealedFrames: 0,
|
|
1541
|
-
csi: [],
|
|
1542
|
-
maxConcealRunLength: 0,
|
|
1543
|
-
optimalBitrate: 0,
|
|
1544
|
-
optimalFrameRate: 0,
|
|
1545
|
-
receivedBitrate: 0.13333333333333333,
|
|
1546
|
-
receivedFrameRate: 0,
|
|
1547
|
-
renderedFrameRate: 0,
|
|
1548
|
-
requestedBitrate: 0,
|
|
1549
|
-
requestedFrameRate: 0,
|
|
1550
|
-
rtpEndToEndLost: 0,
|
|
1551
|
-
rtpJitter: 0,
|
|
1552
|
-
rtpPackets: 0,
|
|
1553
|
-
ssci: 0,
|
|
1554
|
-
framesDropped: 0,
|
|
1555
|
-
},
|
|
1556
|
-
h264CodecProfile: 'BP',
|
|
1557
|
-
isActiveSpeaker: true,
|
|
1558
|
-
optimalFrameSize: 0,
|
|
1559
|
-
receivedFrameSize: 3600,
|
|
1560
|
-
receivedHeight: 720,
|
|
1561
|
-
receivedKeyFrames: 0,
|
|
1562
|
-
receivedKeyFramesForRequest: 0,
|
|
1563
|
-
receivedKeyFramesSourceChange: 0,
|
|
1564
|
-
receivedKeyFramesUnknown: 0,
|
|
1565
|
-
receivedWidth: 1280,
|
|
1566
|
-
requestedFrameSize: 0,
|
|
1567
|
-
requestedKeyFrames: 0,
|
|
1568
|
-
},
|
|
1569
|
-
{
|
|
1570
|
-
common: {
|
|
1571
|
-
codec: 'H264',
|
|
1572
|
-
concealedFrames: 0,
|
|
1573
|
-
csi: [],
|
|
1574
|
-
maxConcealRunLength: 0,
|
|
1575
|
-
optimalBitrate: 0,
|
|
1576
|
-
optimalFrameRate: 0,
|
|
1577
|
-
receivedBitrate: 0.13333333333333333,
|
|
1578
|
-
receivedFrameRate: 0,
|
|
1579
|
-
renderedFrameRate: 0,
|
|
1580
|
-
requestedBitrate: 0,
|
|
1581
|
-
requestedFrameRate: 0,
|
|
1582
|
-
rtpEndToEndLost: 0,
|
|
1583
|
-
rtpJitter: 0,
|
|
1584
|
-
rtpPackets: 0,
|
|
1585
|
-
ssci: 0,
|
|
1586
|
-
framesDropped: 0,
|
|
1587
|
-
},
|
|
1588
|
-
h264CodecProfile: 'BP',
|
|
1589
|
-
isActiveSpeaker: true,
|
|
1590
|
-
optimalFrameSize: 0,
|
|
1591
|
-
receivedFrameSize: 3600,
|
|
1592
|
-
receivedHeight: 720,
|
|
1593
|
-
receivedKeyFrames: 0,
|
|
1594
|
-
receivedKeyFramesForRequest: 0,
|
|
1595
|
-
receivedKeyFramesSourceChange: 0,
|
|
1596
|
-
receivedKeyFramesUnknown: 0,
|
|
1597
|
-
receivedWidth: 1280,
|
|
1598
|
-
requestedFrameSize: 0,
|
|
1599
|
-
requestedKeyFrames: 0,
|
|
1600
|
-
},
|
|
1601
|
-
{
|
|
1602
|
-
common: {
|
|
1603
|
-
codec: 'H264',
|
|
1604
|
-
concealedFrames: 0,
|
|
1605
|
-
csi: [],
|
|
1606
|
-
maxConcealRunLength: 0,
|
|
1607
|
-
optimalBitrate: 0,
|
|
1608
|
-
optimalFrameRate: 0,
|
|
1609
|
-
receivedBitrate: 0.13333333333333333,
|
|
1610
|
-
receivedFrameRate: 0,
|
|
1611
|
-
renderedFrameRate: 0,
|
|
1612
|
-
requestedBitrate: 0,
|
|
1613
|
-
requestedFrameRate: 0,
|
|
1614
|
-
rtpEndToEndLost: 0,
|
|
1615
|
-
rtpJitter: 0,
|
|
1616
|
-
rtpPackets: 0,
|
|
1617
|
-
ssci: 0,
|
|
1618
|
-
framesDropped: 0,
|
|
1619
|
-
},
|
|
1620
|
-
h264CodecProfile: 'BP',
|
|
1621
|
-
isActiveSpeaker: true,
|
|
1622
|
-
optimalFrameSize: 0,
|
|
1623
|
-
receivedFrameSize: 3600,
|
|
1624
|
-
receivedHeight: 720,
|
|
1625
|
-
receivedKeyFrames: 0,
|
|
1626
|
-
receivedKeyFramesForRequest: 0,
|
|
1627
|
-
receivedKeyFramesSourceChange: 0,
|
|
1628
|
-
receivedKeyFramesUnknown: 0,
|
|
1629
|
-
receivedWidth: 1280,
|
|
1630
|
-
requestedFrameSize: 0,
|
|
1631
|
-
requestedKeyFrames: 0,
|
|
1632
|
-
},
|
|
1633
|
-
]);
|
|
1634
|
-
});
|
|
1635
|
-
|
|
1636
|
-
it('has three streams for video senders for simulcast', async () => {
|
|
1637
|
-
pc.getTransceiverStats = sinon.stub().resolves({
|
|
1638
|
-
audio: {
|
|
1639
|
-
senders: [fakeStats.audio.senders[0]],
|
|
1640
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
1641
|
-
},
|
|
1642
|
-
video: {
|
|
1643
|
-
senders: [
|
|
1644
|
-
{
|
|
1645
|
-
localTrackLabel: 'fake-camera',
|
|
1646
|
-
report: [
|
|
1647
|
-
{
|
|
1648
|
-
type: 'outbound-rtp',
|
|
1649
|
-
bytesSent: 1,
|
|
1650
|
-
framesSent: 0,
|
|
1651
|
-
packetsSent: 0,
|
|
1652
|
-
},
|
|
1653
|
-
{
|
|
1654
|
-
type: 'outbound-rtp',
|
|
1655
|
-
bytesSent: 0,
|
|
1656
|
-
framesSent: 0,
|
|
1657
|
-
packetsSent: 0,
|
|
1658
|
-
},
|
|
1659
|
-
{
|
|
1660
|
-
type: 'outbound-rtp',
|
|
1661
|
-
bytesSent: 1000,
|
|
1662
|
-
framesSent: 1,
|
|
1663
|
-
packetsSent: 1,
|
|
1664
|
-
},
|
|
1665
|
-
{
|
|
1666
|
-
type: 'remote-inbound-rtp',
|
|
1667
|
-
packetsLost: 0,
|
|
1668
|
-
},
|
|
1669
|
-
{
|
|
1670
|
-
type: 'candidate-pair',
|
|
1671
|
-
state: 'succeeded',
|
|
1672
|
-
localCandidateId: 'fake-candidate-id',
|
|
1673
|
-
},
|
|
1674
|
-
{
|
|
1675
|
-
type: 'candidate-pair',
|
|
1676
|
-
state: 'failed',
|
|
1677
|
-
localCandidateId: 'bad-candidate-id',
|
|
1678
|
-
},
|
|
1679
|
-
{
|
|
1680
|
-
type: 'local-candidate',
|
|
1681
|
-
id: 'fake-candidate-id',
|
|
1682
|
-
protocol: 'tcp',
|
|
1683
|
-
},
|
|
1684
|
-
],
|
|
1685
|
-
},
|
|
1686
|
-
],
|
|
1687
|
-
receivers: [fakeStats.video.receivers[0]],
|
|
1688
|
-
},
|
|
1689
|
-
screenShareAudio: {
|
|
1690
|
-
senders: [fakeStats.audio.senders[0]],
|
|
1691
|
-
receivers: [fakeStats.audio.receivers[0]],
|
|
1692
|
-
},
|
|
1693
|
-
screenShareVideo: {
|
|
1694
|
-
senders: [fakeStats.video.senders[0]],
|
|
1695
|
-
receivers: [fakeStats.video.receivers[0]],
|
|
1696
|
-
},
|
|
1697
|
-
});
|
|
1698
|
-
|
|
1699
|
-
await startStatsAnalyzer({expected: {receiveVideo: true}});
|
|
1700
|
-
|
|
1701
|
-
await progressTime();
|
|
1702
|
-
|
|
1703
|
-
assert.deepEqual(mqeData.videoTransmit[0].streams, [
|
|
1704
|
-
{
|
|
1705
|
-
common: {
|
|
1706
|
-
codec: 'H264',
|
|
1707
|
-
csi: [],
|
|
1708
|
-
duplicateSsci: 0,
|
|
1709
|
-
requestedBitrate: 0,
|
|
1710
|
-
requestedFrames: 0,
|
|
1711
|
-
rtpPackets: 0,
|
|
1712
|
-
ssci: 0,
|
|
1713
|
-
transmittedBitrate: 0.13333333333333333,
|
|
1714
|
-
transmittedFrameRate: 0
|
|
1715
|
-
},
|
|
1716
|
-
h264CodecProfile: 'BP',
|
|
1717
|
-
isAvatar: false,
|
|
1718
|
-
isHardwareEncoded: false,
|
|
1719
|
-
localConfigurationChanges: 2,
|
|
1720
|
-
maxFrameQp: 0,
|
|
1721
|
-
maxNoiseLevel: 0,
|
|
1722
|
-
minRegionQp: 0,
|
|
1723
|
-
remoteConfigurationChanges: 0,
|
|
1724
|
-
requestedFrameSize: 0,
|
|
1725
|
-
requestedKeyFrames: 0,
|
|
1726
|
-
transmittedFrameSize: 0,
|
|
1727
|
-
transmittedHeight: 0,
|
|
1728
|
-
transmittedKeyFrames: 0,
|
|
1729
|
-
transmittedKeyFramesClient: 0,
|
|
1730
|
-
transmittedKeyFramesConfigurationChange: 0,
|
|
1731
|
-
transmittedKeyFramesFeedback: 0,
|
|
1732
|
-
transmittedKeyFramesLocalDrop: 0,
|
|
1733
|
-
transmittedKeyFramesOtherLayer: 0,
|
|
1734
|
-
transmittedKeyFramesPeriodic: 0,
|
|
1735
|
-
transmittedKeyFramesSceneChange: 0,
|
|
1736
|
-
transmittedKeyFramesStartup: 0,
|
|
1737
|
-
transmittedKeyFramesUnknown: 0,
|
|
1738
|
-
transmittedWidth: 0,
|
|
1739
|
-
requestedBitrate: 0,
|
|
1740
|
-
},
|
|
1741
|
-
{
|
|
1742
|
-
common: {
|
|
1743
|
-
codec: 'H264',
|
|
1744
|
-
csi: [],
|
|
1745
|
-
duplicateSsci: 0,
|
|
1746
|
-
requestedBitrate: 0,
|
|
1747
|
-
requestedFrames: 0,
|
|
1748
|
-
rtpPackets: 0,
|
|
1749
|
-
ssci: 0,
|
|
1750
|
-
transmittedBitrate: 0,
|
|
1751
|
-
transmittedFrameRate: 0,
|
|
1752
|
-
},
|
|
1753
|
-
h264CodecProfile: 'BP',
|
|
1754
|
-
isAvatar: false,
|
|
1755
|
-
isHardwareEncoded: false,
|
|
1756
|
-
localConfigurationChanges: 2,
|
|
1757
|
-
maxFrameQp: 0,
|
|
1758
|
-
maxNoiseLevel: 0,
|
|
1759
|
-
minRegionQp: 0,
|
|
1760
|
-
remoteConfigurationChanges: 0,
|
|
1761
|
-
requestedFrameSize: 0,
|
|
1762
|
-
requestedKeyFrames: 0,
|
|
1763
|
-
transmittedFrameSize: 0,
|
|
1764
|
-
transmittedHeight: 0,
|
|
1765
|
-
transmittedKeyFrames: 0,
|
|
1766
|
-
transmittedKeyFramesClient: 0,
|
|
1767
|
-
transmittedKeyFramesConfigurationChange: 0,
|
|
1768
|
-
transmittedKeyFramesFeedback: 0,
|
|
1769
|
-
transmittedKeyFramesLocalDrop: 0,
|
|
1770
|
-
transmittedKeyFramesOtherLayer: 0,
|
|
1771
|
-
transmittedKeyFramesPeriodic: 0,
|
|
1772
|
-
transmittedKeyFramesSceneChange: 0,
|
|
1773
|
-
transmittedKeyFramesStartup: 0,
|
|
1774
|
-
transmittedKeyFramesUnknown: 0,
|
|
1775
|
-
transmittedWidth: 0,
|
|
1776
|
-
requestedBitrate: 0,
|
|
1777
|
-
},
|
|
1778
|
-
{
|
|
1779
|
-
common: {
|
|
1780
|
-
codec: 'H264',
|
|
1781
|
-
csi: [],
|
|
1782
|
-
duplicateSsci: 0,
|
|
1783
|
-
requestedBitrate: 0,
|
|
1784
|
-
requestedFrames: 0,
|
|
1785
|
-
rtpPackets: 1,
|
|
1786
|
-
ssci: 0,
|
|
1787
|
-
transmittedBitrate: 133.33333333333334,
|
|
1788
|
-
transmittedFrameRate: 0,
|
|
1789
|
-
},
|
|
1790
|
-
h264CodecProfile: 'BP',
|
|
1791
|
-
isAvatar: false,
|
|
1792
|
-
isHardwareEncoded: false,
|
|
1793
|
-
localConfigurationChanges: 2,
|
|
1794
|
-
maxFrameQp: 0,
|
|
1795
|
-
maxNoiseLevel: 0,
|
|
1796
|
-
minRegionQp: 0,
|
|
1797
|
-
remoteConfigurationChanges: 0,
|
|
1798
|
-
requestedFrameSize: 0,
|
|
1799
|
-
requestedKeyFrames: 0,
|
|
1800
|
-
transmittedFrameSize: 0,
|
|
1801
|
-
transmittedHeight: 0,
|
|
1802
|
-
transmittedKeyFrames: 0,
|
|
1803
|
-
transmittedKeyFramesClient: 0,
|
|
1804
|
-
transmittedKeyFramesConfigurationChange: 0,
|
|
1805
|
-
transmittedKeyFramesFeedback: 0,
|
|
1806
|
-
transmittedKeyFramesLocalDrop: 0,
|
|
1807
|
-
transmittedKeyFramesOtherLayer: 0,
|
|
1808
|
-
transmittedKeyFramesPeriodic: 0,
|
|
1809
|
-
transmittedKeyFramesSceneChange: 0,
|
|
1810
|
-
transmittedKeyFramesStartup: 0,
|
|
1811
|
-
transmittedKeyFramesUnknown: 0,
|
|
1812
|
-
transmittedWidth: 0,
|
|
1813
|
-
requestedBitrate: 0,
|
|
1814
|
-
}
|
|
1815
|
-
]);
|
|
1816
|
-
});
|
|
1817
|
-
});
|
|
1818
|
-
});
|
|
1819
|
-
});
|