|
|
@@ -67,10 +67,6 @@ function calculatePacketLoss(lostPackets, totalPackets) {
|
|
67
|
67
|
return Math.round((lostPackets/totalPackets)*100);
|
|
68
|
68
|
}
|
|
69
|
69
|
|
|
70
|
|
-function formatAudioLevel(audioLevel) {
|
|
71
|
|
- return Math.min(Math.max(audioLevel, 0), 1);
|
|
72
|
|
-}
|
|
73
|
|
-
|
|
74
|
70
|
/**
|
|
75
|
71
|
* Checks whether a certain record should be included in the logged statistics.
|
|
76
|
72
|
*/
|
|
|
@@ -110,7 +106,6 @@ function acceptReport(id, type) {
|
|
110
|
106
|
*/
|
|
111
|
107
|
function PeerStats() {
|
|
112
|
108
|
this.loss = {};
|
|
113
|
|
- this.ssrc2AudioLevel = {};
|
|
114
|
109
|
this.ssrc2bitrate = {
|
|
115
|
110
|
download: 0,
|
|
116
|
111
|
upload: 0
|
|
|
@@ -155,17 +150,6 @@ PeerStats.prototype.resetSsrcBitrate = function () {
|
|
155
|
150
|
this.ssrc2bitrate.upload = 0;
|
|
156
|
151
|
};
|
|
157
|
152
|
|
|
158
|
|
-/**
|
|
159
|
|
- * Sets new audio level(input or output) for given <tt>ssrc</tt> that identifies
|
|
160
|
|
- * the stream which belongs to the peer represented by this instance.
|
|
161
|
|
- * @param audioLevel the new audio level value to be set. Value is truncated to
|
|
162
|
|
- * fit the range from 0 to 1.
|
|
163
|
|
- */
|
|
164
|
|
-PeerStats.prototype.setSsrcAudioLevel = function (audioLevel) {
|
|
165
|
|
- // Range limit 0 - 1
|
|
166
|
|
- this.ssrc2AudioLevel = formatAudioLevel(audioLevel);
|
|
167
|
|
-};
|
|
168
|
|
-
|
|
169
|
153
|
function ConferenceStats() {
|
|
170
|
154
|
|
|
171
|
155
|
/**
|
|
|
@@ -780,7 +764,6 @@ StatsCollector.prototype.processAudioLevelReport = function () {
|
|
780
|
764
|
// TODO: Can't find specs about what this value really is, but it
|
|
781
|
765
|
// seems to vary between 0 and around 32k.
|
|
782
|
766
|
audioLevel = audioLevel / 32767;
|
|
783
|
|
- ssrcStats.setSsrcAudioLevel(audioLevel);
|
|
784
|
767
|
this.eventEmitter.emit(
|
|
785
|
768
|
StatisticsEvents.AUDIO_LEVEL, ssrc, audioLevel, isLocal);
|
|
786
|
769
|
}
|