|
|
@@ -23,7 +23,8 @@ KEYS_BY_BROWSER_TYPE[RTCBrowserType.RTC_BROWSER_FIREFOX] = {
|
|
23
|
23
|
'packetsLost': 'packetsLost',
|
|
24
|
24
|
'packetsSent': 'packetsSent',
|
|
25
|
25
|
'bytesReceived': 'bytesReceived',
|
|
26
|
|
- 'bytesSent': 'bytesSent'
|
|
|
26
|
+ 'bytesSent': 'bytesSent',
|
|
|
27
|
+ 'framerateMean': 'framerateMean'
|
|
27
|
28
|
};
|
|
28
|
29
|
KEYS_BY_BROWSER_TYPE[RTCBrowserType.RTC_BROWSER_CHROME] = {
|
|
29
|
30
|
'receiveBandwidth': 'googAvailableReceiveBandwidth',
|
|
|
@@ -42,6 +43,8 @@ KEYS_BY_BROWSER_TYPE[RTCBrowserType.RTC_BROWSER_CHROME] = {
|
|
42
|
43
|
'googFrameWidthReceived': 'googFrameWidthReceived',
|
|
43
|
44
|
'googFrameHeightSent': 'googFrameHeightSent',
|
|
44
|
45
|
'googFrameWidthSent': 'googFrameWidthSent',
|
|
|
46
|
+ 'googFrameRateReceived': 'googFrameRateReceived',
|
|
|
47
|
+ 'googFrameRateSent': 'googFrameRateSent',
|
|
45
|
48
|
'audioInputLevel': 'audioInputLevel',
|
|
46
|
49
|
'audioOutputLevel': 'audioOutputLevel'
|
|
47
|
50
|
};
|
|
|
@@ -85,6 +88,7 @@ function SsrcStats() {
|
|
85
|
88
|
upload: 0
|
|
86
|
89
|
};
|
|
87
|
90
|
this.resolution = {};
|
|
|
91
|
+ this.framerate = 0;
|
|
88
|
92
|
}
|
|
89
|
93
|
|
|
90
|
94
|
/**
|
|
|
@@ -122,6 +126,14 @@ SsrcStats.prototype.resetBitrate = function() {
|
|
122
|
126
|
this.bitrate.upload = 0;
|
|
123
|
127
|
};
|
|
124
|
128
|
|
|
|
129
|
+/**
|
|
|
130
|
+ * Sets the "framerate".
|
|
|
131
|
+ * @param framerate the value to set.
|
|
|
132
|
+ */
|
|
|
133
|
+SsrcStats.prototype.setFramerate = function(framerate) {
|
|
|
134
|
+ this.framerate = framerate || 0;
|
|
|
135
|
+};
|
|
|
136
|
+
|
|
125
|
137
|
/**
|
|
126
|
138
|
*
|
|
127
|
139
|
*/
|
|
|
@@ -587,6 +599,21 @@ StatsCollector.prototype.processStatsReport = function() {
|
|
587
|
599
|
}
|
|
588
|
600
|
} catch (e) { /* not supported*/ }
|
|
589
|
601
|
|
|
|
602
|
+ // Tries to get frame rate
|
|
|
603
|
+ try {
|
|
|
604
|
+ ssrcStats.setFramerate(
|
|
|
605
|
+ getStatValue(now, 'googFrameRateReceived')
|
|
|
606
|
+ || getStatValue(now, 'googFrameRateSent')
|
|
|
607
|
+ || 0);
|
|
|
608
|
+ } catch (e) {
|
|
|
609
|
+ // if it fails with previous properties(chrome),
|
|
|
610
|
+ // let's try with another one (FF)
|
|
|
611
|
+ try {
|
|
|
612
|
+ ssrcStats.setFramerate(Math.round(
|
|
|
613
|
+ getNonNegativeStat(now, 'framerateMean')));
|
|
|
614
|
+ } catch (err) { /* not supported*/ }
|
|
|
615
|
+ }
|
|
|
616
|
+
|
|
590
|
617
|
if (resolution.height && resolution.width) {
|
|
591
|
618
|
ssrcStats.setResolution(resolution);
|
|
592
|
619
|
} else {
|
|
|
@@ -606,6 +633,7 @@ StatsCollector.prototype.processStatsReport = function() {
|
|
606
|
633
|
let bitrateDownload = 0;
|
|
607
|
634
|
let bitrateUpload = 0;
|
|
608
|
635
|
const resolutions = {};
|
|
|
636
|
+ const framerates = {};
|
|
609
|
637
|
|
|
610
|
638
|
Object.keys(this.ssrc2stats).forEach(
|
|
611
|
639
|
function(ssrc) {
|
|
|
@@ -626,6 +654,9 @@ StatsCollector.prototype.processStatsReport = function() {
|
|
626
|
654
|
|
|
627
|
655
|
// collect resolutions
|
|
628
|
656
|
resolutions[ssrc] = ssrcStats.resolution;
|
|
|
657
|
+
|
|
|
658
|
+ // collect framerates
|
|
|
659
|
+ framerates[ssrc] = ssrcStats.framerate;
|
|
629
|
660
|
},
|
|
630
|
661
|
this
|
|
631
|
662
|
);
|
|
|
@@ -650,6 +681,7 @@ StatsCollector.prototype.processStatsReport = function() {
|
|
650
|
681
|
'bitrate': this.conferenceStats.bitrate,
|
|
651
|
682
|
'packetLoss': this.conferenceStats.packetLoss,
|
|
652
|
683
|
'resolution': resolutions,
|
|
|
684
|
+ 'framerate': framerates,
|
|
653
|
685
|
'transport': this.conferenceStats.transport
|
|
654
|
686
|
});
|
|
655
|
687
|
this.conferenceStats.transport = [];
|