diff --git a/webrtc/audio/DEPS b/webrtc/audio/DEPS index 5e43c34821..66f66f4ee4 100644 --- a/webrtc/audio/DEPS +++ b/webrtc/audio/DEPS @@ -3,6 +3,7 @@ include_rules = [ "+webrtc/voice_engine", "+webrtc/modules/audio_coding/codecs/mock", "+webrtc/call", + "+webrtc/logging/rtc_event_log", "+webrtc/modules/bitrate_controller", "+webrtc/modules/congestion_controller", "+webrtc/modules/pacing", @@ -11,12 +12,3 @@ include_rules = [ "+webrtc/system_wrappers", "+webrtc/voice_engine", ] - -specific_include_rules = { - "audio_receive_stream_unittest\.cc": [ - "+webrtc/call/mock", - ], - "audio_send_stream_unittest\.cc": [ - "+webrtc/call/mock", - ], -} diff --git a/webrtc/audio/audio_receive_stream_unittest.cc b/webrtc/audio/audio_receive_stream_unittest.cc index d30eb110ce..b11d04bb46 100644 --- a/webrtc/audio/audio_receive_stream_unittest.cc +++ b/webrtc/audio/audio_receive_stream_unittest.cc @@ -13,7 +13,7 @@ #include "webrtc/audio/audio_receive_stream.h" #include "webrtc/audio/conversion.h" -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/audio_coding/codecs/mock/mock_audio_decoder_factory.h" #include "webrtc/modules/bitrate_controller/include/mock/mock_bitrate_controller.h" #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h" diff --git a/webrtc/audio/audio_send_stream_unittest.cc b/webrtc/audio/audio_send_stream_unittest.cc index e6356c0ed0..a2832ded00 100644 --- a/webrtc/audio/audio_send_stream_unittest.cc +++ b/webrtc/audio/audio_send_stream_unittest.cc @@ -15,7 +15,7 @@ #include "webrtc/audio/audio_state.h" #include "webrtc/audio/conversion.h" #include "webrtc/base/task_queue.h" -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h" #include "webrtc/modules/pacing/paced_sender.h" diff --git a/webrtc/call/mock/mock_rtc_event_log.h b/webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h similarity index 90% rename from webrtc/call/mock/mock_rtc_event_log.h rename to webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h index 637389f3d8..315967b8c0 100644 --- a/webrtc/call/mock/mock_rtc_event_log.h +++ b/webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h @@ -8,8 +8,8 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef WEBRTC_CALL_MOCK_MOCK_RTC_EVENT_LOG_H_ -#define WEBRTC_CALL_MOCK_MOCK_RTC_EVENT_LOG_H_ +#ifndef WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ +#define WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ #include @@ -62,4 +62,4 @@ class MockRtcEventLog : public RtcEventLog { } // namespace webrtc -#endif // WEBRTC_CALL_MOCK_MOCK_RTC_EVENT_LOG_H_ +#endif // WEBRTC_LOGGING_RTC_EVENT_LOG_MOCK_MOCK_RTC_EVENT_LOG_H_ diff --git a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc index 0e080eedf4..56bb41e27d 100644 --- a/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc +++ b/webrtc/modules/bitrate_controller/bitrate_controller_unittest.cc @@ -11,7 +11,7 @@ #include #include -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/pacing/mock/mock_paced_sender.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" diff --git a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc index da618c7c49..7841f5fb40 100644 --- a/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc +++ b/webrtc/modules/bitrate_controller/send_side_bandwidth_estimation_unittest.cc @@ -11,7 +11,7 @@ #include #include -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/bitrate_controller/send_side_bandwidth_estimation.h" #include "webrtc/test/gtest.h" diff --git a/webrtc/modules/congestion_controller/DEPS b/webrtc/modules/congestion_controller/DEPS index 675f103fb9..30984edc96 100644 --- a/webrtc/modules/congestion_controller/DEPS +++ b/webrtc/modules/congestion_controller/DEPS @@ -1,6 +1,6 @@ include_rules = [ "+webrtc/base", - "+webrtc/call/mock", + "+webrtc/logging/rtc_event_log", "+webrtc/system_wrappers", "+webrtc/video", ] diff --git a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc index e840294d9f..91508df265 100644 --- a/webrtc/modules/congestion_controller/congestion_controller_unittest.cc +++ b/webrtc/modules/congestion_controller/congestion_controller_unittest.cc @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/bitrate_controller/include/bitrate_controller.h" #include "webrtc/modules/congestion_controller/include/congestion_controller.h" #include "webrtc/modules/congestion_controller/include/mock/mock_congestion_controller.h" diff --git a/webrtc/modules/remote_bitrate_estimator/DEPS b/webrtc/modules/remote_bitrate_estimator/DEPS index fc31fa7038..d061d5761a 100644 --- a/webrtc/modules/remote_bitrate_estimator/DEPS +++ b/webrtc/modules/remote_bitrate_estimator/DEPS @@ -1,5 +1,6 @@ include_rules = [ "+webrtc/base", + "+webrtc/logging/rtc_event_log", "+webrtc/system_wrappers", ] @@ -7,10 +8,4 @@ specific_include_rules = { "nada\.h": [ "+webrtc/voice_engine", ], - "remb\.h": [ - "+webrtc/call/mock", - ], - "send_side\.h": [ - "+webrtc/call/mock", - ], } diff --git a/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc b/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc index c953bd83e0..f13a1d5a18 100644 --- a/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc +++ b/webrtc/modules/remote_bitrate_estimator/bwe_simulations.cc @@ -47,7 +47,7 @@ class BweSimulation : public BweTest, INSTANTIATE_TEST_CASE_P(VideoSendersTest, BweSimulation, ::testing::Values(kRembEstimator, - kFullSendSideEstimator, + kSendSideEstimator, kNadaEstimator)); TEST_P(BweSimulation, SprintUplinkTest) { @@ -332,7 +332,7 @@ TEST_P(BweSimulation, TcpFairness1000msTest) { RunFairnessTest(GetParam(), 1, 1, 1000, 2000, 1000, 50, 0, offset_ms); } -// The following test cases begin with "Evaluation" as a referrence to the +// The following test cases begin with "Evaluation" as a reference to the // Internet draft https://tools.ietf.org/html/draft-ietf-rmcat-eval-test-01. TEST_P(BweSimulation, Evaluation1) { @@ -380,20 +380,20 @@ TEST_P(BweSimulation, Evaluation8) { TEST_P(BweSimulation, GccComparison1) { RunVariableCapacity1SingleFlow(GetParam()); BweTest gcc_test(false); - gcc_test.RunVariableCapacity1SingleFlow(kFullSendSideEstimator); + gcc_test.RunVariableCapacity1SingleFlow(kSendSideEstimator); } TEST_P(BweSimulation, GccComparison2) { const size_t kNumFlows = 2; RunVariableCapacity2MultipleFlows(GetParam(), kNumFlows); BweTest gcc_test(false); - gcc_test.RunVariableCapacity2MultipleFlows(kFullSendSideEstimator, kNumFlows); + gcc_test.RunVariableCapacity2MultipleFlows(kSendSideEstimator, kNumFlows); } TEST_P(BweSimulation, GccComparison3) { RunBidirectionalFlow(GetParam()); BweTest gcc_test(false); - gcc_test.RunBidirectionalFlow(kFullSendSideEstimator); + gcc_test.RunBidirectionalFlow(kSendSideEstimator); } TEST_P(BweSimulation, GccComparison4) { @@ -405,13 +405,13 @@ TEST_P(BweSimulation, GccComparison4) { TEST_P(BweSimulation, GccComparison5) { RunRoundTripTimeFairness(GetParam()); BweTest gcc_test(false); - gcc_test.RunRoundTripTimeFairness(kFullSendSideEstimator); + gcc_test.RunRoundTripTimeFairness(kSendSideEstimator); } TEST_P(BweSimulation, GccComparison6) { RunLongTcpFairness(GetParam()); BweTest gcc_test(false); - gcc_test.RunLongTcpFairness(kFullSendSideEstimator); + gcc_test.RunLongTcpFairness(kSendSideEstimator); } TEST_P(BweSimulation, GccComparison7) { @@ -426,14 +426,14 @@ TEST_P(BweSimulation, GccComparison7) { tcp_starting_times_ms); BweTest gcc_test(false); - gcc_test.RunMultipleShortTcpFairness( - kFullSendSideEstimator, tcp_file_sizes_bytes, tcp_starting_times_ms); + gcc_test.RunMultipleShortTcpFairness(kSendSideEstimator, tcp_file_sizes_bytes, + tcp_starting_times_ms); } TEST_P(BweSimulation, GccComparison8) { RunPauseResumeFlows(GetParam()); BweTest gcc_test(false); - gcc_test.RunPauseResumeFlows(kFullSendSideEstimator); + gcc_test.RunPauseResumeFlows(kSendSideEstimator); } TEST_P(BweSimulation, GccComparisonChoke) { @@ -442,7 +442,7 @@ TEST_P(BweSimulation, GccComparisonChoke) { RunChoke(GetParam(), capacities_kbps); BweTest gcc_test(false); - gcc_test.RunChoke(kFullSendSideEstimator, capacities_kbps); + gcc_test.RunChoke(kSendSideEstimator, capacities_kbps); } } // namespace bwe diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc index e307242f8d..a486bce503 100644 --- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc +++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimators_test.cc @@ -57,8 +57,7 @@ class BweFeedbackTest INSTANTIATE_TEST_CASE_P(VideoSendersTest, BweFeedbackTest, - ::testing::Values(kRembEstimator, - kFullSendSideEstimator)); + ::testing::Values(kRembEstimator, kSendSideEstimator)); TEST_P(BweFeedbackTest, ConstantCapacity) { AdaptiveVideoSource source(0, 30, 300, 0, 0); diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe.cc b/webrtc/modules/remote_bitrate_estimator/test/bwe.cc index b21a269ec6..7e339fb065 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe.cc @@ -90,8 +90,8 @@ BweSender* CreateBweSender(BandwidthEstimatorType estimator, switch (estimator) { case kRembEstimator: return new RembBweSender(kbps, observer, clock); - case kFullSendSideEstimator: - return new FullBweSender(kbps, observer, clock); + case kSendSideEstimator: + return new SendSideBweSender(kbps, observer, clock); case kNadaEstimator: return new NadaBweSender(kbps, observer, clock); case kTcpEstimator: @@ -109,7 +109,7 @@ BweReceiver* CreateBweReceiver(BandwidthEstimatorType type, switch (type) { case kRembEstimator: return new RembReceiver(flow_id, plot); - case kFullSendSideEstimator: + case kSendSideEstimator: return new SendSideBweReceiver(flow_id); case kNadaEstimator: return new NadaBweReceiver(flow_id); diff --git a/webrtc/modules/remote_bitrate_estimator/test/bwe.h b/webrtc/modules/remote_bitrate_estimator/test/bwe.h index b811773eec..0d101fcc3e 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/bwe.h +++ b/webrtc/modules/remote_bitrate_estimator/test/bwe.h @@ -176,7 +176,7 @@ enum BandwidthEstimatorType { kNullEstimator, kNadaEstimator, kRembEstimator, - kFullSendSideEstimator, + kSendSideEstimator, kTcpEstimator }; diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h index 6bf5721d70..cb9af9ac94 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/remb.h @@ -16,7 +16,7 @@ #include #include "webrtc/base/constructormagic.h" -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" namespace webrtc { diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc index 0b9312890f..0203a910d8 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.cc @@ -13,7 +13,7 @@ #include #include "webrtc/base/logging.h" -#include "webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_abs_send_time.h" +#include "webrtc/modules/congestion_controller/delay_based_bwe.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe_test_logging.h" namespace webrtc { @@ -22,12 +22,14 @@ namespace bwe { const int kFeedbackIntervalMs = 50; -FullBweSender::FullBweSender(int kbps, BitrateObserver* observer, Clock* clock) +SendSideBweSender::SendSideBweSender(int kbps, + BitrateObserver* observer, + Clock* clock) : bitrate_controller_( BitrateController::CreateBitrateController(clock, observer, &event_log_)), - rbe_(new RemoteBitrateEstimatorAbsSendTime(this, clock)), + bwe_(new DelayBasedBwe(clock)), feedback_observer_(bitrate_controller_->CreateRtcpBandwidthObserver()), clock_(clock), send_time_history_(clock_, 10000), @@ -39,17 +41,16 @@ FullBweSender::FullBweSender(int kbps, BitrateObserver* observer, Clock* clock) bitrate_controller_->SetStartBitrate(1000 * kbps); bitrate_controller_->SetMinMaxBitrate(1000 * kMinBitrateKbps, 1000 * kMaxBitrateKbps); - rbe_->SetMinBitrate(1000 * kMinBitrateKbps); + bwe_->SetMinBitrate(1000 * kMinBitrateKbps); } -FullBweSender::~FullBweSender() { -} +SendSideBweSender::~SendSideBweSender() {} -int FullBweSender::GetFeedbackIntervalMs() const { +int SendSideBweSender::GetFeedbackIntervalMs() const { return kFeedbackIntervalMs; } -void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { +void SendSideBweSender::GiveFeedback(const FeedbackPacket& feedback) { const SendSideBweFeedback& fb = static_cast(feedback); if (fb.packet_feedback_vector().empty()) @@ -67,10 +68,14 @@ void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { int64_t rtt_ms = clock_->TimeInMilliseconds() - feedback.latest_send_time_ms(); - rbe_->OnRttUpdate(rtt_ms, rtt_ms); + bwe_->OnRttUpdate(rtt_ms, rtt_ms); BWE_TEST_LOGGING_PLOT(1, "RTT", clock_->TimeInMilliseconds(), rtt_ms); - rbe_->IncomingPacketFeedbackVector(packet_feedback_vector); + DelayBasedBwe::Result result = + bwe_->IncomingPacketFeedbackVector(packet_feedback_vector); + if (result.updated) + bitrate_controller_->OnDelayBasedBweResult(result); + if (has_received_ack_) { int expected_packets = fb.packet_feedback_vector().back().sequence_number - last_acked_seq_num_; @@ -99,7 +104,7 @@ void FullBweSender::GiveFeedback(const FeedbackPacket& feedback) { } } -void FullBweSender::OnPacketsSent(const Packets& packets) { +void SendSideBweSender::OnPacketsSent(const Packets& packets) { for (Packet* packet : packets) { if (packet->GetPacketType() == Packet::kMedia) { MediaPacket* media_packet = static_cast(packet); @@ -114,17 +119,17 @@ void FullBweSender::OnPacketsSent(const Packets& packets) { } } -void FullBweSender::OnReceiveBitrateChanged(const std::vector& ssrcs, - uint32_t bitrate) { +void SendSideBweSender::OnReceiveBitrateChanged( + const std::vector& ssrcs, + uint32_t bitrate) { feedback_observer_->OnReceivedEstimatedBitrate(bitrate); } -int64_t FullBweSender::TimeUntilNextProcess() { +int64_t SendSideBweSender::TimeUntilNextProcess() { return bitrate_controller_->TimeUntilNextProcess(); } -void FullBweSender::Process() { - rbe_->Process(); +void SendSideBweSender::Process() { bitrate_controller_->Process(); } diff --git a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h index aa7914ef1a..90ec50fc8a 100644 --- a/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h +++ b/webrtc/modules/remote_bitrate_estimator/test/estimators/send_side.h @@ -14,7 +14,7 @@ #include #include -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/remote_bitrate_estimator/include/send_time_history.h" #include "webrtc/modules/remote_bitrate_estimator/test/bwe.h" @@ -22,10 +22,10 @@ namespace webrtc { namespace testing { namespace bwe { -class FullBweSender : public BweSender, public RemoteBitrateObserver { +class SendSideBweSender : public BweSender, public RemoteBitrateObserver { public: - FullBweSender(int kbps, BitrateObserver* observer, Clock* clock); - virtual ~FullBweSender(); + SendSideBweSender(int kbps, BitrateObserver* observer, Clock* clock); + virtual ~SendSideBweSender(); int GetFeedbackIntervalMs() const override; void GiveFeedback(const FeedbackPacket& feedback) override; @@ -37,7 +37,7 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver { protected: std::unique_ptr bitrate_controller_; - std::unique_ptr rbe_; + std::unique_ptr bwe_; std::unique_ptr feedback_observer_; private: @@ -50,7 +50,7 @@ class FullBweSender : public BweSender, public RemoteBitrateObserver { SequenceNumberUnwrapper seq_num_unwrapper_; ::testing::NiceMock event_log_; - RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(FullBweSender); + RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SendSideBweSender); }; class SendSideBweReceiver : public BweReceiver { diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc index 2f664d74fc..c050d18db6 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc @@ -13,7 +13,7 @@ #include "webrtc/base/buffer.h" #include "webrtc/base/rate_limiter.h" -#include "webrtc/call/mock/mock_rtc_event_log.h" +#include "webrtc/logging/rtc_event_log/mock/mock_rtc_event_log.h" #include "webrtc/modules/rtp_rtcp/include/rtp_cvo.h" #include "webrtc/modules/rtp_rtcp/include/rtp_header_parser.h" #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h"