• Home
  • Raw
  • Download

Lines Matching full:this

46   this.videoCodec = videoCodec;
47 this.localStream = null;
48 this.remoteStream = null;
49 this.results = {cameraType: '', peerConnectionStats: [],
52 this.inFps = [];
53 this.outFps = [];
55 this.previousFrame = [];
56 this.identicalFrameSsimThreshold = 0.985;
57 this.frameComparator = new Ssim();
59 this.remoteVideo = document.getElementById("remoteVideo");
60 this.localVideo = document.getElementById("localVideo");
65 this.gatherStats(this.localPeerConnection, 100, 20000,
66 this.reportTestDone.bind(this));
70 this.canvas = document.createElement('canvas');
71 this.context = this.canvas.getContext('2d');
72 this.remoteVideo.onloadedmetadata = this.collectAndAnalyzeStats.bind(this);
73 this.remoteVideo.addEventListener('play',
74 this.startCheckingVideoFrames.bind(this), false);
81 this.videoFrameChecker = setInterval(this.checkVideoFrame.bind(this), 20);
85 this.setup();
86 this.triggerGetUserMedia();
94 navigator.getUserMedia(constraints, this.gotLocalStream.bind(this),
95 this.onGetUserMediaError.bind(this));
97 this.reportError('getUserMedia exception: ' + exception.toString());
106 this.localStream = stream;
109 this.localPeerConnection = new webkitRTCPeerConnection(servers);
110 this.localPeerConnection.onicecandidate = this.gotLocalIceCandidate.bind(
111 this);
113 this.remotePeerConnection = new webkitRTCPeerConnection(servers);
114 this.remotePeerConnection.onicecandidate = this.gotRemoteIceCandidate.bind(
115 this);
116 this.remotePeerConnection.onaddstream = this.gotRemoteStream.bind(this);
118 this.localPeerConnection.addStream(this.localStream);
119 this.localPeerConnection.createOffer(this.gotOffer.bind(this),
121 this.localVideo.src = URL.createObjectURL(stream);
123 this.results.cameraType = stream.getVideoTracks()[0].label;
127 this.reportError('getUserMedia failed: ' + error.toString());
132 var pollFunction = setInterval(gatherOneReport.bind(this), interval);
140 peerConnection.getStats(this.gotStats.bind(this));
156 var incomingFps = this.getStatFromReport(report, 'googFrameRateInput');
161 var outgoingFps = this.getStatFromReport(report, 'googFrameRateSent');
163 this.inFps.push(incomingFps)
164 this.outFps.push(outgoingFps);
169 this.processStats();
171 clearInterval(this.videoFrameChecker);
173 setResults(this.results);
179 if (this.inFps != [] && this.outFps != []) {
180 var minInFps = Math.min.apply(null, this.inFps);
181 var maxInFps = Math.max.apply(null, this.inFps);
182 var averageInFps = average(this.inFps);
183 var minOutFps = Math.min.apply(null, this.outFps);
184 var maxOutFps = Math.max.apply(null, this.outFps);
185 var averageOutFps = average(this.outFps);
186 this.results.peerConnectionStats = [minInFps, maxInFps, averageInFps,
192 this.context.drawImage(this.remoteVideo, 0, 0, this.canvas.width,
193 this.canvas.height);
194 var imageData = this.context.getImageData(0, 0, this.canvas.width,
195 this.canvas.height);
198 this.results.frameStats.numBlackFrames++;
201 if (this.frameComparator.calculate(this.previousFrame, imageData.data) >
202 this.identicalFrameSsimThreshold) {
203 this.results.frameStats.numFrozenFrames++;
206 this.previousFrame = imageData.data;
207 this.results.frameStats.numFrames++;
217 if (accumulatedLuma > (this.nonBlackPixelLumaThreshold * i / 4)) {
225 this.remoteVideo.src = URL.createObjectURL(event.stream);
230 setSdpDefaultVideoCodec(description.sdp, this.videoCodec);
231 this.localPeerConnection.setLocalDescription(description);
232 this.remotePeerConnection.setRemoteDescription(description);
233 this.remotePeerConnection.createAnswer(this.gotAnswer.bind(
234 this), function(error) {});
240 if (selectedCodec != this.videoCodec) {
241 this.reportError('Expected codec ' + this.videoCodec + ', but WebRTC ' +
244 this.remotePeerConnection.setLocalDescription(description);
245 this.localPeerConnection.setRemoteDescription(description);
250 this.remotePeerConnection.addIceCandidate(
256 this.localPeerConnection.addIceCandidate(