Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1032)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/rtcp_format_remb_unittest.cc

Issue 1362303002: Reland "Wire up send-side bandwidth estimation." (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 55
56 class RtcpFormatRembTest : public ::testing::Test { 56 class RtcpFormatRembTest : public ::testing::Test {
57 protected: 57 protected:
58 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; 58 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000;
59 59
60 RtcpFormatRembTest() 60 RtcpFormatRembTest()
61 : over_use_detector_options_(), 61 : over_use_detector_options_(),
62 system_clock_(Clock::GetRealTimeClock()), 62 system_clock_(Clock::GetRealTimeClock()),
63 dummy_rtp_rtcp_impl_(nullptr),
63 receive_statistics_(ReceiveStatistics::Create(system_clock_)), 64 receive_statistics_(ReceiveStatistics::Create(system_clock_)),
65 rtcp_sender_(nullptr),
66 rtcp_receiver_(nullptr),
67 test_transport_(nullptr),
64 remote_bitrate_observer_(), 68 remote_bitrate_observer_(),
65 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream( 69 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream(
66 &remote_bitrate_observer_, 70 &remote_bitrate_observer_,
67 system_clock_, 71 system_clock_,
68 kRemoteBitrateEstimatorMinBitrateBps)) {} 72 kRemoteBitrateEstimatorMinBitrateBps)) {}
69 void SetUp() override; 73 void SetUp() override;
70 void TearDown() override; 74 void TearDown() override;
71 75
72 OverUseDetectorOptions over_use_detector_options_; 76 OverUseDetectorOptions over_use_detector_options_;
73 Clock* system_clock_; 77 Clock* system_clock_;
74 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_; 78 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_;
75 rtc::scoped_ptr<ReceiveStatistics> receive_statistics_; 79 rtc::scoped_ptr<ReceiveStatistics> receive_statistics_;
76 RTCPSender* rtcp_sender_; 80 RTCPSender* rtcp_sender_;
77 RTCPReceiver* rtcp_receiver_; 81 RTCPReceiver* rtcp_receiver_;
78 TestTransport* test_transport_; 82 TestTransport* test_transport_;
79 MockRemoteBitrateObserver remote_bitrate_observer_; 83 MockRemoteBitrateObserver remote_bitrate_observer_;
80 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; 84 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_;
81 }; 85 };
82 86
83 void RtcpFormatRembTest::SetUp() { 87 void RtcpFormatRembTest::SetUp() {
84 RtpRtcp::Configuration configuration; 88 RtpRtcp::Configuration configuration;
85 configuration.audio = false; 89 configuration.audio = false;
86 configuration.clock = system_clock_; 90 configuration.clock = system_clock_;
87 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); 91 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get();
88 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); 92 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration);
89 rtcp_sender_ = 93 rtcp_sender_ =
90 new RTCPSender(false, system_clock_, receive_statistics_.get(), NULL); 94 new RTCPSender(false, system_clock_, receive_statistics_.get(), nullptr);
91 rtcp_receiver_ = new RTCPReceiver(system_clock_, false, NULL, NULL, NULL, 95 rtcp_receiver_ = new RTCPReceiver(system_clock_, false, nullptr, nullptr,
92 dummy_rtp_rtcp_impl_); 96 nullptr, nullptr, dummy_rtp_rtcp_impl_);
93 test_transport_ = new TestTransport(rtcp_receiver_); 97 test_transport_ = new TestTransport(rtcp_receiver_);
94 98
95 EXPECT_EQ(0, rtcp_sender_->RegisterSendTransport(test_transport_)); 99 EXPECT_EQ(0, rtcp_sender_->RegisterSendTransport(test_transport_));
96 } 100 }
97 101
98 void RtcpFormatRembTest::TearDown() { 102 void RtcpFormatRembTest::TearDown() {
99 delete rtcp_sender_; 103 delete rtcp_sender_;
100 delete rtcp_receiver_; 104 delete rtcp_receiver_;
101 delete dummy_rtp_rtcp_impl_; 105 delete dummy_rtp_rtcp_impl_;
102 delete test_transport_; 106 delete test_transport_;
(...skipping 18 matching lines...) Expand all
121 125
122 TEST_F(RtcpFormatRembTest, TestCompund) { 126 TEST_F(RtcpFormatRembTest, TestCompund) {
123 uint32_t SSRCs[2] = {456789, 98765}; 127 uint32_t SSRCs[2] = {456789, 98765};
124 rtcp_sender_->SetRTCPStatus(kRtcpCompound); 128 rtcp_sender_->SetRTCPStatus(kRtcpCompound);
125 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); 129 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2));
126 RTCPSender::FeedbackState feedback_state = 130 RTCPSender::FeedbackState feedback_state =
127 dummy_rtp_rtcp_impl_->GetFeedbackState(); 131 dummy_rtp_rtcp_impl_->GetFeedbackState();
128 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); 132 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb));
129 } 133 }
130 } // namespace 134 } // namespace
OLDNEW
« no previous file with comments | « webrtc/modules/rtp_rtcp/interface/rtp_rtcp_defines.h ('k') | webrtc/modules/rtp_rtcp/source/rtcp_packet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698