| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // FPSObserver observes a <video> and reports decoded FPS, dropped FPS, and | 5 // FPSObserver observes a <video> and reports decoded FPS, dropped FPS, and |
| 6 // total dropped frames during the video playback. | 6 // total dropped frames during the video playback. |
| 7 var FPSObserver = new function() { | 7 var FPSObserver = new function() { |
| 8 this.video_ = null; | 8 this.video_ = null; |
| 9 this.decodedFrames_ = 0; | 9 this.decodedFrames_ = 0; |
| 10 this.droppedFrames_ = 0; | 10 this.droppedFrames_ = 0; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 this.droppedFrames_ = this.video_.webkitDroppedFrameCount; | 58 this.droppedFrames_ = this.video_.webkitDroppedFrameCount; |
| 59 fps = fps.toFixed(2); | 59 fps = fps.toFixed(2); |
| 60 droppedFPSElement.innerHTML = fps; | 60 droppedFPSElement.innerHTML = fps; |
| 61 | 61 |
| 62 droppedFramesElement.innerHTML = this.droppedFrames_; | 62 droppedFramesElement.innerHTML = this.droppedFrames_; |
| 63 }; | 63 }; |
| 64 | 64 |
| 65 FPSObserver.endTest = function() { | 65 FPSObserver.endTest = function() { |
| 66 window.clearInterval(this.intID_); | 66 window.clearInterval(this.intID_); |
| 67 }; | 67 }; |
| OLD | NEW |