Removes unused factories and constructor from FrameGeneratorCapturer.

to remove dependency on GlobalTaskQueueFactory

Bug: webrtc:10284
Change-Id: I9a7e4431cd62df20bec706b0ffcc677bd3c7d311
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133903
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27718}
diff --git a/test/BUILD.gn b/test/BUILD.gn
index b384865..a44dd1d 100644
--- a/test/BUILD.gn
+++ b/test/BUILD.gn
@@ -55,7 +55,6 @@
     "../api:libjingle_peerconnection_api",
     "../api:scoped_refptr",
     "../api/task_queue",
-    "../api/task_queue:global_task_queue_factory",
     "../api/video:video_frame",
     "../api/video:video_frame_i010",
     "../api/video:video_frame_i420",
diff --git a/test/frame_generator_capturer.cc b/test/frame_generator_capturer.cc
index 5419d93..30fa9a5 100644
--- a/test/frame_generator_capturer.cc
+++ b/test/frame_generator_capturer.cc
@@ -16,8 +16,6 @@
 #include <utility>
 #include <vector>
 
-#include "absl/memory/memory.h"
-#include "api/task_queue/global_task_queue_factory.h"
 #include "rtc_base/checks.h"
 #include "rtc_base/critical_section.h"
 #include "rtc_base/logging.h"
@@ -29,77 +27,6 @@
 namespace webrtc {
 namespace test {
 
-FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
-    int width,
-    int height,
-    absl::optional<FrameGenerator::OutputType> type,
-    absl::optional<int> num_squares,
-    int target_fps,
-    Clock* clock) {
-  auto capturer = absl::make_unique<FrameGeneratorCapturer>(
-      clock,
-      FrameGenerator::CreateSquareGenerator(width, height, type, num_squares),
-      target_fps);
-  if (!capturer->Init())
-    return nullptr;
-
-  return capturer.release();
-}
-
-FrameGeneratorCapturer* FrameGeneratorCapturer::CreateFromYuvFile(
-    const std::string& file_name,
-    size_t width,
-    size_t height,
-    int target_fps,
-    Clock* clock) {
-  auto capturer = absl::make_unique<FrameGeneratorCapturer>(
-      clock,
-      FrameGenerator::CreateFromYuvFile(std::vector<std::string>(1, file_name),
-                                        width, height, 1),
-      target_fps);
-  if (!capturer->Init())
-    return nullptr;
-
-  return capturer.release();
-}
-
-FrameGeneratorCapturer* FrameGeneratorCapturer::CreateSlideGenerator(
-    int width,
-    int height,
-    int frame_repeat_count,
-    int target_fps,
-    Clock* clock) {
-  auto capturer = absl::make_unique<FrameGeneratorCapturer>(
-      clock,
-      FrameGenerator::CreateSlideGenerator(width, height, frame_repeat_count),
-      target_fps);
-  if (!capturer->Init())
-    return nullptr;
-
-  return capturer.release();
-}
-
-FrameGeneratorCapturer* FrameGeneratorCapturer::Create(
-    std::unique_ptr<FrameGenerator> frame_generator,
-    int target_fps,
-    Clock* clock) {
-  auto capturer = absl::make_unique<FrameGeneratorCapturer>(
-      clock, std::move(frame_generator), target_fps);
-  if (!capturer->Init())
-    return nullptr;
-
-  return capturer.release();
-}
-
-FrameGeneratorCapturer::FrameGeneratorCapturer(
-    Clock* clock,
-    std::unique_ptr<FrameGenerator> frame_generator,
-    int target_fps)
-    : FrameGeneratorCapturer(clock,
-                             std::move(frame_generator),
-                             target_fps,
-                             GlobalTaskQueueFactory()) {}
-
 FrameGeneratorCapturer::FrameGeneratorCapturer(
     Clock* clock,
     std::unique_ptr<FrameGenerator> frame_generator,
diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h
index 52fdd8b..d6faf7c 100644
--- a/test/frame_generator_capturer.h
+++ b/test/frame_generator_capturer.h
@@ -39,33 +39,10 @@
     virtual ~SinkWantsObserver() {}
   };
 
-  // |type| has the default value OutputType::I420. |num_squares| has the
-  // default value 10.
-  static FrameGeneratorCapturer* Create(
-      int width,
-      int height,
-      absl::optional<FrameGenerator::OutputType> type,
-      absl::optional<int> num_squares,
-      int target_fps,
-      Clock* clock);
-
-  static FrameGeneratorCapturer* CreateFromYuvFile(const std::string& file_name,
-                                                   size_t width,
-                                                   size_t height,
-                                                   int target_fps,
-                                                   Clock* clock);
-
-  static FrameGeneratorCapturer* CreateSlideGenerator(int width,
-                                                      int height,
-                                                      int frame_repeat_count,
-                                                      int target_fps,
-                                                      Clock* clock);
-
-  static FrameGeneratorCapturer* Create(
-      std::unique_ptr<FrameGenerator> frame_generator,
-      int target_fps,
-      Clock* clock);
-
+  FrameGeneratorCapturer(Clock* clock,
+                         std::unique_ptr<FrameGenerator> frame_generator,
+                         int target_fps,
+                         TaskQueueFactory& task_queue_factory);
   virtual ~FrameGeneratorCapturer();
 
   void Start();
@@ -85,13 +62,6 @@
 
   int64_t first_frame_capture_time() const { return first_frame_capture_time_; }
 
-  FrameGeneratorCapturer(Clock* clock,
-                         std::unique_ptr<FrameGenerator> frame_generator,
-                         int target_fps);
-  FrameGeneratorCapturer(Clock* clock,
-                         std::unique_ptr<FrameGenerator> frame_generator,
-                         int target_fps,
-                         TaskQueueFactory& task_queue_factory);
   bool Init();
 
  private: