diff --git a/test/BUILD.gn b/test/BUILD.gn index 8acc26d6f3..39d99c1ffc 100644 --- a/test/BUILD.gn +++ b/test/BUILD.gn @@ -63,6 +63,8 @@ rtc_source_set("video_test_common") { "..:webrtc_common", "../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 49ce40a440..885ff2c9d1 100644 --- a/test/frame_generator_capturer.cc +++ b/test/frame_generator_capturer.cc @@ -17,6 +17,7 @@ #include #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" @@ -94,6 +95,16 @@ FrameGeneratorCapturer::FrameGeneratorCapturer( Clock* clock, std::unique_ptr frame_generator, int target_fps) + : FrameGeneratorCapturer(clock, + std::move(frame_generator), + target_fps, + GlobalTaskQueueFactory()) {} + +FrameGeneratorCapturer::FrameGeneratorCapturer( + Clock* clock, + std::unique_ptr frame_generator, + int target_fps, + TaskQueueFactory& task_queue_factory) : clock_(clock), sending_(true), sink_wants_observer_(nullptr), @@ -101,7 +112,9 @@ FrameGeneratorCapturer::FrameGeneratorCapturer( source_fps_(target_fps), target_capture_fps_(target_fps), first_frame_capture_time_(-1), - task_queue_("FrameGenCapQ", rtc::TaskQueue::Priority::HIGH) { + task_queue_(task_queue_factory.CreateTaskQueue( + "FrameGenCapQ", + TaskQueueFactory::Priority::HIGH)) { RTC_DCHECK(frame_generator_); RTC_DCHECK_GT(target_fps, 0); } diff --git a/test/frame_generator_capturer.h b/test/frame_generator_capturer.h index 79a6d32076..52fdd8b943 100644 --- a/test/frame_generator_capturer.h +++ b/test/frame_generator_capturer.h @@ -13,6 +13,7 @@ #include #include +#include "api/task_queue/task_queue_factory.h" #include "api/video/video_frame.h" #include "rtc_base/critical_section.h" #include "rtc_base/task_queue.h" @@ -87,6 +88,10 @@ class FrameGeneratorCapturer : public TestVideoCapturer { FrameGeneratorCapturer(Clock* clock, std::unique_ptr frame_generator, int target_fps); + FrameGeneratorCapturer(Clock* clock, + std::unique_ptr frame_generator, + int target_fps, + TaskQueueFactory& task_queue_factory); bool Init(); private: