What can't loopback test be more like full stack test? It can; this CL makes it a lot closer, if not all the way to a merge. Performance from video_loopback and screenshare_loopback should now match what we're seeing in FullStackTest, which will make debugging and assesment of quality differences much easier. It also adds the ability to view all of the simulcast streams at once, in separate windows. BUG=webrtc:7694 Review-Url: https://codereview.webrtc.org/2946893003 Cr-Commit-Position: refs/heads/master@{#18703}
diff --git a/webrtc/video/screenshare_loopback.cc b/webrtc/video/screenshare_loopback.cc index 46f662a..c0638c9 100644 --- a/webrtc/video/screenshare_loopback.cc +++ b/webrtc/video/screenshare_loopback.cc
@@ -127,7 +127,15 @@ return static_cast<int>(FLAG_std_propagation_delay_ms); } -DEFINE_int(selected_stream, 0, "ID of the stream to show or analyze."); +DEFINE_int(num_streams, 0, "Number of streams to show or analyze."); +int NumStreams() { + return static_cast<int>(FLAG_num_streams); +} + +DEFINE_int(selected_stream, + 0, + "ID of the stream to show or analyze. " + "Set to the number of streams to show them all."); int SelectedStream() { return static_cast<int>(FLAG_selected_stream); } @@ -268,6 +276,11 @@ params.pipe = pipe_config; params.logs = flags::FLAG_logs; + if (flags::NumStreams() > 1 && flags::Stream0().empty() && + flags::Stream1().empty()) { + params.ss.infer_streams = true; + } + std::vector<std::string> stream_descriptors; stream_descriptors.push_back(flags::Stream0()); stream_descriptors.push_back(flags::Stream1()); @@ -275,7 +288,7 @@ SL_descriptors.push_back(flags::SL0()); SL_descriptors.push_back(flags::SL1()); VideoQualityTest::FillScalabilitySettings( - ¶ms, stream_descriptors, flags::SelectedStream(), + ¶ms, stream_descriptors, flags::NumStreams(), flags::SelectedStream(), flags::NumSpatialLayers(), flags::SelectedSL(), SL_descriptors); VideoQualityTest test; @@ -295,8 +308,10 @@ return 0; } - webrtc::test::InitFieldTrialsFromString( - webrtc::flags::FLAG_force_fieldtrials); + // InitFieldTrialsFromString needs a reference to an std::string instance, + // with a scope that outlives the test. + std::string field_trials = webrtc::flags::FLAG_force_fieldtrials; + webrtc::test::InitFieldTrialsFromString(field_trials); webrtc::test::RunTest(webrtc::Loopback); return 0; }