OLD | NEW |
---|---|
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 Loading... | |
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?"; |
ilnik
2017/01/23 15:55:42
Please check that we always get some capturer.
sprang_webrtc
2017/01/23 15:57:52
Done.
| |
1253 } | 1259 } |
1254 } | 1260 } |
1255 } | 1261 } |
1256 | 1262 |
1257 void VideoQualityTest::RunWithAnalyzer(const Params& params) { | 1263 void VideoQualityTest::RunWithAnalyzer(const Params& params) { |
1258 params_ = params; | 1264 params_ = params; |
1259 | 1265 |
1260 RTC_CHECK(!params_.audio.enabled); | 1266 RTC_CHECK(!params_.audio.enabled); |
1261 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to | 1267 // TODO(ivica): Merge with RunWithRenderer and use a flag / argument to |
1262 // differentiate between the analyzer and the renderer case. | 1268 // differentiate between the analyzer and the renderer case. |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1562 std::ostringstream str; | 1568 std::ostringstream str; |
1563 str << receive_logs_++; | 1569 str << receive_logs_++; |
1564 std::string path = | 1570 std::string path = |
1565 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; | 1571 params_.video.encoded_frame_base_path + "." + str.str() + ".recv.ivf"; |
1566 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), | 1572 stream->EnableEncodedFrameRecording(rtc::CreatePlatformFile(path), |
1567 10000000); | 1573 10000000); |
1568 } | 1574 } |
1569 } | 1575 } |
1570 | 1576 |
1571 } // namespace webrtc | 1577 } // namespace webrtc |
OLD | NEW |