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

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: moved comment 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 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
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 }
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