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.cc b/modules/video_coding/video_codec_initializer.cc
index f7e12c8..e473a16 100644
--- a/modules/video_coding/video_codec_initializer.cc
+++ b/modules/video_coding/video_codec_initializer.cc
@@ -48,47 +48,19 @@
   *codec =
       VideoEncoderConfigToVideoCodec(config, streams, settings.payload_name,
                                      settings.payload_type, nack_enabled);
-
-  std::unique_ptr<TemporalLayersFactory> tl_factory;
-  switch (codec->codecType) {
-    case kVideoCodecVP8: {
-      if (!codec->VP8()->tl_factory) {
-        if (codec->mode == kScreensharing &&
-            (codec->numberOfSimulcastStreams > 1 ||
-             (codec->numberOfSimulcastStreams == 1 &&
-              codec->VP8()->numberOfTemporalLayers == 2))) {
-          // Conference mode temporal layering for screen content.
-          tl_factory.reset(new ScreenshareTemporalLayersFactory());
-        } else {
-          // Standard video temporal layers.
-          tl_factory.reset(new TemporalLayersFactory());
-        }
-        codec->VP8()->tl_factory = tl_factory.get();
-      }
-      break;
-    }
-    default: {
-      // TODO(sprang): Warn, once we have specific allocators for all supported
-      //               codec types.
-      break;
-    }
-  }
-  *bitrate_allocator = CreateBitrateAllocator(*codec, std::move(tl_factory));
+  *bitrate_allocator = CreateBitrateAllocator(*codec);
 
   return true;
 }
 
 std::unique_ptr<VideoBitrateAllocator>
-VideoCodecInitializer::CreateBitrateAllocator(
-    const VideoCodec& codec,
-    std::unique_ptr<TemporalLayersFactory> tl_factory) {
+VideoCodecInitializer::CreateBitrateAllocator(const VideoCodec& codec) {
   std::unique_ptr<VideoBitrateAllocator> rate_allocator;
 
   switch (codec.codecType) {
     case kVideoCodecVP8: {
       // Set up default VP8 temporal layer factory, if not provided.
-      rate_allocator.reset(
-          new SimulcastRateAllocator(codec, std::move(tl_factory)));
+      rate_allocator.reset(new SimulcastRateAllocator(codec));
     } break;
     default:
       rate_allocator.reset(new DefaultVideoBitrateAllocator(codec));