Move TaskQueueFactory from Call::Create parameter to CallConfig
to decouple it from other optional parameters and with plan to make it mandatory Bug: webrtc:10284 Change-Id: I71c1d3d9eaf09d00b99b0bc4c811ab173ea5f01f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/130473 Reviewed-by: Niels Moller <nisse@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/master@{#27385}
This commit is contained in:
committed by
Commit Bot
parent
ffb8c8c147
commit
359fe33163
14
call/call.cc
14
call/call.cc
@ -424,16 +424,20 @@ std::string Call::Stats::ToString(int64_t time_ms) const {
|
||||
}
|
||||
|
||||
Call* Call::Create(const Call::Config& config) {
|
||||
return Create(
|
||||
config, Clock::GetRealTimeClock(), ProcessThread::Create("PacerThread"),
|
||||
ProcessThread::Create("ModuleProcessThread"), &GlobalTaskQueueFactory());
|
||||
return Create(config, Clock::GetRealTimeClock(),
|
||||
ProcessThread::Create("PacerThread"),
|
||||
ProcessThread::Create("ModuleProcessThread"));
|
||||
}
|
||||
|
||||
Call* Call::Create(const Call::Config& config,
|
||||
Clock* clock,
|
||||
std::unique_ptr<ProcessThread> call_thread,
|
||||
std::unique_ptr<ProcessThread> pacer_thread,
|
||||
TaskQueueFactory* task_queue_factory) {
|
||||
std::unique_ptr<ProcessThread> pacer_thread) {
|
||||
// TODO(bugs.webrtc.org/10284): DCHECK task_queue_factory dependency is
|
||||
// always provided in the config.
|
||||
TaskQueueFactory* task_queue_factory = config.task_queue_factory
|
||||
? config.task_queue_factory
|
||||
: &GlobalTaskQueueFactory();
|
||||
return new internal::Call(
|
||||
clock, config,
|
||||
absl::make_unique<RtpTransportControllerSend>(
|
||||
|
||||
@ -16,7 +16,6 @@
|
||||
#include <vector>
|
||||
|
||||
#include "api/media_types.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "call/audio_receive_stream.h"
|
||||
#include "call/audio_send_stream.h"
|
||||
#include "call/call_config.h"
|
||||
@ -54,8 +53,7 @@ class Call {
|
||||
static Call* Create(const Call::Config& config,
|
||||
Clock* clock,
|
||||
std::unique_ptr<ProcessThread> call_thread,
|
||||
std::unique_ptr<ProcessThread> pacer_thread,
|
||||
TaskQueueFactory* task_queue_factory);
|
||||
std::unique_ptr<ProcessThread> pacer_thread);
|
||||
|
||||
virtual AudioSendStream* CreateAudioSendStream(
|
||||
const AudioSendStream::Config& config) = 0;
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
#include "api/bitrate_constraints.h"
|
||||
#include "api/fec_controller.h"
|
||||
#include "api/rtc_error.h"
|
||||
#include "api/task_queue/task_queue_factory.h"
|
||||
#include "api/transport/network_control.h"
|
||||
#include "call/audio_state.h"
|
||||
|
||||
@ -45,6 +46,9 @@ struct CallConfig {
|
||||
// FecController to use for this call.
|
||||
FecControllerFactoryInterface* fec_controller_factory = nullptr;
|
||||
|
||||
// Task Queue Factory to be used in this call.
|
||||
TaskQueueFactory* task_queue_factory = nullptr;
|
||||
|
||||
// Network controller factory to use for this call.
|
||||
NetworkControllerFactoryInterface* network_controller_factory = nullptr;
|
||||
};
|
||||
|
||||
@ -60,12 +60,12 @@ Call* CreateCall(TimeController* time_controller,
|
||||
config.transport.rates.min_rate.bps();
|
||||
call_config.bitrate_config.start_bitrate_bps =
|
||||
config.transport.rates.start_rate.bps();
|
||||
call_config.task_queue_factory = time_controller->GetTaskQueueFactory();
|
||||
call_config.network_controller_factory = network_controller_factory;
|
||||
call_config.audio_state = audio_state;
|
||||
return Call::Create(call_config, time_controller->GetClock(),
|
||||
time_controller->CreateProcessThread("CallModules"),
|
||||
time_controller->CreateProcessThread("Pacer"),
|
||||
time_controller->GetTaskQueueFactory());
|
||||
time_controller->CreateProcessThread("Pacer"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user