Added namespace to new congestion controller.

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 <srte@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22221}
This commit is contained in:
Sebastian Jansson 2018-02-27 17:07:11 +01:00 committed by Commit Bot
parent e5d8c5778b
commit 83b184210f
41 changed files with 88 additions and 0 deletions

View File

@ -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

View File

@ -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<BitrateEstimator> bitrate_estimator_;
};
} // namespace webrtc_cc
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_RTP_ACKNOWLEDGED_BITRATE_ESTIMATOR_H_

View File

@ -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*/

View File

@ -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<int64_t> AlrDetector::GetApplicationLimitedRegionStartTime()
const {
return alr_started_time_ms_;
}
} // namespace webrtc_cc
} // namespace webrtc

View File

@ -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_

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -14,6 +14,7 @@
#include "test/gtest.h"
namespace webrtc {
namespace webrtc_cc {
void ComparePacketFeedbackVectors(const std::vector<PacketFeedback>& truth,
const std::vector<PacketFeedback>& input) {
ASSERT_EQ(truth.size(), input.size());
@ -39,4 +40,5 @@ void ComparePacketFeedbackVectors(const std::vector<PacketFeedback>& truth,
EXPECT_EQ(truth[i].pacing_info, input[i].pacing_info);
}
}
} // namespace webrtc_cc
} // namespace webrtc

View File

@ -16,8 +16,10 @@
#include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
namespace webrtc {
namespace webrtc_cc {
void ComparePacketFeedbackVectors(const std::vector<PacketFeedback>& truth,
const std::vector<PacketFeedback>& input);
} // namespace webrtc_cc
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_RTP_CONGESTION_CONTROLLER_UNITTESTS_HELPER_H_

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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_

View File

@ -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

View File

@ -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_

View File

@ -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_

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -18,6 +18,7 @@
namespace webrtc {
class RtcEventLog;
namespace webrtc_cc {
class ProbeBitrateEstimator {
public:
@ -50,6 +51,7 @@ class ProbeBitrateEstimator {
rtc::Optional<int> estimated_bitrate_bps_;
};
} // namespace webrtc_cc
} // namespace webrtc
#endif // MODULES_CONGESTION_CONTROLLER_RTP_PROBE_BITRATE_ESTIMATOR_H_

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -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

View File

@ -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_

View File

@ -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

View File

@ -20,6 +20,7 @@
#include "rtc_base/numerics/safe_minmax.h"
namespace webrtc {
namespace webrtc_cc {
namespace {
rtc::Optional<double> LinearFitSlope(
@ -180,4 +181,5 @@ void TrendlineEstimator::UpdateThreshold(double modified_offset,
last_update_ms_ = now_ms;
}
} // namespace webrtc_cc
} // namespace webrtc

View File

@ -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_

View File

@ -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