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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_quality_test.cc
diff --git a/webrtc/video/video_quality_test.cc b/webrtc/video/video_quality_test.cc
index 07781b19d5c2b45ab58b3651afb4f6dbfaee626e..bd9c4f089cc4f5a2b7199264da9b68d7e6882756 100644
--- a/webrtc/video/video_quality_test.cc
+++ b/webrtc/video/video_quality_test.cc
@@ -1242,6 +1242,12 @@ void VideoQualityTest::CreateCapturer() {
if (params_.video.clip_name.empty()) {
video_capturer_.reset(test::VcmCapturer::Create(
params_.video.width, params_.video.height, params_.video.fps));
+ if (!video_capturer_) {
+ // Failed to get actual camera, use chroma generator as backup.
+ video_capturer_.reset(test::FrameGeneratorCapturer::Create(
+ params_.video.width, params_.video.height, params_.video.fps,
+ clock_));
+ }
} else {
video_capturer_.reset(test::FrameGeneratorCapturer::CreateFromYuvFile(
test::ResourcePath(params_.video.clip_name, "yuv"),
@@ -1252,6 +1258,7 @@ void VideoQualityTest::CreateCapturer() {
<< ".yuv. Is this resource file present?";
}
}
+ RTC_DCHECK(video_capturer_.get());
}
void VideoQualityTest::RunWithAnalyzer(const Params& params) {
« 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