OLD | NEW |
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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 }; | 59 }; |
60 | 60 |
61 | 61 |
62 class RtcpFormatRembTest : public ::testing::Test { | 62 class RtcpFormatRembTest : public ::testing::Test { |
63 protected: | 63 protected: |
64 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; | 64 static const uint32_t kRemoteBitrateEstimatorMinBitrateBps = 30000; |
65 | 65 |
66 RtcpFormatRembTest() | 66 RtcpFormatRembTest() |
67 : over_use_detector_options_(), | 67 : over_use_detector_options_(), |
68 system_clock_(Clock::GetRealTimeClock()), | 68 system_clock_(Clock::GetRealTimeClock()), |
| 69 dummy_rtp_rtcp_impl_(nullptr), |
69 receive_statistics_(ReceiveStatistics::Create(system_clock_)), | 70 receive_statistics_(ReceiveStatistics::Create(system_clock_)), |
| 71 rtcp_sender_(nullptr), |
| 72 rtcp_receiver_(nullptr), |
| 73 test_transport_(nullptr), |
70 remote_bitrate_observer_(), | 74 remote_bitrate_observer_(), |
71 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream( | 75 remote_bitrate_estimator_(new RemoteBitrateEstimatorSingleStream( |
72 &remote_bitrate_observer_, | 76 &remote_bitrate_observer_, |
73 system_clock_, | 77 system_clock_, |
74 kRemoteBitrateEstimatorMinBitrateBps)) {} | 78 kRemoteBitrateEstimatorMinBitrateBps)) {} |
75 void SetUp() override; | 79 void SetUp() override; |
76 void TearDown() override; | 80 void TearDown() override; |
77 | 81 |
78 OverUseDetectorOptions over_use_detector_options_; | 82 OverUseDetectorOptions over_use_detector_options_; |
79 Clock* system_clock_; | 83 Clock* system_clock_; |
80 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_; | 84 ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_; |
81 rtc::scoped_ptr<ReceiveStatistics> receive_statistics_; | 85 rtc::scoped_ptr<ReceiveStatistics> receive_statistics_; |
82 RTCPSender* rtcp_sender_; | 86 RTCPSender* rtcp_sender_; |
83 RTCPReceiver* rtcp_receiver_; | 87 RTCPReceiver* rtcp_receiver_; |
84 TestTransport* test_transport_; | 88 TestTransport* test_transport_; |
85 MockRemoteBitrateObserver remote_bitrate_observer_; | 89 MockRemoteBitrateObserver remote_bitrate_observer_; |
86 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; | 90 rtc::scoped_ptr<RemoteBitrateEstimator> remote_bitrate_estimator_; |
87 }; | 91 }; |
88 | 92 |
89 void RtcpFormatRembTest::SetUp() { | 93 void RtcpFormatRembTest::SetUp() { |
90 RtpRtcp::Configuration configuration; | 94 RtpRtcp::Configuration configuration; |
91 configuration.id = 0; | 95 configuration.id = 0; |
92 configuration.audio = false; | 96 configuration.audio = false; |
93 configuration.clock = system_clock_; | 97 configuration.clock = system_clock_; |
94 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); | 98 configuration.remote_bitrate_estimator = remote_bitrate_estimator_.get(); |
95 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); | 99 dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(configuration); |
96 rtcp_sender_ = new RTCPSender(0, false, system_clock_, | 100 rtcp_sender_ = new RTCPSender(0, false, system_clock_, |
97 receive_statistics_.get(), NULL); | 101 receive_statistics_.get(), nullptr); |
98 rtcp_receiver_ = new RTCPReceiver(0, system_clock_, false, NULL, NULL, NULL, | 102 rtcp_receiver_ = new RTCPReceiver(0, system_clock_, false, nullptr, nullptr, |
99 dummy_rtp_rtcp_impl_); | 103 nullptr, nullptr, dummy_rtp_rtcp_impl_); |
100 test_transport_ = new TestTransport(rtcp_receiver_); | 104 test_transport_ = new TestTransport(rtcp_receiver_); |
101 | 105 |
102 EXPECT_EQ(0, rtcp_sender_->RegisterSendTransport(test_transport_)); | 106 EXPECT_EQ(0, rtcp_sender_->RegisterSendTransport(test_transport_)); |
103 } | 107 } |
104 | 108 |
105 void RtcpFormatRembTest::TearDown() { | 109 void RtcpFormatRembTest::TearDown() { |
106 delete rtcp_sender_; | 110 delete rtcp_sender_; |
107 delete rtcp_receiver_; | 111 delete rtcp_receiver_; |
108 delete dummy_rtp_rtcp_impl_; | 112 delete dummy_rtp_rtcp_impl_; |
109 delete test_transport_; | 113 delete test_transport_; |
(...skipping 18 matching lines...) Expand all Loading... |
128 | 132 |
129 TEST_F(RtcpFormatRembTest, TestCompund) { | 133 TEST_F(RtcpFormatRembTest, TestCompund) { |
130 uint32_t SSRCs[2] = {456789, 98765}; | 134 uint32_t SSRCs[2] = {456789, 98765}; |
131 rtcp_sender_->SetRTCPStatus(kRtcpCompound); | 135 rtcp_sender_->SetRTCPStatus(kRtcpCompound); |
132 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); | 136 rtcp_sender_->SetREMBData(1234, std::vector<uint32_t>(SSRCs, SSRCs + 2)); |
133 RTCPSender::FeedbackState feedback_state = | 137 RTCPSender::FeedbackState feedback_state = |
134 dummy_rtp_rtcp_impl_->GetFeedbackState(); | 138 dummy_rtp_rtcp_impl_->GetFeedbackState(); |
135 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); | 139 EXPECT_EQ(0, rtcp_sender_->SendRTCP(feedback_state, kRtcpRemb)); |
136 } | 140 } |
137 } // namespace | 141 } // namespace |
OLD | NEW |