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

Side by Side Diff: webrtc/video/video_quality_test.cc

Issue 2652713002: video_loopback: fall back to fake capturer if we can't open camera. (Closed)
Patch Set: dcheck Created 3 years, 11 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 #include "webrtc/video/video_quality_test.h" 10 #include "webrtc/video/video_quality_test.h"
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after
1235 if (params_.screenshare.enabled) { 1235 if (params_.screenshare.enabled) {
1236 test::FrameGeneratorCapturer* frame_generator_capturer = 1236 test::FrameGeneratorCapturer* frame_generator_capturer =
1237 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(), 1237 new test::FrameGeneratorCapturer(clock_, frame_generator_.release(),
1238 params_.video.fps); 1238 params_.video.fps);
1239 EXPECT_TRUE(frame_generator_capturer->Init()); 1239 EXPECT_TRUE(frame_generator_capturer->Init());
1240 video_capturer_.reset(frame_generator_capturer); 1240 video_capturer_.reset(frame_generator_capturer);
1241 } else { 1241 } else {
1242 if (params_.video.clip_name.empty()) { 1242 if (params_.video.clip_name.empty()) {
1243 video_capturer_.reset(test::VcmCapturer::Create( 1243 video_capturer_.reset(test::VcmCapturer::Create(
1244 params_.video.width, params_.video.height, params_.video.fps)); 1244 params_.video.width, params_.video.height, params_.video.fps));
1245 if (!video_capturer_) {
1246 // Failed to get actual camera, use chroma generator as backup.
1247 video_capturer_.reset(test::FrameGeneratorCapturer::Create(
1248 params_.video.width, params_.video.height, params_.video.fps,
1249 clock_));
1250 }
1245 } else { 1251 } else {
1246 video_capturer_.reset(test::FrameGeneratorCapturer::CreateFromYuvFile( 1252 video_capturer_.reset(test::FrameGeneratorCapturer::CreateFromYuvFile(
1247 test::ResourcePath(params_.video.clip_name, "yuv"), 1253 test::ResourcePath(params_.video.clip_name, "yuv"),
1248 params_.video.width, params_.video.height, params_.video.fps, 1254 params_.video.width, params_.video.height, params_.video.fps,
1249 clock_)); 1255 clock_));
1250 ASSERT_TRUE(video_capturer_) << "Could not create capturer for " 1256 ASSERT_TRUE(video_capturer_) << "Could not create capturer for "
1251 << params_.video.clip_name 1257 << params_.video.clip_name
1252 << ".yuv. Is this resource file present?"; 1258 << ".yuv. Is this resource file present?";
1253 } 1259 }
1254 } 1260 }
1261 RTC_DCHECK(video_capturer_.get());
1255 } 1262 }
1256 1263
1257 void VideoQualityTest::RunWithAnalyzer(const Params& params) { 1264 void VideoQualityTest::RunWithAnalyzer(const Params& params) {
1258 params_ = params; 1265 params_ = params;
1259 1266
1260 RTC_CHECK(!params_.audio.enabled); 1267 RTC_CHECK(!params_.audio.enabled);
1261 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to 1268 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to
1262 // differentiate between the analyzer and the renderer case. 1269 // differentiate between the analyzer and the renderer case.
1263 CheckParams(); 1270 CheckParams();
1264 1271
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 std::ostringstream str; 1569 std::ostringstream str;
1563 str << receive_logs_++; 1570 str << receive_logs_++;
1564 std::string path = 1571 std::string path =
1565 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; 1572 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf";
1566 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), 1573 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path),
1567 10000000); 1574 10000000);
1568 } 1575 }
1569 } 1576 }
1570 1577
1571 } // namespace webrtc 1578 } // namespace webrtc
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