mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-12 21:30:45 +01:00

Bug: None Change-Id: I31a3672300487329e1bb93b6fa1cb1d9aeffcb4b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/347600 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Cr-Commit-Position: refs/heads/main@{#42077}
50 lines
1.7 KiB
C++
50 lines
1.7 KiB
C++
/*
|
|
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "api/transport/goog_cc_factory.h"
|
|
|
|
#include <memory>
|
|
#include <utility>
|
|
|
|
#include "api/units/time_delta.h"
|
|
#include "modules/congestion_controller/goog_cc/goog_cc_network_control.h"
|
|
#include "rtc_base/checks.h"
|
|
|
|
namespace webrtc {
|
|
|
|
GoogCcNetworkControllerFactory::GoogCcNetworkControllerFactory(
|
|
GoogCcFactoryConfig config)
|
|
: factory_config_(std::move(config)) {}
|
|
|
|
std::unique_ptr<NetworkControllerInterface>
|
|
GoogCcNetworkControllerFactory::Create(NetworkControllerConfig config) {
|
|
GoogCcConfig goog_cc_config;
|
|
goog_cc_config.feedback_only = factory_config_.feedback_only;
|
|
if (factory_config_.network_state_estimator_factory) {
|
|
RTC_DCHECK(config.key_value_config);
|
|
goog_cc_config.network_state_estimator =
|
|
factory_config_.network_state_estimator_factory->Create(
|
|
config.key_value_config);
|
|
}
|
|
if (factory_config_.network_state_predictor_factory) {
|
|
goog_cc_config.network_state_predictor =
|
|
factory_config_.network_state_predictor_factory
|
|
->CreateNetworkStatePredictor();
|
|
}
|
|
return std::make_unique<GoogCcNetworkController>(config,
|
|
std::move(goog_cc_config));
|
|
}
|
|
|
|
TimeDelta GoogCcNetworkControllerFactory::GetProcessInterval() const {
|
|
const int64_t kUpdateIntervalMs = 25;
|
|
return TimeDelta::Millis(kUpdateIntervalMs);
|
|
}
|
|
|
|
} // namespace webrtc
|