| Index: webrtc/video/screenshare_loopback.cc
|
| diff --git a/webrtc/video/screenshare_loopback.cc b/webrtc/video/screenshare_loopback.cc
|
| index 46f662a45d4a87f0417fe85d845b25ffe24634e8..c0638c9b1aae0099189a6a5f72bed59919786b04 100644
|
| --- a/webrtc/video/screenshare_loopback.cc
|
| +++ b/webrtc/video/screenshare_loopback.cc
|
| @@ -127,7 +127,15 @@ int StdPropagationDelayMs() {
|
| 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 @@ void Loopback() {
|
| 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 @@ void Loopback() {
|
| 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 @@ int main(int argc, char* argv[]) {
|
| 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;
|
| }
|
|
|