Преглед изворни кода

Removes unused getStats method

dev1
paweldomas пре 9 година
родитељ
комит
45c5180a5e
1 измењених фајлова са 0 додато и 56 уклоњено
  1. 0
    56
      modules/xmpp/JingleSessionPC.js

+ 0
- 56
modules/xmpp/JingleSessionPC.js Прегледај датотеку

28
     this.hadturncandidate = false;
28
     this.hadturncandidate = false;
29
     this.lasticecandidate = false;
29
     this.lasticecandidate = false;
30
 
30
 
31
-    this.statsinterval = null;
32
-
33
     this.reason = null;
31
     this.reason = null;
34
 
32
 
35
     this.addssrc = [];
33
     this.addssrc = [];
313
     this.state = 'ended';
311
     this.state = 'ended';
314
     this.reason = reason;
312
     this.reason = reason;
315
     this.peerconnection.close();
313
     this.peerconnection.close();
316
-    if (this.statsinterval !== null) {
317
-        window.clearInterval(this.statsinterval);
318
-        this.statsinterval = null;
319
-    }
320
 };
314
 };
321
 
315
 
322
 JingleSessionPC.prototype.active = function () {
316
 JingleSessionPC.prototype.active = function () {
791
             $(document).trigger('ack.jingle', [self.sid, error]);
785
             $(document).trigger('ack.jingle', [self.sid, error]);
792
         },
786
         },
793
         10000);
787
         10000);
794
-    if (this.statsinterval !== null) {
795
-        window.clearInterval(this.statsinterval);
796
-        this.statsinterval = null;
797
-    }
798
 };
788
 };
799
 
789
 
800
 /**
790
 /**
1265
     }
1255
     }
1266
 };
1256
 };
1267
 
1257
 
1268
-JingleSessionPC.prototype.getStats = function (interval) {
1269
-    var self = this;
1270
-    var recv = {audio: 0, video: 0};
1271
-    var lost = {audio: 0, video: 0};
1272
-    var lastrecv = {audio: 0, video: 0};
1273
-    var lastlost = {audio: 0, video: 0};
1274
-    var loss = {audio: 0, video: 0};
1275
-    var delta = {audio: 0, video: 0};
1276
-    this.statsinterval = window.setInterval(function () {
1277
-        if (self && self.peerconnection && self.peerconnection.getStats) {
1278
-            self.peerconnection.getStats(function (stats) {
1279
-                var results = stats.result();
1280
-                // TODO: there are so much statistics you can get from this..
1281
-                for (var i = 0; i < results.length; ++i) {
1282
-                    if (results[i].type == 'ssrc') {
1283
-                        var packetsrecv = results[i].stat('packetsReceived');
1284
-                        var packetslost = results[i].stat('packetsLost');
1285
-                        if (packetsrecv && packetslost) {
1286
-                            packetsrecv = parseInt(packetsrecv, 10);
1287
-                            packetslost = parseInt(packetslost, 10);
1288
-
1289
-                            if (results[i].stat('googFrameRateReceived')) {
1290
-                                lastlost.video = lost.video;
1291
-                                lastrecv.video = recv.video;
1292
-                                recv.video = packetsrecv;
1293
-                                lost.video = packetslost;
1294
-                            } else {
1295
-                                lastlost.audio = lost.audio;
1296
-                                lastrecv.audio = recv.audio;
1297
-                                recv.audio = packetsrecv;
1298
-                                lost.audio = packetslost;
1299
-                            }
1300
-                        }
1301
-                    }
1302
-                }
1303
-                delta.audio = recv.audio - lastrecv.audio;
1304
-                delta.video = recv.video - lastrecv.video;
1305
-                loss.audio = (delta.audio > 0) ? Math.ceil(100 * (lost.audio - lastlost.audio) / delta.audio) : 0;
1306
-                loss.video = (delta.video > 0) ? Math.ceil(100 * (lost.video - lastlost.video) / delta.video) : 0;
1307
-                $(document).trigger('packetloss.jingle', [self.sid, loss]);
1308
-            });
1309
-        }
1310
-    }, interval || 3000);
1311
-    return this.statsinterval;
1312
-};
1313
-
1314
 JingleSessionPC.onJingleError = function (session, error)
1258
 JingleSessionPC.onJingleError = function (session, error)
1315
 {
1259
 {
1316
     logger.error("Jingle error", error);
1260
     logger.error("Jingle error", error);

Loading…
Откажи
Сачувај