Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/test/data/webrtc/video_extraction.js

Issue 1905373002: Resize video output to match input dimensions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698