| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * The gStartedAt when the capturing begins. Used for timeout adjustments. | 8 * The gStartedAt when the capturing begins. Used for timeout adjustments. |
| 9 * @private | 9 * @private |
| 10 */ | 10 */ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 * Starts the frame capturing. | 45 * Starts the frame capturing. |
| 46 * | 46 * |
| 47 * @param {!Object} The video tag from which the height and width parameters are | 47 * @param {!Object} The video tag from which the height and width parameters are |
| 48 to be extracted. | 48 to be extracted. |
| 49 * @param {Number} The frame rate at which we would like to capture frames. | 49 * @param {Number} The frame rate at which we would like to capture frames. |
| 50 * @param {Number} The duration of the frame capture in seconds. | 50 * @param {Number} The duration of the frame capture in seconds. |
| 51 */ | 51 */ |
| 52 function startFrameCapture(videoTag, frameRate, duration) { | 52 function startFrameCapture(videoTag, frameRate, duration) { |
| 53 gFrameCaptureInterval = 1000 / frameRate; | 53 gFrameCaptureInterval = 1000 / frameRate; |
| 54 gCaptureDuration = 1000 * duration; | 54 gCaptureDuration = 1000 * duration; |
| 55 var width = videoTag.videoWidth; | 55 inputElement = document.getElementById("local-view"); |
| 56 var height = videoTag.videoHeight; | 56 var width = inputElement.videoWidth; |
| 57 var height = inputElement.videoHeight; |
| 58 // The WebRTC code is free to start in VGA, so make sure that the output video |
| 59 // tag scales up to whatever the input size is (otherwise the video quality |
| 60 // comparison will go poorly. |
| 61 videoTag.width = width; |
| 62 videoTag.height = height; |
| 57 | 63 |
| 58 if (width == 0 || height == 0) { | 64 if (width == 0 || height == 0) { |
| 59 throw failTest('Trying to capture from ' + videoTag.id + | 65 throw failTest('Trying to capture from ' + videoTag.id + |
| 60 ' but it is not playing any video.'); | 66 ' but it is not playing any video.'); |
| 61 } | 67 } |
| 62 | 68 |
| 63 console.log('Received width is: ' + width + ', received height is: ' + height | 69 console.log('Received width is: ' + width + ', received height is: ' + height |
| 64 + ', capture interval is: ' + gFrameCaptureInterval + | 70 + ', capture interval is: ' + gFrameCaptureInterval + |
| 65 ', duration is: ' + gCaptureDuration); | 71 ', duration is: ' + gCaptureDuration); |
| 66 | 72 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 } | 194 } |
| 189 | 195 |
| 190 /** | 196 /** |
| 191 * @private | 197 * @private |
| 192 */ | 198 */ |
| 193 function updateProgressBar_(currentFrame) { | 199 function updateProgressBar_(currentFrame) { |
| 194 progressBar.innerHTML = | 200 progressBar.innerHTML = |
| 195 'Transferring captured frames: ' + '(' + currentFrame + '/' + | 201 'Transferring captured frames: ' + '(' + currentFrame + '/' + |
| 196 gFrames.length + ')'; | 202 gFrames.length + ')'; |
| 197 } | 203 } |
| OLD | NEW |