From c6c44268bcb5ac98424837e549883d29eed10d0a Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Wed, 9 May 2018 10:33:39 +0200 Subject: [PATCH] Moves network control interface to API. This prepares for allowing injection of a network controller. Bug: webrtc:9155 Change-Id: I5624f47738db9c5cd4750eac76cb6289e06a7aa3 Reviewed-on: https://webrtc-review.googlesource.com/73100 Reviewed-by: Karl Wiberg Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#23188} --- api/transport/BUILD.gn | 34 ++++++++++++ .../transport}/network_control.h | 11 ++-- .../transport}/network_types.cc | 18 ++++++- .../include => api/transport}/network_types.h | 25 +++++++-- .../transport}/test/mock_network_control.h | 8 +-- .../transport}/test/network_control_tester.cc | 4 +- .../transport}/test/network_control_tester.h | 8 +-- call/BUILD.gn | 4 +- call/call.cc | 4 +- modules/BUILD.gn | 1 + modules/congestion_controller/BUILD.gn | 1 - modules/congestion_controller/bbr/BUILD.gn | 6 +-- .../congestion_controller/bbr/bbr_factory.h | 2 +- .../bbr/bbr_network_controller.h | 4 +- .../bbr/bbr_network_controller_unittest.cc | 2 +- .../congestion_controller/goog_cc/BUILD.gn | 6 +-- .../goog_cc/goog_cc_network_control.h | 2 +- .../goog_cc/include/goog_cc_factory.h | 2 +- .../goog_cc/probe_controller.h | 3 +- .../goog_cc/probe_controller_unittest.cc | 2 +- .../network_control/BUILD.gn | 54 ------------------- modules/congestion_controller/rtp/BUILD.gn | 4 +- .../include/send_side_congestion_controller.h | 4 +- .../rtp/pacer_controller.h | 2 +- .../rtp/send_side_congestion_controller.cc | 2 +- modules/include/module_common_types.h | 25 +-------- 26 files changed, 114 insertions(+), 124 deletions(-) rename {modules/congestion_controller/network_control/include => api/transport}/network_control.h (92%) rename {modules/congestion_controller/network_control => api/transport}/network_types.cc (75%) rename {modules/congestion_controller/network_control/include => api/transport}/network_types.h (89%) rename {modules/congestion_controller/network_control => api/transport}/test/mock_network_control.h (66%) rename {modules/congestion_controller/network_control => api/transport}/test/network_control_tester.cc (97%) rename {modules/congestion_controller/network_control => api/transport}/test/network_control_tester.h (89%) delete mode 100644 modules/congestion_controller/network_control/BUILD.gn diff --git a/api/transport/BUILD.gn b/api/transport/BUILD.gn index 4d29d75049..bd5dcac2fd 100644 --- a/api/transport/BUILD.gn +++ b/api/transport/BUILD.gn @@ -18,3 +18,37 @@ rtc_source_set("bitrate_settings") { "..:optional", ] } + +rtc_static_library("network_control") { + sources = [ + "network_control.h", + "network_types.cc", + "network_types.h", + ] + + deps = [ + "..:optional", + "../units:data_rate", + "../units:data_size", + "../units:time_delta", + "../units:timestamp", + ] +} + +if (rtc_include_tests) { + rtc_source_set("network_control_test") { + testonly = true + sources = [ + "test/mock_network_control.h", + "test/network_control_tester.cc", + "test/network_control_tester.h", + ] + deps = [ + ":network_control", + "../:optional", + "../../rtc_base:checks", + "../../rtc_base:rtc_base_approved", + "../../test:test_support", + ] + } +} diff --git a/modules/congestion_controller/network_control/include/network_control.h b/api/transport/network_control.h similarity index 92% rename from modules/congestion_controller/network_control/include/network_control.h rename to api/transport/network_control.h index 8a54706ced..abd945d897 100644 --- a/modules/congestion_controller/network_control/include/network_control.h +++ b/api/transport/network_control.h @@ -8,12 +8,12 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_CONTROL_H_ -#define MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_CONTROL_H_ +#ifndef API_TRANSPORT_NETWORK_CONTROL_H_ +#define API_TRANSPORT_NETWORK_CONTROL_H_ #include #include -#include "modules/congestion_controller/network_control/include/network_types.h" +#include "api/transport/network_types.h" namespace webrtc { @@ -78,6 +78,8 @@ class NetworkControllerInterface { // controller. class NetworkControllerFactoryInterface { public: + virtual ~NetworkControllerFactoryInterface() = default; + // Used to create a new network controller, requires an observer to be // provided to handle callbacks. virtual std::unique_ptr Create( @@ -85,8 +87,7 @@ class NetworkControllerFactoryInterface { // Returns the interval by which the network controller expects // OnProcessInterval calls. virtual TimeDelta GetProcessInterval() const = 0; - virtual ~NetworkControllerFactoryInterface() = default; }; } // namespace webrtc -#endif // MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_CONTROL_H_ +#endif // API_TRANSPORT_NETWORK_CONTROL_H_ diff --git a/modules/congestion_controller/network_control/network_types.cc b/api/transport/network_types.cc similarity index 75% rename from modules/congestion_controller/network_control/network_types.cc rename to api/transport/network_types.cc index f354bf321e..b4c09d47c0 100644 --- a/modules/congestion_controller/network_control/network_types.cc +++ b/api/transport/network_types.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/congestion_controller/network_control/include/network_types.h" +#include "api/transport/network_types.h" namespace webrtc { @@ -65,4 +65,20 @@ NetworkControlUpdate::NetworkControlUpdate(const NetworkControlUpdate&) = default; NetworkControlUpdate::~NetworkControlUpdate() = default; +PacedPacketInfo::PacedPacketInfo() = default; + +PacedPacketInfo::PacedPacketInfo(int probe_cluster_id, + int probe_cluster_min_probes, + int probe_cluster_min_bytes) + : probe_cluster_id(probe_cluster_id), + probe_cluster_min_probes(probe_cluster_min_probes), + probe_cluster_min_bytes(probe_cluster_min_bytes) {} + +bool PacedPacketInfo::operator==(const PacedPacketInfo& rhs) const { + return send_bitrate_bps == rhs.send_bitrate_bps && + probe_cluster_id == rhs.probe_cluster_id && + probe_cluster_min_probes == rhs.probe_cluster_min_probes && + probe_cluster_min_bytes == rhs.probe_cluster_min_bytes; +} + } // namespace webrtc diff --git a/modules/congestion_controller/network_control/include/network_types.h b/api/transport/network_types.h similarity index 89% rename from modules/congestion_controller/network_control/include/network_types.h rename to api/transport/network_types.h index 8a1a16c557..a4d46380bc 100644 --- a/modules/congestion_controller/network_control/include/network_types.h +++ b/api/transport/network_types.h @@ -8,17 +8,16 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_TYPES_H_ -#define MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_TYPES_H_ +#ifndef API_TRANSPORT_NETWORK_TYPES_H_ +#define API_TRANSPORT_NETWORK_TYPES_H_ #include #include +#include "api/optional.h" #include "api/units/data_rate.h" #include "api/units/data_size.h" #include "api/units/time_delta.h" #include "api/units/timestamp.h" -#include "modules/include/module_common_types.h" -#include "rtc_base/constructormagic.h" namespace webrtc { @@ -66,6 +65,22 @@ struct NetworkRouteChange { rtc::Optional starting_rate; }; +struct PacedPacketInfo { + PacedPacketInfo(); + PacedPacketInfo(int probe_cluster_id, + int probe_cluster_min_probes, + int probe_cluster_min_bytes); + + bool operator==(const PacedPacketInfo& rhs) const; + + // TODO(srte): Move probing info to a separate, optional struct. + static constexpr int kNotAProbe = -1; + int send_bitrate_bps = -1; + int probe_cluster_id = kNotAProbe; + int probe_cluster_min_probes = -1; + int probe_cluster_min_bytes = -1; +}; + struct SentPacket { Timestamp send_time = Timestamp::Infinity(); DataSize size = DataSize::Zero(); @@ -176,4 +191,4 @@ struct ProcessInterval { }; } // namespace webrtc -#endif // MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_INCLUDE_NETWORK_TYPES_H_ +#endif // API_TRANSPORT_NETWORK_TYPES_H_ diff --git a/modules/congestion_controller/network_control/test/mock_network_control.h b/api/transport/test/mock_network_control.h similarity index 66% rename from modules/congestion_controller/network_control/test/mock_network_control.h rename to api/transport/test/mock_network_control.h index dddcdd1193..df83791e18 100644 --- a/modules/congestion_controller/network_control/test/mock_network_control.h +++ b/api/transport/test/mock_network_control.h @@ -8,10 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_MOCK_NETWORK_CONTROL_H_ -#define MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_MOCK_NETWORK_CONTROL_H_ +#ifndef API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ +#define API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/include/network_control.h" #include "test/gmock.h" namespace webrtc { @@ -23,4 +23,4 @@ class MockTargetTransferRateObserver : public TargetTransferRateObserver { } // namespace test } // namespace webrtc -#endif // MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_MOCK_NETWORK_CONTROL_H_ +#endif // API_TRANSPORT_TEST_MOCK_NETWORK_CONTROL_H_ diff --git a/modules/congestion_controller/network_control/test/network_control_tester.cc b/api/transport/test/network_control_tester.cc similarity index 97% rename from modules/congestion_controller/network_control/test/network_control_tester.cc rename to api/transport/test/network_control_tester.cc index 29b6211808..a34292ea43 100644 --- a/modules/congestion_controller/network_control/test/network_control_tester.cc +++ b/api/transport/test/network_control_tester.cc @@ -8,11 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "modules/congestion_controller/network_control/test/network_control_tester.h" +#include "api/transport/test/network_control_tester.h" #include -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/network_control.h" #include "rtc_base/logging.h" namespace webrtc { diff --git a/modules/congestion_controller/network_control/test/network_control_tester.h b/api/transport/test/network_control_tester.h similarity index 89% rename from modules/congestion_controller/network_control/test/network_control_tester.h rename to api/transport/test/network_control_tester.h index f91f016bfd..43c6503a69 100644 --- a/modules/congestion_controller/network_control/test/network_control_tester.h +++ b/api/transport/test/network_control_tester.h @@ -8,15 +8,15 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_NETWORK_CONTROL_TESTER_H_ -#define MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_NETWORK_CONTROL_TESTER_H_ +#ifndef API_TRANSPORT_TEST_NETWORK_CONTROL_TESTER_H_ +#define API_TRANSPORT_TEST_NETWORK_CONTROL_TESTER_H_ #include #include #include #include "api/optional.h" -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/network_control.h" namespace webrtc { namespace test { @@ -73,4 +73,4 @@ class NetworkControllerTester { } // namespace test } // namespace webrtc -#endif // MODULES_CONGESTION_CONTROLLER_NETWORK_CONTROL_TEST_NETWORK_CONTROL_TESTER_H_ +#endif // API_TRANSPORT_TEST_NETWORK_CONTROL_TESTER_H_ diff --git a/call/BUILD.gn b/call/BUILD.gn index 5be4636439..19ee903ff3 100644 --- a/call/BUILD.gn +++ b/call/BUILD.gn @@ -103,8 +103,8 @@ rtc_source_set("rtp_sender") { ":bitrate_configurator", ":rtp_interfaces", "..:webrtc_common", + "../api/transport:network_control", "../modules/congestion_controller", - "../modules/congestion_controller/network_control", "../modules/congestion_controller/rtp:congestion_controller", "../modules/pacing", "../modules/utility", @@ -178,6 +178,7 @@ rtc_static_library("call") { "../api:callfactory_api", "../api:optional", "../api:transport_api", + "../api/transport:network_control", "../audio", "../logging:rtc_event_audio", "../logging:rtc_event_log_api", @@ -186,7 +187,6 @@ rtc_static_library("call") { "../logging:rtc_stream_config", "../modules/bitrate_controller", "../modules/congestion_controller", - "../modules/congestion_controller/network_control", "../modules/pacing", "../modules/rtp_rtcp", "../modules/rtp_rtcp:rtp_rtcp_format", diff --git a/call/call.cc b/call/call.cc index aadc27e123..3635bf2c7a 100644 --- a/call/call.cc +++ b/call/call.cc @@ -17,6 +17,7 @@ #include #include "api/optional.h" +#include "api/transport/network_control.h" #include "audio/audio_receive_stream.h" #include "audio/audio_send_stream.h" #include "audio/audio_state.h" @@ -37,7 +38,6 @@ #include "logging/rtc_event_log/rtc_stream_config.h" #include "modules/bitrate_controller/include/bitrate_controller.h" #include "modules/congestion_controller/include/receive_side_congestion_controller.h" -#include "modules/congestion_controller/network_control/include/network_control.h" #include "modules/rtp_rtcp/include/flexfec_receiver.h" #include "modules/rtp_rtcp/include/rtp_header_extension_map.h" #include "modules/rtp_rtcp/include/rtp_header_parser.h" @@ -54,8 +54,8 @@ #include "rtc_base/ptr_util.h" #include "rtc_base/rate_limiter.h" #include "rtc_base/sequenced_task_checker.h" -#include "rtc_base/synchronization/rw_lock_wrapper.h" #include "rtc_base/strings/string_builder.h" +#include "rtc_base/synchronization/rw_lock_wrapper.h" #include "rtc_base/task_queue.h" #include "rtc_base/thread_annotations.h" #include "rtc_base/trace_event.h" diff --git a/modules/BUILD.gn b/modules/BUILD.gn index 39a609a2ff..0182584c3c 100644 --- a/modules/BUILD.gn +++ b/modules/BUILD.gn @@ -56,6 +56,7 @@ rtc_source_set("module_api") { "../api:optional", "../api:video_frame_api", "../api:video_frame_api_i420", + "../api/transport:network_control", "../rtc_base:deprecation", "../rtc_base:rtc_base_approved", "video_coding:codec_globals_headers", diff --git a/modules/congestion_controller/BUILD.gn b/modules/congestion_controller/BUILD.gn index 3028e1870d..d5da37cef3 100644 --- a/modules/congestion_controller/BUILD.gn +++ b/modules/congestion_controller/BUILD.gn @@ -185,7 +185,6 @@ if (rtc_include_tests) { "../rtp_rtcp:rtp_rtcp_format", "bbr:bbr_unittests", "goog_cc:goog_cc_unittests", - "network_control:network_control_unittests", "rtp:congestion_controller_unittests", ] if (!build_with_chromium && is_clang) { diff --git a/modules/congestion_controller/bbr/BUILD.gn b/modules/congestion_controller/bbr/BUILD.gn index 3abebaa36f..c8ff076a7a 100644 --- a/modules/congestion_controller/bbr/BUILD.gn +++ b/modules/congestion_controller/bbr/BUILD.gn @@ -15,8 +15,8 @@ rtc_static_library("bbr") { ] deps = [ ":bbr_controller", + "../../../api/transport:network_control", "../../../rtc_base:rtc_base_approved", - "../network_control", ] } @@ -31,11 +31,11 @@ rtc_source_set("bbr_controller") { ":rtt_stats", ":windowed_filter", "../../../api:optional", + "../../../api/transport:network_control", "../../../rtc_base:checks", "../../../rtc_base:rtc_base_approved", "../../../rtc_base/experiments:congestion_controller_experiment", "../../../rtc_base/system:fallthrough", - "../network_control", ] } rtc_source_set("data_transfer_tracker") { @@ -85,10 +85,10 @@ if (rtc_include_tests) { ":data_transfer_tracker", ":rtt_stats", ":windowed_filter", + "../../../api/transport:network_control_test", "../../../api/units:data_rate", "../../../api/units:time_delta", "../../../test:test_support", - "../network_control:network_control_test", ] if (!build_with_chromium && is_clang) { # Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163). diff --git a/modules/congestion_controller/bbr/bbr_factory.h b/modules/congestion_controller/bbr/bbr_factory.h index d740d69817..ad539c81c4 100644 --- a/modules/congestion_controller/bbr/bbr_factory.h +++ b/modules/congestion_controller/bbr/bbr_factory.h @@ -13,7 +13,7 @@ #include -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/network_control.h" namespace webrtc { diff --git a/modules/congestion_controller/bbr/bbr_network_controller.h b/modules/congestion_controller/bbr/bbr_network_controller.h index 5b96961c58..34d76bbf30 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller.h +++ b/modules/congestion_controller/bbr/bbr_network_controller.h @@ -18,11 +18,11 @@ #include #include +#include "api/transport/network_control.h" +#include "api/transport/network_types.h" #include "modules/congestion_controller/bbr/data_transfer_tracker.h" #include "modules/congestion_controller/bbr/rtt_stats.h" #include "modules/congestion_controller/bbr/windowed_filter.h" -#include "modules/congestion_controller/network_control/include/network_control.h" -#include "modules/congestion_controller/network_control/include/network_types.h" #include "api/optional.h" #include "rtc_base/random.h" diff --git a/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc b/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc index 4ee63b6b27..68bc8ceff4 100644 --- a/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc +++ b/modules/congestion_controller/bbr/bbr_network_controller_unittest.cc @@ -11,9 +11,9 @@ #include #include +#include "api/transport/test/network_control_tester.h" #include "modules/congestion_controller/bbr/bbr_factory.h" #include "modules/congestion_controller/bbr/bbr_network_controller.h" -#include "modules/congestion_controller/network_control/test/network_control_tester.h" #include "test/gmock.h" #include "test/gtest.h" diff --git a/modules/congestion_controller/goog_cc/BUILD.gn b/modules/congestion_controller/goog_cc/BUILD.gn index 858a880cae..789770ab87 100644 --- a/modules/congestion_controller/goog_cc/BUILD.gn +++ b/modules/congestion_controller/goog_cc/BUILD.gn @@ -44,6 +44,7 @@ rtc_static_library("goog_cc") { "../../..:webrtc_common", "../../../:typedefs", "../../../api:optional", + "../../../api/transport:network_control", "../../../logging:rtc_event_log_api", "../../../logging:rtc_event_pacing", "../../../rtc_base:checks", @@ -56,7 +57,6 @@ rtc_static_library("goog_cc") { "../../pacing", "../../remote_bitrate_estimator", "../../rtp_rtcp:rtp_rtcp_format", - "../network_control", ] } @@ -144,6 +144,8 @@ if (rtc_include_tests) { ":delay_based_bwe", ":estimators", ":goog_cc", + "../../../api/transport:network_control", + "../../../api/transport:network_control_test", "../../../rtc_base:checks", "../../../rtc_base:rtc_base_approved", "../../../rtc_base:rtc_base_tests_utils", @@ -154,8 +156,6 @@ if (rtc_include_tests) { "../../pacing", "../../remote_bitrate_estimator", "../../rtp_rtcp:rtp_rtcp_format", - "../network_control", - "../network_control:network_control_test", "//testing/gmock", ] if (!build_with_chromium && is_clang) { diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.h b/modules/congestion_controller/goog_cc/goog_cc_network_control.h index 498edc359b..f7039f0a17 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control.h +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.h @@ -17,13 +17,13 @@ #include #include "api/optional.h" +#include "api/transport/network_control.h" #include "logging/rtc_event_log/rtc_event_log.h" #include "modules/bitrate_controller/send_side_bandwidth_estimation.h" #include "modules/congestion_controller/goog_cc/acknowledged_bitrate_estimator.h" #include "modules/congestion_controller/goog_cc/alr_detector.h" #include "modules/congestion_controller/goog_cc/delay_based_bwe.h" #include "modules/congestion_controller/goog_cc/probe_controller.h" -#include "modules/congestion_controller/network_control/include/network_control.h" #include "rtc_base/constructormagic.h" namespace webrtc { diff --git a/modules/congestion_controller/goog_cc/include/goog_cc_factory.h b/modules/congestion_controller/goog_cc/include/goog_cc_factory.h index 29555a1afd..f4eea11366 100644 --- a/modules/congestion_controller/goog_cc/include/goog_cc_factory.h +++ b/modules/congestion_controller/goog_cc/include/goog_cc_factory.h @@ -12,7 +12,7 @@ #define MODULES_CONGESTION_CONTROLLER_GOOG_CC_INCLUDE_GOOG_CC_FACTORY_H_ #include -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/network_control.h" namespace webrtc { class Clock; diff --git a/modules/congestion_controller/goog_cc/probe_controller.h b/modules/congestion_controller/goog_cc/probe_controller.h index baa37367a1..163ccb2c19 100644 --- a/modules/congestion_controller/goog_cc/probe_controller.h +++ b/modules/congestion_controller/goog_cc/probe_controller.h @@ -17,7 +17,8 @@ #include #include "api/optional.h" -#include "modules/congestion_controller/network_control/include/network_control.h" +#include "api/transport/network_control.h" +#include "rtc_base/constructormagic.h" namespace webrtc { diff --git a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc index 470c2b8a44..4a61e67236 100644 --- a/modules/congestion_controller/goog_cc/probe_controller_unittest.cc +++ b/modules/congestion_controller/goog_cc/probe_controller_unittest.cc @@ -9,8 +9,8 @@ */ #include +#include "api/transport/network_types.h" #include "modules/congestion_controller/goog_cc/probe_controller.h" -#include "modules/congestion_controller/network_control/include/network_types.h" #include "rtc_base/logging.h" #include "system_wrappers/include/clock.h" #include "test/gmock.h" diff --git a/modules/congestion_controller/network_control/BUILD.gn b/modules/congestion_controller/network_control/BUILD.gn deleted file mode 100644 index 190d6624a4..0000000000 --- a/modules/congestion_controller/network_control/BUILD.gn +++ /dev/null @@ -1,54 +0,0 @@ -# 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. - -import("../../../webrtc.gni") - -rtc_static_library("network_control") { - sources = [ - "include/network_control.h", - "include/network_types.h", - "network_types.cc", - ] - - deps = [ - "../../:module_api", - "../../../api:optional", - "../../../api/units:data_rate", - "../../../api/units:data_size", - "../../../api/units:time_delta", - "../../../api/units:timestamp", - "../../../rtc_base:checks", - "../../../rtc_base:rtc_base_approved", - ] -} - -if (rtc_include_tests) { - rtc_source_set("network_control_test") { - testonly = true - sources = [ - "test/mock_network_control.h", - "test/network_control_tester.cc", - "test/network_control_tester.h", - ] - deps = [ - ":network_control", - "../../../api:optional", - "../../../rtc_base:checks", - "../../../rtc_base:rtc_base_approved", - "../../../test:test_support", - ] - } - rtc_source_set("network_control_unittests") { - testonly = true - sources = [] - deps = [ - ":network_control", - "../../../test:test_support", - ] - } -} diff --git a/modules/congestion_controller/rtp/BUILD.gn b/modules/congestion_controller/rtp/BUILD.gn index bae6053382..02c324505a 100644 --- a/modules/congestion_controller/rtp/BUILD.gn +++ b/modules/congestion_controller/rtp/BUILD.gn @@ -39,6 +39,7 @@ rtc_static_library("congestion_controller") { "../:congestion_controller", "../..:module_api", "../../..:webrtc_common", + "../../../api/transport:network_control", "../../../rtc_base:checks", "../../../rtc_base:rate_limiter", "../../../rtc_base:rtc_task_queue_api", @@ -54,7 +55,6 @@ rtc_static_library("congestion_controller") { "../../rtp_rtcp:rtp_rtcp_format", "../bbr", "../goog_cc", - "../network_control", ] if (!build_with_mozilla) { @@ -96,6 +96,7 @@ if (rtc_include_tests) { ":transport_feedback", "../:congestion_controller", "../:mock_congestion_controller", + "../../../api/transport:network_control", "../../../logging:mocks", "../../../rtc_base:checks", "../../../rtc_base:rtc_base", @@ -109,7 +110,6 @@ if (rtc_include_tests) { "../../pacing:pacing", "../../remote_bitrate_estimator:remote_bitrate_estimator", "../../rtp_rtcp:rtp_rtcp_format", - "../network_control", "//testing/gmock", ] if (!build_with_chromium && is_clang) { diff --git a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h index 90447e6860..a273bbe78d 100644 --- a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h +++ b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h @@ -17,10 +17,10 @@ #include #include +#include "api/transport/network_control.h" +#include "api/transport/network_types.h" #include "common_types.h" // NOLINT(build/include) #include "modules/congestion_controller/include/send_side_congestion_controller_interface.h" -#include "modules/congestion_controller/network_control/include/network_control.h" -#include "modules/congestion_controller/network_control/include/network_types.h" #include "modules/congestion_controller/rtp/pacer_controller.h" #include "modules/congestion_controller/rtp/transport_feedback_adapter.h" #include "modules/include/module.h" diff --git a/modules/congestion_controller/rtp/pacer_controller.h b/modules/congestion_controller/rtp/pacer_controller.h index 278fa613dc..27760c43c2 100644 --- a/modules/congestion_controller/rtp/pacer_controller.h +++ b/modules/congestion_controller/rtp/pacer_controller.h @@ -13,7 +13,7 @@ #include -#include "modules/congestion_controller/network_control/include/network_types.h" +#include "api/transport/network_types.h" #include "modules/pacing/paced_sender.h" #include "rtc_base/sequenced_task_checker.h" diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc index a55beae93f..6d3f30152e 100644 --- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc +++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc @@ -14,9 +14,9 @@ #include #include #include +#include "api/transport/network_types.h" #include "modules/congestion_controller/bbr/bbr_factory.h" #include "modules/congestion_controller/goog_cc/include/goog_cc_factory.h" -#include "modules/congestion_controller/network_control/include/network_types.h" #include "modules/remote_bitrate_estimator/include/bwe_defines.h" #include "rtc_base/bind.h" #include "rtc_base/checks.h" diff --git a/modules/include/module_common_types.h b/modules/include/module_common_types.h index 1c174a7261..b03ca296a7 100644 --- a/modules/include/module_common_types.h +++ b/modules/include/module_common_types.h @@ -19,6 +19,7 @@ #include "api/optional.h" #include "api/rtp_headers.h" +#include "api/transport/network_types.h" #include "api/video/video_rotation.h" #include "common_types.h" // NOLINT(build/include) #include "modules/include/module_common_types_public.h" @@ -272,30 +273,6 @@ class CallStatsObserver { virtual ~CallStatsObserver() {} }; - -struct PacedPacketInfo { - PacedPacketInfo() {} - PacedPacketInfo(int probe_cluster_id, - int probe_cluster_min_probes, - int probe_cluster_min_bytes) - : probe_cluster_id(probe_cluster_id), - probe_cluster_min_probes(probe_cluster_min_probes), - probe_cluster_min_bytes(probe_cluster_min_bytes) {} - - bool operator==(const PacedPacketInfo& rhs) const { - return send_bitrate_bps == rhs.send_bitrate_bps && - probe_cluster_id == rhs.probe_cluster_id && - probe_cluster_min_probes == rhs.probe_cluster_min_probes && - probe_cluster_min_bytes == rhs.probe_cluster_min_bytes; - } - - static constexpr int kNotAProbe = -1; - int send_bitrate_bps = -1; - int probe_cluster_id = kNotAProbe; - int probe_cluster_min_probes = -1; - int probe_cluster_min_bytes = -1; -}; - } // namespace webrtc #endif // MODULES_INCLUDE_MODULE_COMMON_TYPES_H_