diff --git a/call/call.cc b/call/call.cc index 85a9c5c6a7..fc32205514 100644 --- a/call/call.cc +++ b/call/call.cc @@ -164,7 +164,8 @@ class Call final : public webrtc::Call, public TargetTransferRateObserver, public BitrateAllocator::LimitObserver { public: - Call(const Call::Config& config, + Call(Clock* clock, + const Call::Config& config, std::unique_ptr transport_send, std::unique_ptr module_process_thread, TaskQueueFactory* task_queue_factory); @@ -415,21 +416,21 @@ std::string Call::Stats::ToString(int64_t time_ms) const { } Call* Call::Create(const Call::Config& config) { - return Create(config, ProcessThread::Create("PacerThread"), - ProcessThread::Create("ModuleProcessThread"), - &GlobalTaskQueueFactory()); + return Create( + config, Clock::GetRealTimeClock(), ProcessThread::Create("PacerThread"), + ProcessThread::Create("ModuleProcessThread"), &GlobalTaskQueueFactory()); } Call* Call::Create(const Call::Config& config, + Clock* clock, std::unique_ptr call_thread, std::unique_ptr pacer_thread, TaskQueueFactory* task_queue_factory) { return new internal::Call( - config, + clock, config, absl::make_unique( - Clock::GetRealTimeClock(), config.event_log, - config.network_controller_factory, config.bitrate_config, - std::move(pacer_thread), task_queue_factory), + clock, config.event_log, config.network_controller_factory, + config.bitrate_config, std::move(pacer_thread), task_queue_factory), std::move(call_thread), task_queue_factory); } @@ -445,11 +446,12 @@ VideoSendStream* Call::CreateVideoSendStream( namespace internal { -Call::Call(const Call::Config& config, +Call::Call(Clock* clock, + const Call::Config& config, std::unique_ptr transport_send, std::unique_ptr module_process_thread, TaskQueueFactory* task_queue_factory) - : clock_(Clock::GetRealTimeClock()), + : clock_(clock), task_queue_factory_(task_queue_factory), num_cpu_cores_(CpuInfo::DetectNumberOfCores()), module_process_thread_(std::move(module_process_thread)), diff --git a/call/call.h b/call/call.h index 055591a0ff..3eceb492a8 100644 --- a/call/call.h +++ b/call/call.h @@ -52,6 +52,7 @@ class Call { static Call* Create(const Call::Config& config); static Call* Create(const Call::Config& config, + Clock* clock, std::unique_ptr call_thread, std::unique_ptr pacer_thread, TaskQueueFactory* task_queue_factory);