From 83b184210f05ae0bb1444489dac8501a13693843 Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Tue, 27 Feb 2018 17:07:11 +0100 Subject: [PATCH] Added namespace to new congestion controller. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes it easier to have the new and the old send side congestion controller side by side. This namespace is only temporary. As soon the new task queue based congestion controller is fully functional, the old will be deprecated and removed together with the temporary namespace. Bug: webrtc:8415 Change-Id: Ie817511345c91cab2ebca68f038075875c7e6529 Reviewed-on: https://webrtc-review.googlesource.com/56720 Commit-Queue: Sebastian Jansson Reviewed-by: Björn Terelius Cr-Commit-Position: refs/heads/master@{#22221} --- .../rtp/acknowledged_bitrate_estimator.cc | 2 ++ .../congestion_controller/rtp/acknowledged_bitrate_estimator.h | 3 +++ .../rtp/acknowledged_bitrate_estimator_unittest.cc | 2 ++ modules/congestion_controller/rtp/alr_detector.cc | 2 ++ modules/congestion_controller/rtp/alr_detector.h | 3 +++ modules/congestion_controller/rtp/alr_detector_unittest.cc | 2 ++ modules/congestion_controller/rtp/bitrate_estimator.cc | 2 ++ modules/congestion_controller/rtp/bitrate_estimator.h | 2 ++ .../rtp/congestion_controller_unittests_helper.cc | 2 ++ .../rtp/congestion_controller_unittests_helper.h | 2 ++ modules/congestion_controller/rtp/delay_based_bwe.cc | 2 ++ modules/congestion_controller/rtp/delay_based_bwe.h | 3 +++ modules/congestion_controller/rtp/delay_based_bwe_unittest.cc | 2 ++ .../rtp/delay_based_bwe_unittest_helper.cc | 2 ++ .../rtp/delay_based_bwe_unittest_helper.h | 2 ++ .../rtp/delay_increase_detector_interface.h | 2 ++ modules/congestion_controller/rtp/goog_cc_network_control.cc | 2 ++ modules/congestion_controller/rtp/goog_cc_network_control.h | 2 ++ .../rtp/include/send_side_congestion_controller.h | 3 +++ modules/congestion_controller/rtp/median_slope_estimator.cc | 2 ++ modules/congestion_controller/rtp/median_slope_estimator.h | 2 ++ .../rtp/median_slope_estimator_unittest.cc | 2 ++ modules/congestion_controller/rtp/pacer_controller.cc | 2 ++ modules/congestion_controller/rtp/pacer_controller.h | 3 +++ modules/congestion_controller/rtp/probe_bitrate_estimator.cc | 2 ++ modules/congestion_controller/rtp/probe_bitrate_estimator.h | 2 ++ .../rtp/probe_bitrate_estimator_unittest.cc | 2 ++ modules/congestion_controller/rtp/probe_controller.cc | 2 ++ modules/congestion_controller/rtp/probe_controller.h | 3 +++ modules/congestion_controller/rtp/probe_controller_unittest.cc | 2 ++ .../rtp/send_side_congestion_controller.cc | 2 ++ .../rtp/send_side_congestion_controller_unittest.cc | 2 ++ modules/congestion_controller/rtp/send_time_history.cc | 2 ++ modules/congestion_controller/rtp/send_time_history.h | 2 ++ .../congestion_controller/rtp/send_time_history_unittest.cc | 2 ++ .../congestion_controller/rtp/transport_feedback_adapter.cc | 2 ++ modules/congestion_controller/rtp/transport_feedback_adapter.h | 2 ++ .../rtp/transport_feedback_adapter_unittest.cc | 2 ++ modules/congestion_controller/rtp/trendline_estimator.cc | 2 ++ modules/congestion_controller/rtp/trendline_estimator.h | 2 ++ .../congestion_controller/rtp/trendline_estimator_unittest.cc | 2 ++ 41 files changed, 88 insertions(+) diff --git a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.cc b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.cc index 8858b6eed6..55cd176a83 100644 --- a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.cc +++ b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.cc @@ -17,6 +17,7 @@ #include "rtc_base/ptr_util.h" namespace webrtc { +namespace webrtc_cc { namespace { bool IsInSendTimeHistory(const PacketFeedback& packet) { @@ -64,4 +65,5 @@ void AcknowledgedBitrateEstimator::MaybeExpectFastRateChange( } } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.h b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.h index 2d57ec82fb..7fbd3ed821 100644 --- a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.h +++ b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator.h @@ -21,6 +21,8 @@ namespace webrtc { struct PacketFeedback; +namespace webrtc_cc { + class AcknowledgedBitrateEstimator { public: explicit AcknowledgedBitrateEstimator( @@ -40,6 +42,7 @@ class AcknowledgedBitrateEstimator { std::unique_ptr bitrate_estimator_; }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_ diff --git a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator_unittest.cc b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator_unittest.cc index c7720a85ca..5c81cf2ac3 100644 --- a/modules/congestion_controller/rtp/acknowledged_bitrate_estimator_unittest.cc +++ b/modules/congestion_controller/rtp/acknowledged_bitrate_estimator_unittest.cc @@ -24,6 +24,7 @@ using testing::InSequence; using testing::Return; namespace webrtc { +namespace webrtc_cc { namespace { @@ -131,4 +132,5 @@ TEST(TestAcknowledgedBitrateEstimator, ReturnBitrate) { EXPECT_EQ(return_value, states.acknowledged_bitrate_estimator->bitrate_bps()); } +} // namespace webrtc_cc } // namespace webrtc*/ diff --git a/modules/congestion_controller/rtp/alr_detector.cc b/modules/congestion_controller/rtp/alr_detector.cc index 2a36d551f3..30d89d1312 100644 --- a/modules/congestion_controller/rtp/alr_detector.cc +++ b/modules/congestion_controller/rtp/alr_detector.cc @@ -25,6 +25,7 @@ #include "system_wrappers/include/field_trial.h" namespace webrtc { +namespace webrtc_cc { AlrDetector::AlrDetector() : AlrDetector(nullptr) {} AlrDetector::AlrDetector(RtcEventLog* event_log) @@ -92,4 +93,5 @@ rtc::Optional AlrDetector::GetApplicationLimitedRegionStartTime() const { return alr_started_time_ms_; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/alr_detector.h b/modules/congestion_controller/rtp/alr_detector.h index dc609280ca..270fb2e77b 100644 --- a/modules/congestion_controller/rtp/alr_detector.h +++ b/modules/congestion_controller/rtp/alr_detector.h @@ -22,6 +22,8 @@ namespace webrtc { class RtcEventLog; +namespace webrtc_cc { + // Application limited region detector is a class that utilizes signals of // elapsed time and bytes sent to estimate whether network traffic is // currently limited by the application's ability to generate traffic. @@ -69,6 +71,7 @@ class AlrDetector { RtcEventLog* event_log_; }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_ALR_DETECTOR_H_ diff --git a/modules/congestion_controller/rtp/alr_detector_unittest.cc b/modules/congestion_controller/rtp/alr_detector_unittest.cc index 82ad4d6252..d5420d3954 100644 --- a/modules/congestion_controller/rtp/alr_detector_unittest.cc +++ b/modules/congestion_controller/rtp/alr_detector_unittest.cc @@ -21,6 +21,7 @@ constexpr int kEstimatedBitrateBps = 300000; } // namespace namespace webrtc { +namespace webrtc_cc { namespace { class SimulateOutgoingTrafficIn { @@ -172,4 +173,5 @@ TEST_F(AlrDetectorTest, ParseActiveFieldTrial) { EXPECT_EQ(1, parsed_params->group_id); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/bitrate_estimator.cc b/modules/congestion_controller/rtp/bitrate_estimator.cc index e682e64fde..2b28ac558d 100644 --- a/modules/congestion_controller/rtp/bitrate_estimator.cc +++ b/modules/congestion_controller/rtp/bitrate_estimator.cc @@ -16,6 +16,7 @@ #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" namespace webrtc { +namespace webrtc_cc { namespace { constexpr int kInitialRateWindowMs = 500; @@ -104,4 +105,5 @@ void BitrateEstimator::ExpectFastRateChange() { bitrate_estimate_var_ += 200; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/bitrate_estimator.h b/modules/congestion_controller/rtp/bitrate_estimator.h index 17ad8772e2..1704d3f93e 100644 --- a/modules/congestion_controller/rtp/bitrate_estimator.h +++ b/modules/congestion_controller/rtp/bitrate_estimator.h @@ -16,6 +16,7 @@ #include "api/optional.h" namespace webrtc { +namespace webrtc_cc { // Computes a bayesian estimate of the throughput given acks containing // the arrival time and payload size. Samples which are far from the current @@ -41,6 +42,7 @@ class BitrateEstimator { float bitrate_estimate_var_; }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_BITRATE_ESTIMATOR_H_ diff --git a/modules/congestion_controller/rtp/congestion_controller_unittests_helper.cc b/modules/congestion_controller/rtp/congestion_controller_unittests_helper.cc index f2b4467dd7..2f52799bb0 100644 --- a/modules/congestion_controller/rtp/congestion_controller_unittests_helper.cc +++ b/modules/congestion_controller/rtp/congestion_controller_unittests_helper.cc @@ -14,6 +14,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { void ComparePacketFeedbackVectors(const std::vector& truth, const std::vector& input) { ASSERT_EQ(truth.size(), input.size()); @@ -39,4 +40,5 @@ void ComparePacketFeedbackVectors(const std::vector& truth, EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info); } } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/congestion_controller_unittests_helper.h b/modules/congestion_controller/rtp/congestion_controller_unittests_helper.h index 98dfb3ddce..9bf28148f1 100644 --- a/modules/congestion_controller/rtp/congestion_controller_unittests_helper.h +++ b/modules/congestion_controller/rtp/congestion_controller_unittests_helper.h @@ -16,8 +16,10 @@ #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h" namespace webrtc { +namespace webrtc_cc { void ComparePacketFeedbackVectors(const std::vector& truth, const std::vector& input); +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_CONGESTION_CONTROLLER_UNITTESTS_HELPER_H_ diff --git a/modules/congestion_controller/rtp/delay_based_bwe.cc b/modules/congestion_controller/rtp/delay_based_bwe.cc index 71567f7be3..d5256288a6 100644 --- a/modules/congestion_controller/rtp/delay_based_bwe.cc +++ b/modules/congestion_controller/rtp/delay_based_bwe.cc @@ -70,6 +70,7 @@ size_t ReadTrendlineFilterWindowSize() { } // namespace namespace webrtc { +namespace webrtc_cc { DelayBasedBwe::Result::Result() : updated(false), @@ -326,4 +327,5 @@ void DelayBasedBwe::SetMinBitrate(int min_bitrate_bps) { int64_t DelayBasedBwe::GetExpectedBwePeriodMs() const { return rate_control_.GetExpectedBandwidthPeriodMs(); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/delay_based_bwe.h b/modules/congestion_controller/rtp/delay_based_bwe.h index 1e8c0685f1..43bc92bfe1 100644 --- a/modules/congestion_controller/rtp/delay_based_bwe.h +++ b/modules/congestion_controller/rtp/delay_based_bwe.h @@ -28,6 +28,8 @@ namespace webrtc { class RtcEventLog; +namespace webrtc_cc { + class DelayBasedBwe { public: static const int64_t kStreamTimeOutMs = 2000; @@ -87,6 +89,7 @@ class DelayBasedBwe { RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(DelayBasedBwe); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_DELAY_BASED_BWE_H_ diff --git a/modules/congestion_controller/rtp/delay_based_bwe_unittest.cc b/modules/congestion_controller/rtp/delay_based_bwe_unittest.cc index b30ad4ccf8..339d8452f3 100644 --- a/modules/congestion_controller/rtp/delay_based_bwe_unittest.cc +++ b/modules/congestion_controller/rtp/delay_based_bwe_unittest.cc @@ -17,6 +17,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace { constexpr int kNumProbesCluster0 = 5; @@ -234,4 +235,5 @@ TEST_F(DelayBasedBweTest, TestInitialOveruse) { EXPECT_NEAR(bitrate_observer_.latest_bitrate(), kStartBitrate / 2, 15000); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.cc b/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.cc index 7128371012..c306e66d6c 100644 --- a/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.cc +++ b/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.cc @@ -18,6 +18,7 @@ #include "rtc_base/ptr_util.h" namespace webrtc { +namespace webrtc_cc { constexpr size_t kMtu = 1200; constexpr uint32_t kAcceptedBitrateErrorBps = 50000; @@ -512,4 +513,5 @@ void DelayBasedBweTest::TestWrappingHelper(int silence_time_s) { bitrate_estimator_->LatestEstimate(&ssrcs, &bitrate_after); EXPECT_LT(bitrate_after, bitrate_before); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.h b/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.h index 19fbb78e88..8658d0292a 100644 --- a/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.h +++ b/modules/congestion_controller/rtp/delay_based_bwe_unittest_helper.h @@ -25,6 +25,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace test { class TestBitrateObserver : public RemoteBitrateObserver { @@ -173,6 +174,7 @@ class DelayBasedBweTest : public ::testing::Test { RTC_DISALLOW_COPY_AND_ASSIGN(DelayBasedBweTest); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_DELAY_BASED_BWE_UNITTEST_HELPER_H_ diff --git a/modules/congestion_controller/rtp/delay_increase_detector_interface.h b/modules/congestion_controller/rtp/delay_increase_detector_interface.h index 4df7148206..d8a3647f9f 100644 --- a/modules/congestion_controller/rtp/delay_increase_detector_interface.h +++ b/modules/congestion_controller/rtp/delay_increase_detector_interface.h @@ -16,6 +16,7 @@ #include "rtc_base/constructormagic.h" namespace webrtc { +namespace webrtc_cc { class DelayIncreaseDetectorInterface { public: @@ -32,6 +33,7 @@ class DelayIncreaseDetectorInterface { RTC_DISALLOW_COPY_AND_ASSIGN(DelayIncreaseDetectorInterface); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_DELAY_INCREASE_DETECTOR_INTERFACE_H_ diff --git a/modules/congestion_controller/rtp/goog_cc_network_control.cc b/modules/congestion_controller/rtp/goog_cc_network_control.cc index 203c3d3246..7627b569fa 100644 --- a/modules/congestion_controller/rtp/goog_cc_network_control.cc +++ b/modules/congestion_controller/rtp/goog_cc_network_control.cc @@ -32,6 +32,7 @@ #include "system_wrappers/include/field_trial.h" namespace webrtc { +namespace webrtc_cc { namespace { const char kCwndExperiment[] = "WebRTC-CwndExperiment"; @@ -422,4 +423,5 @@ void GoogCcNetworkController::UpdatePacingRates(Timestamp at_time) { observer_->OnPacerConfig(msg); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/goog_cc_network_control.h b/modules/congestion_controller/rtp/goog_cc_network_control.h index 80d534f78c..0029474edd 100644 --- a/modules/congestion_controller/rtp/goog_cc_network_control.h +++ b/modules/congestion_controller/rtp/goog_cc_network_control.h @@ -27,6 +27,7 @@ #include "rtc_base/constructormagic.h" namespace webrtc { +namespace webrtc_cc { class GoogCcNetworkController : public NetworkControllerInterface { public: @@ -87,6 +88,7 @@ class GoogCcNetworkController : public NetworkControllerInterface { RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(GoogCcNetworkController); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_GOOG_CC_NETWORK_CONTROL_H_ 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 a941fd2d15..d3a93d574f 100644 --- a/modules/congestion_controller/rtp/include/send_side_congestion_controller.h +++ b/modules/congestion_controller/rtp/include/send_side_congestion_controller.h @@ -42,6 +42,8 @@ class Clock; class RateLimiter; class RtcEventLog; +namespace webrtc_cc { + namespace send_side_cc_internal { // This is used to observe the network controller state and route calls to // the proper handler. It also keeps cached values for safe asynchronous use. @@ -191,6 +193,7 @@ class SendSideCongestionController : public CallStatsObserver, RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideCongestionController); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_INCLUDE_SEND_SIDE_CONGESTION_CONTROLLER_H_ diff --git a/modules/congestion_controller/rtp/median_slope_estimator.cc b/modules/congestion_controller/rtp/median_slope_estimator.cc index 31b429ab9d..2c025cc31d 100644 --- a/modules/congestion_controller/rtp/median_slope_estimator.cc +++ b/modules/congestion_controller/rtp/median_slope_estimator.cc @@ -18,6 +18,7 @@ #include "rtc_base/logging.h" namespace webrtc { +namespace webrtc_cc { constexpr unsigned int kDeltaCounterMax = 1000; @@ -90,4 +91,5 @@ void MedianSlopeEstimator::Update(double recv_delta_ms, BWE_TEST_LOGGING_PLOT(1, "trendline_slope", arrival_time_ms, trendline_); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/median_slope_estimator.h b/modules/congestion_controller/rtp/median_slope_estimator.h index f7f2570dab..3dd3c21c9f 100644 --- a/modules/congestion_controller/rtp/median_slope_estimator.h +++ b/modules/congestion_controller/rtp/median_slope_estimator.h @@ -20,6 +20,7 @@ #include "rtc_base/numerics/percentile_filter.h" namespace webrtc { +namespace webrtc_cc { class MedianSlopeEstimator { public: @@ -67,6 +68,7 @@ class MedianSlopeEstimator { RTC_DISALLOW_COPY_AND_ASSIGN(MedianSlopeEstimator); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_MEDIAN_SLOPE_ESTIMATOR_H_ diff --git a/modules/congestion_controller/rtp/median_slope_estimator_unittest.cc b/modules/congestion_controller/rtp/median_slope_estimator_unittest.cc index 2e243879ae..7e5e90426c 100644 --- a/modules/congestion_controller/rtp/median_slope_estimator_unittest.cc +++ b/modules/congestion_controller/rtp/median_slope_estimator_unittest.cc @@ -13,6 +13,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace { constexpr size_t kWindowSize = 20; @@ -69,4 +70,5 @@ TEST(MedianSlopeEstimator, JitteryLineSlopeZero) { TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/pacer_controller.cc b/modules/congestion_controller/rtp/pacer_controller.cc index 69d47b60ef..2af24feac7 100644 --- a/modules/congestion_controller/rtp/pacer_controller.cc +++ b/modules/congestion_controller/rtp/pacer_controller.cc @@ -15,6 +15,7 @@ #include "rtc_base/logging.h" namespace webrtc { +namespace webrtc_cc { PacerController::PacerController(PacedSender* pacer) : pacer_(pacer) { sequenced_checker_.Detach(); @@ -80,4 +81,5 @@ void PacerController::SetPacerState(bool paused) { pacer_paused_ = paused; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/pacer_controller.h b/modules/congestion_controller/rtp/pacer_controller.h index 68d0bc03e3..eb0e4a00cf 100644 --- a/modules/congestion_controller/rtp/pacer_controller.h +++ b/modules/congestion_controller/rtp/pacer_controller.h @@ -20,6 +20,8 @@ namespace webrtc { class Clock; +namespace webrtc_cc { + // Wrapper class to control pacer using task queues. Note that this class is // only designed to be used from a single task queue and has no built in // concurrency safety. @@ -49,5 +51,6 @@ class PacerController { rtc::SequencedTaskChecker sequenced_checker_; RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(PacerController); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_PACER_CONTROLLER_H_ diff --git a/modules/congestion_controller/rtp/probe_bitrate_estimator.cc b/modules/congestion_controller/rtp/probe_bitrate_estimator.cc index a7bfa41ca7..f091aec6df 100644 --- a/modules/congestion_controller/rtp/probe_bitrate_estimator.cc +++ b/modules/congestion_controller/rtp/probe_bitrate_estimator.cc @@ -53,6 +53,7 @@ constexpr int kMaxProbeIntervalMs = 1000; } // namespace namespace webrtc { +namespace webrtc_cc { ProbeBitrateEstimator::ProbeBitrateEstimator(RtcEventLog* event_log) : event_log_(event_log) {} @@ -186,4 +187,5 @@ void ProbeBitrateEstimator::EraseOldClusters(int64_t timestamp_ms) { } } } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/probe_bitrate_estimator.h b/modules/congestion_controller/rtp/probe_bitrate_estimator.h index 481cac637e..96eca0aa2b 100644 --- a/modules/congestion_controller/rtp/probe_bitrate_estimator.h +++ b/modules/congestion_controller/rtp/probe_bitrate_estimator.h @@ -18,6 +18,7 @@ namespace webrtc { class RtcEventLog; +namespace webrtc_cc { class ProbeBitrateEstimator { public: @@ -50,6 +51,7 @@ class ProbeBitrateEstimator { rtc::Optional estimated_bitrate_bps_; }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_PROBE_BITRATE_ESTIMATOR_H_ diff --git a/modules/congestion_controller/rtp/probe_bitrate_estimator_unittest.cc b/modules/congestion_controller/rtp/probe_bitrate_estimator_unittest.cc index 66645aa134..a45bf822fb 100644 --- a/modules/congestion_controller/rtp/probe_bitrate_estimator_unittest.cc +++ b/modules/congestion_controller/rtp/probe_bitrate_estimator_unittest.cc @@ -18,6 +18,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace { constexpr int kInvalidBitrate = -1; @@ -218,4 +219,5 @@ TEST_F(TestProbeBitrateEstimator, FetchLastEstimatedBitrateBps) { EXPECT_FALSE(probe_bitrate_estimator_.FetchAndResetLastEstimatedBitrateBps()); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/probe_controller.cc b/modules/congestion_controller/rtp/probe_controller.cc index 6bac270829..863524d064 100644 --- a/modules/congestion_controller/rtp/probe_controller.cc +++ b/modules/congestion_controller/rtp/probe_controller.cc @@ -19,6 +19,7 @@ #include "system_wrappers/include/metrics.h" namespace webrtc { +namespace webrtc_cc { namespace { // The minimum number probing packets used. @@ -305,4 +306,5 @@ void ProbeController::InitiateProbing( } } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/probe_controller.h b/modules/congestion_controller/rtp/probe_controller.h index 2becd3025e..f44c06ea2e 100644 --- a/modules/congestion_controller/rtp/probe_controller.h +++ b/modules/congestion_controller/rtp/probe_controller.h @@ -22,6 +22,8 @@ namespace webrtc { class Clock; +namespace webrtc_cc { + // This class controls initiation of probing to estimate initial channel // capacity. There is also support for probing during a session when max // bitrate is adjusted by an application. @@ -92,6 +94,7 @@ class ProbeController { RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(ProbeController); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_PROBE_CONTROLLER_H_ diff --git a/modules/congestion_controller/rtp/probe_controller_unittest.cc b/modules/congestion_controller/rtp/probe_controller_unittest.cc index 4634ea8fae..0193747912 100644 --- a/modules/congestion_controller/rtp/probe_controller_unittest.cc +++ b/modules/congestion_controller/rtp/probe_controller_unittest.cc @@ -26,6 +26,7 @@ using testing::Return; using webrtc::ProbeClusterConfig; namespace webrtc { +namespace webrtc_cc { namespace test { namespace { @@ -289,4 +290,5 @@ TEST_F(ProbeControllerTest, TestExponentialProbingOverflow) { } } // namespace test +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller.cc b/modules/congestion_controller/rtp/send_side_congestion_controller.cc index 7606722efe..b2e7069fe8 100644 --- a/modules/congestion_controller/rtp/send_side_congestion_controller.cc +++ b/modules/congestion_controller/rtp/send_side_congestion_controller.cc @@ -34,6 +34,7 @@ using rtc::MakeUnique; namespace webrtc { +namespace webrtc_cc { namespace { static const int64_t kRetransmitWindowSizeMs = 500; @@ -658,4 +659,5 @@ void SendSideCongestionController::OnReceivedRtcpReceiverReportBlocks( [this, msg]() { controller_->OnTransportLossReport(msg); }); last_report_block_time_ = now; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc b/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc index 896cd76b5d..ea8479fda1 100644 --- a/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc +++ b/modules/congestion_controller/rtp/send_side_congestion_controller_unittest.cc @@ -32,6 +32,7 @@ using testing::SaveArg; using testing::StrictMock; namespace webrtc { +namespace webrtc_cc { namespace test { namespace { @@ -515,4 +516,5 @@ TEST_F(SendSideCongestionControllerTest, PacerQueueEncodeRatePushback) { } } // namespace test +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/send_time_history.cc b/modules/congestion_controller/rtp/send_time_history.cc index 74b9c66a10..b0619a2595 100644 --- a/modules/congestion_controller/rtp/send_time_history.cc +++ b/modules/congestion_controller/rtp/send_time_history.cc @@ -18,6 +18,7 @@ #include "system_wrappers/include/clock.h" namespace webrtc { +namespace webrtc_cc { SendTimeHistory::SendTimeHistory(const Clock* clock, int64_t packet_age_limit_ms) @@ -100,4 +101,5 @@ size_t SendTimeHistory::GetOutstandingBytes(uint16_t local_net_id, return outstanding_bytes; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/send_time_history.h b/modules/congestion_controller/rtp/send_time_history.h index d1a2a65603..96b1271953 100644 --- a/modules/congestion_controller/rtp/send_time_history.h +++ b/modules/congestion_controller/rtp/send_time_history.h @@ -20,6 +20,7 @@ namespace webrtc { class Clock; struct PacketFeedback; +namespace webrtc_cc { class SendTimeHistory { public: @@ -54,5 +55,6 @@ class SendTimeHistory { RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendTimeHistory); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_SEND_TIME_HISTORY_H_ diff --git a/modules/congestion_controller/rtp/send_time_history_unittest.cc b/modules/congestion_controller/rtp/send_time_history_unittest.cc index 3e852ba631..5ad1015ed1 100644 --- a/modules/congestion_controller/rtp/send_time_history_unittest.cc +++ b/modules/congestion_controller/rtp/send_time_history_unittest.cc @@ -19,6 +19,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace test { static const int kDefaultHistoryLengthMs = 1000; @@ -253,4 +254,5 @@ TEST_F(SendTimeHistoryTest, InterlievedGetAndRemove) { EXPECT_EQ(packets[2], packet3); } } // namespace test +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/transport_feedback_adapter.cc b/modules/congestion_controller/rtp/transport_feedback_adapter.cc index 5537c32e8a..d7c7bf9e2a 100644 --- a/modules/congestion_controller/rtp/transport_feedback_adapter.cc +++ b/modules/congestion_controller/rtp/transport_feedback_adapter.cc @@ -19,6 +19,7 @@ #include "rtc_base/numerics/mod_ops.h" namespace webrtc { +namespace webrtc_cc { const int64_t kNoTimestamp = -1; const int64_t kSendTimeHistoryWindowMs = 60000; @@ -188,4 +189,5 @@ size_t TransportFeedbackAdapter::GetOutstandingBytes() const { rtc::CritScope cs(&lock_); return send_time_history_.GetOutstandingBytes(local_net_id_, remote_net_id_); } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/transport_feedback_adapter.h b/modules/congestion_controller/rtp/transport_feedback_adapter.h index abb9abe4d2..67c00f5eac 100644 --- a/modules/congestion_controller/rtp/transport_feedback_adapter.h +++ b/modules/congestion_controller/rtp/transport_feedback_adapter.h @@ -28,6 +28,7 @@ namespace rtcp { class TransportFeedback; } // namespace rtcp +namespace webrtc_cc { class TransportFeedbackAdapter { public: explicit TransportFeedbackAdapter(const Clock* clock); @@ -73,6 +74,7 @@ class TransportFeedbackAdapter { RTC_GUARDED_BY(&observers_lock_); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_TRANSPORT_FEEDBACK_ADAPTER_H_ diff --git a/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc b/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc index f115c8c545..e62fc95275 100644 --- a/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc +++ b/modules/congestion_controller/rtp/transport_feedback_adapter_unittest.cc @@ -27,6 +27,7 @@ using ::testing::_; using ::testing::Invoke; namespace webrtc { +namespace webrtc_cc { namespace { const PacedPacketInfo kPacingInfo0(0, 5, 2000); @@ -388,4 +389,5 @@ TEST_F(TransportFeedbackAdapterTest, TimestampDeltas) { } } } // namespace test +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/trendline_estimator.cc b/modules/congestion_controller/rtp/trendline_estimator.cc index 1d27b2aa42..1c07e5ca2d 100644 --- a/modules/congestion_controller/rtp/trendline_estimator.cc +++ b/modules/congestion_controller/rtp/trendline_estimator.cc @@ -20,6 +20,7 @@ #include "rtc_base/numerics/safe_minmax.h" namespace webrtc { +namespace webrtc_cc { namespace { rtc::Optional LinearFitSlope( @@ -180,4 +181,5 @@ void TrendlineEstimator::UpdateThreshold(double modified_offset, last_update_ms_ = now_ms; } +} // namespace webrtc_cc } // namespace webrtc diff --git a/modules/congestion_controller/rtp/trendline_estimator.h b/modules/congestion_controller/rtp/trendline_estimator.h index 17befadb6c..7628fbc1e5 100644 --- a/modules/congestion_controller/rtp/trendline_estimator.h +++ b/modules/congestion_controller/rtp/trendline_estimator.h @@ -20,6 +20,7 @@ #include "rtc_base/constructormagic.h" namespace webrtc { +namespace webrtc_cc { class TrendlineEstimator : public DelayIncreaseDetectorInterface { public: @@ -87,6 +88,7 @@ class TrendlineEstimator : public DelayIncreaseDetectorInterface { RTC_DISALLOW_COPY_AND_ASSIGN(TrendlineEstimator); }; +} // namespace webrtc_cc } // namespace webrtc #endif // MODULES_CONGESTION_CONTROLLER_RTP_TRENDLINE_ESTIMATOR_H_ diff --git a/modules/congestion_controller/rtp/trendline_estimator_unittest.cc b/modules/congestion_controller/rtp/trendline_estimator_unittest.cc index 6a765caf52..737b7b48de 100644 --- a/modules/congestion_controller/rtp/trendline_estimator_unittest.cc +++ b/modules/congestion_controller/rtp/trendline_estimator_unittest.cc @@ -13,6 +13,7 @@ #include "test/gtest.h" namespace webrtc { +namespace webrtc_cc { namespace { constexpr size_t kWindowSize = 20; @@ -70,4 +71,5 @@ TEST(TrendlineEstimator, JitteryLineSlopeZero) { TestEstimator(0, kAvgTimeBetweenPackets / 3.0, 0.02); } +} // namespace webrtc_cc } // namespace webrtc