Revert of Adding support for simulcast and spatial layers into VideoQualityTest (patchset #10 id:180001 of https://codereview.webrtc.org/1353263005/ )

Reason for revert:
Temporarily reverting as this causes some issues with perf tests. Especially tests with packet loss no longer works.

Original issue's description:
> Adding support for simulcast and spatial layers into VideoQualityTest
>
> The CL includes several changes:
> - Adding flags describing the streams and spatial layers.
> - Reorganizing the order of the flags, to make them easier to maintain.
> - Adding a member .params_ to VideoQualityAnalyzer.
>     (instead of passing it to every member function manually)
> - Updating VideoAnalyzer to support simulcast.
>     (select appropriate ssrc and fix timestamps which are sometimes increased by 1)
> - VP9EncoderImpl already had code for automatic calculation of bitrate for each layer.
>     Changing to first read bitrates and resolution ratios from the flags, if specified.
>     If not specified, reverting to the old code are setting the values automatically.
> - Changing the parameters in LayerFilteringTransport, replacing
>     xx_discard_thresholds with selected_xx, to make it easier to use for the end user.
>
> Committed: https://crrev.com/87f83a9a27d657731ccb54025bc04ccad0da136e
> Cr-Commit-Position: refs/heads/master@{#10215}

TBR=pbos@webrtc.org,mflodman@webrtc.org,ivica@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.webrtc.org/1397363002

Cr-Commit-Position: refs/heads/master@{#10252}
diff --git a/webrtc/video/screenshare_loopback.cc b/webrtc/video/screenshare_loopback.cc
index 277052c..9897783 100644
--- a/webrtc/video/screenshare_loopback.cc
+++ b/webrtc/video/screenshare_loopback.cc
@@ -20,7 +20,6 @@
 namespace webrtc {
 namespace flags {
 
-// Flags common with video loopback, with different default values.
 DEFINE_int32(width, 1850, "Video width (crops source).");
 size_t Width() {
   return static_cast<size_t>(FLAGS_width);
@@ -36,6 +35,21 @@
   return static_cast<int>(FLAGS_fps);
 }
 
+DEFINE_int32(slide_change_interval,
+             10,
+             "Interval (in seconds) between simulated slide changes.");
+int SlideChangeInterval() {
+  return static_cast<int>(FLAGS_slide_change_interval);
+}
+
+DEFINE_int32(
+    scroll_duration,
+    0,
+    "Duration (in seconds) during which a slide will be scrolled into place.");
+int ScrollDuration() {
+  return static_cast<int>(FLAGS_scroll_duration);
+}
+
 DEFINE_int32(min_bitrate, 50, "Call and stream min bitrate in kbps.");
 int MinBitrateKbps() {
   return static_cast<int>(FLAGS_min_bitrate);
@@ -57,40 +71,26 @@
 }
 
 DEFINE_int32(num_temporal_layers, 2, "Number of temporal layers to use.");
-int NumTemporalLayers() {
-  return static_cast<int>(FLAGS_num_temporal_layers);
-}
-
-// Flags common with video loopback, with equal default values.
-DEFINE_string(codec, "VP8", "Video codec to use.");
-std::string Codec() {
-  return static_cast<std::string>(FLAGS_codec);
-}
-
-DEFINE_int32(selected_tl,
-             -1,
-             "Temporal layer to show or analyze. -1 to disable filtering.");
-int SelectedTL() {
-  return static_cast<int>(FLAGS_selected_tl);
+size_t NumTemporalLayers() {
+  return static_cast<size_t>(FLAGS_num_temporal_layers);
 }
 
 DEFINE_int32(
-    duration,
+    tl_discard_threshold,
     0,
-    "Duration of the test in seconds. If 0, rendered will be shown instead.");
-int DurationSecs() {
-  return static_cast<int>(FLAGS_duration);
+    "Discard TLs with id greater or equal the threshold. 0 to disable.");
+size_t TLDiscardThreshold() {
+  return static_cast<size_t>(FLAGS_tl_discard_threshold);
 }
 
-DEFINE_string(output_filename, "", "Target graph data filename.");
-std::string OutputFilename() {
-  return static_cast<std::string>(FLAGS_output_filename);
+DEFINE_int32(min_transmit_bitrate, 400, "Min transmit bitrate incl. padding.");
+int MinTransmitBitrateKbps() {
+  return FLAGS_min_transmit_bitrate;
 }
 
-DEFINE_string(
-    graph_title, "", "If empty, title will be generated automatically.");
-std::string GraphTitle() {
-  return static_cast<std::string>(FLAGS_graph_title);
+DEFINE_string(codec, "VP8", "Video codec to use.");
+std::string Codec() {
+  return static_cast<std::string>(FLAGS_codec);
 }
 
 DEFINE_int32(loss_percent, 0, "Percentage of packets randomly lost.");
@@ -124,51 +124,21 @@
   return static_cast<int>(FLAGS_std_propagation_delay_ms);
 }
 
-DEFINE_int32(selected_stream, 0, "ID of the stream to show or analyze.");
-int SelectedStream() {
-  return static_cast<int>(FLAGS_selected_stream);
-}
-
-DEFINE_int32(num_spatial_layers, 1, "Number of spatial layers to use.");
-int NumSpatialLayers() {
-  return static_cast<int>(FLAGS_num_spatial_layers);
-}
-
-DEFINE_int32(selected_sl,
-             -1,
-             "Spatial layer to show or analyze. -1 to disable filtering.");
-int SelectedSL() {
-  return static_cast<int>(FLAGS_selected_sl);
-}
-
-DEFINE_string(stream0,
-              "",
-              "Comma separated values describing VideoStream for stream #0.");
-std::string Stream0() {
-  return static_cast<std::string>(FLAGS_stream0);
-}
-
-DEFINE_string(stream1,
-              "",
-              "Comma separated values describing VideoStream for stream #1.");
-std::string Stream1() {
-  return static_cast<std::string>(FLAGS_stream1);
-}
-
-DEFINE_string(
-    sl0, "", "Comma separated values describing SpatialLayer for layer #0.");
-std::string SL0() {
-  return static_cast<std::string>(FLAGS_sl0);
-}
-
-DEFINE_string(
-    sl1, "", "Comma separated values describing SpatialLayer for layer #1.");
-std::string SL1() {
-  return static_cast<std::string>(FLAGS_sl1);
-}
-
 DEFINE_bool(logs, false, "print logs to stderr");
 
+DEFINE_string(
+    output_filename,
+    "",
+    "Name of a target graph data file. If set, no preview will be shown.");
+std::string OutputFilename() {
+  return static_cast<std::string>(FLAGS_output_filename);
+}
+
+DEFINE_int32(duration, 60, "Duration of the test in seconds.");
+int DurationSecs() {
+  return static_cast<int>(FLAGS_duration);
+}
+
 DEFINE_bool(send_side_bwe, true, "Use send-side bandwidth estimation");
 
 DEFINE_string(
@@ -178,28 +148,6 @@
     "E.g. running with --force_fieldtrials=WebRTC-FooFeature/Enable/"
     " will assign the group Enable to field trial WebRTC-FooFeature. Multiple "
     "trials are separated by \"/\"");
-
-// Screenshare-specific flags.
-DEFINE_int32(min_transmit_bitrate, 400, "Min transmit bitrate incl. padding.");
-int MinTransmitBitrateKbps() {
-  return FLAGS_min_transmit_bitrate;
-}
-
-DEFINE_int32(slide_change_interval,
-             10,
-             "Interval (in seconds) between simulated slide changes.");
-int SlideChangeInterval() {
-  return static_cast<int>(FLAGS_slide_change_interval);
-}
-
-DEFINE_int32(
-    scroll_duration,
-    0,
-    "Duration (in seconds) during which a slide will be scrolled into place.");
-int ScrollDuration() {
-  return static_cast<int>(FLAGS_scroll_duration);
-}
-
 }  // namespace flags
 
 void Loopback() {
@@ -219,31 +167,20 @@
       {flags::Width(), flags::Height(), flags::Fps(),
        flags::MinBitrateKbps() * 1000, flags::TargetBitrateKbps() * 1000,
        flags::MaxBitrateKbps() * 1000, flags::Codec(),
-       flags::NumTemporalLayers(), flags::SelectedTL(),
-       flags::MinTransmitBitrateKbps() * 1000, call_bitrate_config,
+       flags::NumTemporalLayers(), flags::MinTransmitBitrateKbps() * 1000,
+       call_bitrate_config, flags::TLDiscardThreshold(),
        flags::FLAGS_send_side_bwe},
       {},  // Video specific.
       {true, flags::SlideChangeInterval(), flags::ScrollDuration()},
-      {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename(),
-       flags::GraphTitle()},
+      {"screenshare", 0.0, 0.0, flags::DurationSecs(), flags::OutputFilename()},
       pipe_config,
       flags::FLAGS_logs};
 
-  std::vector<std::string> stream_descriptors;
-  stream_descriptors.push_back(flags::Stream0());
-  stream_descriptors.push_back(flags::Stream1());
-  std::vector<std::string> SL_descriptors;
-  SL_descriptors.push_back(flags::SL0());
-  SL_descriptors.push_back(flags::SL1());
-  VideoQualityTest::FillScalabilitySettings(&params, stream_descriptors,
-      flags::SelectedStream(), flags::NumSpatialLayers(), flags::SelectedSL(),
-      SL_descriptors);
-
   VideoQualityTest test;
-  if (flags::DurationSecs())
-    test.RunWithAnalyzer(params);
-  else
+  if (flags::OutputFilename().empty())
     test.RunWithVideoRenderer(params);
+  else
+    test.RunWithAnalyzer(params);
 }
 }  // namespace webrtc