Deprecating injection of event log into GoogCC factory.

Bug: webrtc:9883
Change-Id: I6087b4a0a2c934e6a9ab435fffaf2eb1fc2a29e4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/134644
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27824}
This commit is contained in:
Sebastian Jansson 2019-04-30 14:17:45 +02:00 committed by Commit Bot
parent d9c2d94620
commit 2db5fc00c0
5 changed files with 10 additions and 5 deletions

View file

@ -29,7 +29,9 @@ struct GoogCcFactoryConfig {
class GoogCcNetworkControllerFactory
: public NetworkControllerFactoryInterface {
public:
explicit GoogCcNetworkControllerFactory(RtcEventLog* event_log);
GoogCcNetworkControllerFactory() = default;
explicit RTC_DEPRECATED GoogCcNetworkControllerFactory(
RtcEventLog* event_log);
explicit GoogCcNetworkControllerFactory(
NetworkStatePredictorFactoryInterface* network_state_predictor_factory);

View file

@ -112,7 +112,7 @@ void UpdatesTargetRateBasedOnLinkCapacity(std::string test_name = "") {
class GoogCcNetworkControllerTest : public ::testing::Test {
protected:
GoogCcNetworkControllerTest()
: current_time_(Timestamp::ms(123456)), factory_(&event_log_) {}
: current_time_(Timestamp::ms(123456)), factory_() {}
~GoogCcNetworkControllerTest() override {}
void SetUp() override {
@ -144,6 +144,7 @@ class GoogCcNetworkControllerTest : public ::testing::Test {
config.constraints.min_data_rate = DataRate::kbps(min_data_rate_kbps);
config.constraints.max_data_rate = DataRate::kbps(max_data_rate_kbps);
config.constraints.starting_rate = DataRate::kbps(starting_bandwidth_kbps);
config.event_log = &event_log_;
return config;
}
ProcessInterval DefaultInterval() {

View file

@ -1166,9 +1166,8 @@ void EventLogAnalyzer::CreateGoogCcSimulationGraph(Plot* plot) {
TimeSeries probe_results("Logged probe success", LineStyle::kNone,
PointStyle::kHighlight);
RtcEventLogNullImpl null_event_log;
LogBasedNetworkControllerSimulation simulation(
absl::make_unique<GoogCcNetworkControllerFactory>(&null_event_log),
absl::make_unique<GoogCcNetworkControllerFactory>(),
[&](const NetworkControlUpdate& update, Timestamp at_time) {
if (update.target_rate) {
target_rates.points.emplace_back(
@ -1222,13 +1221,14 @@ void EventLogAnalyzer::CreateSendSideBweSimulationGraph(Plot* plot) {
PacketRouter packet_router;
PacedSender pacer(&clock, &packet_router, &null_event_log);
TransportFeedbackAdapter transport_feedback;
auto factory = GoogCcNetworkControllerFactory(&null_event_log);
auto factory = GoogCcNetworkControllerFactory();
TimeDelta process_interval = factory.GetProcessInterval();
// TODO(holmer): Log the call config and use that here instead.
static const uint32_t kDefaultStartBitrateBps = 300000;
NetworkControllerConfig cc_config;
cc_config.constraints.at_time = Timestamp::us(clock.TimeInMicroseconds());
cc_config.constraints.starting_rate = DataRate::bps(kDefaultStartBitrateBps);
cc_config.event_log = &null_event_log;
auto goog_cc = factory.Create(cc_config);
TimeSeries time_series("Delay-based estimate", LineStyle::kStep,

View file

@ -35,6 +35,7 @@ void LogBasedNetworkControllerSimulation::ProcessUntil(Timestamp to_time) {
config.constraints.at_time = to_time;
config.constraints.min_data_rate = DataRate::kbps(30);
config.constraints.starting_rate = DataRate::kbps(300);
config.event_log = &null_event_log_;
controller_ = factory_->Create(config);
}
if (last_process_.IsInfinite() ||

View file

@ -45,6 +45,7 @@ class LogBasedNetworkControllerSimulation {
void OnFeedback(const LoggedRtcpPacketTransportFeedback& feedback);
void OnReceiverReport(const LoggedRtcpPacketReceiverReport& report);
void OnIceConfig(const LoggedIceCandidatePairConfig& candidate);
RtcEventLogNullImpl null_event_log_;
const std::function<void(const NetworkControlUpdate&, Timestamp)>
update_handler_;