Remove TemporalLayersFactory and associated classes

As the rate allocation has been moved into entirely into
SimulcastRateAllocator, and the listeners are thus no longer needed,
this class doesn't fill any other purpose than to determine if
ScreenshareLayers or TemporalLayers should be created for a given
simulcast stream. This can however be done just from looking at the
VideoCodec instance, so changing this into a static factory method.

Due to dependencies from upstream projects, keep the class name and
field in VideoCodec around for now.

Bug: webrtc:9012
Change-Id: I028fe6b2a19e0d16b35956cc2df01dcf5bfa7979
Reviewed-on: https://webrtc-review.googlesource.com/63264
Commit-Queue: Erik Språng <sprang@webrtc.org>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22529}
diff --git a/modules/video_coding/video_codec_initializer_unittest.cc b/modules/video_coding/video_codec_initializer_unittest.cc
index 46e2647..4e99fbb 100644
--- a/modules/video_coding/video_codec_initializer_unittest.cc
+++ b/modules/video_coding/video_codec_initializer_unittest.cc
@@ -37,23 +37,6 @@
 static const uint32_t kHighScreenshareTl1Bps = 1200000;
 }  // namespace
 
-/*
- *   static bool SetupCodec(
-      const VideoEncoderConfig& config,
-      const VideoSendStream::Config::EncoderSettings settings,
-      const std::vector<VideoStream>& streams,
-      bool nack_enabled,
-      VideoCodec* codec,
-      std::unique_ptr<VideoBitrateAllocator>* bitrate_allocator);
-
-  // Create a bitrate allocator for the specified codec. |tl_factory| is
-  // optional, if it is populated, ownership of that instance will be
-  // transferred to the VideoBitrateAllocator instance.
-  static std::unique_ptr<VideoBitrateAllocator> CreateBitrateAllocator(
-      const VideoCodec& codec,
-      std::unique_ptr<TemporalLayersFactory> tl_factory);
- */
-
 // TODO(sprang): Extend coverage to handle the rest of the codec initializer.
 class VideoCodecInitializerTest : public ::testing::Test {
  public:
@@ -96,14 +79,12 @@
     }
     if (codec_out_.codecType == VideoCodecType::kVideoCodecMultiplex)
       return true;
+
     // Make sure temporal layers instances have been created.
     if (codec_out_.codecType == VideoCodecType::kVideoCodecVP8) {
-      if (!codec_out_.VP8()->tl_factory)
-        return false;
-
       for (int i = 0; i < codec_out_.numberOfSimulcastStreams; ++i) {
-        temporal_layers_.emplace_back(codec_out_.VP8()->tl_factory->Create(
-            i, *streams_[i].num_temporal_layers, 0));
+        temporal_layers_.emplace_back(
+            TemporalLayers::CreateTemporalLayers(codec_out_, i, 0));
       }
     }
     return true;