Chromium Code Reviews| 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 // Resize output element to input dimensions to not compare VGA output to HD |
|
phoglund_chromium
2016/04/22 13:58:30
That doesn't explain the background. What about:
pbos
2016/04/22 14:04:42
Done.
| |
| 56 var height = videoTag.videoHeight; | 56 // input. |
| 57 inputElement = document.getElementById("local-view"); | |
| 58 var width = inputElement.videoWidth; | |
| 59 var height = inputElement.videoHeight; | |
| 60 videoTag.width = width; | |
| 61 videoTag.height = height; | |
| 57 | 62 |
| 58 if (width == 0 || height == 0) { | 63 if (width == 0 || height == 0) { |
| 59 throw failTest('Trying to capture from ' + videoTag.id + | 64 throw failTest('Trying to capture from ' + videoTag.id + |
| 60 ' but it is not playing any video.'); | 65 ' but it is not playing any video.'); |
| 61 } | 66 } |
| 62 | 67 |
| 63 console.log('Received width is: ' + width + ', received height is: ' + height | 68 console.log('Received width is: ' + width + ', received height is: ' + height |
| 64 + ', capture interval is: ' + gFrameCaptureInterval + | 69 + ', capture interval is: ' + gFrameCaptureInterval + |
| 65 ', duration is: ' + gCaptureDuration); | 70 ', duration is: ' + gCaptureDuration); |
| 66 | 71 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 188 } | 193 } |
| 189 | 194 |
| 190 /** | 195 /** |
| 191 * @private | 196 * @private |
| 192 */ | 197 */ |
| 193 function updateProgressBar_(currentFrame) { | 198 function updateProgressBar_(currentFrame) { |
| 194 progressBar.innerHTML = | 199 progressBar.innerHTML = |
| 195 'Transferring captured frames: ' + '(' + currentFrame + '/' + | 200 'Transferring captured frames: ' + '(' + currentFrame + '/' + |
| 196 gFrames.length + ')'; | 201 gFrames.length + ')'; |
| 197 } | 202 } |
| OLD | NEW |