OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 #include <algorithm> | 10 #include <algorithm> |
(...skipping 2077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2088 TEST_P(EndToEndTest, RembWithSendSideBwe) { | 2088 TEST_P(EndToEndTest, RembWithSendSideBwe) { |
2089 class BweObserver : public test::EndToEndTest { | 2089 class BweObserver : public test::EndToEndTest { |
2090 public: | 2090 public: |
2091 BweObserver() | 2091 BweObserver() |
2092 : EndToEndTest(kDefaultTimeoutMs), | 2092 : EndToEndTest(kDefaultTimeoutMs), |
2093 sender_call_(nullptr), | 2093 sender_call_(nullptr), |
2094 clock_(Clock::GetRealTimeClock()), | 2094 clock_(Clock::GetRealTimeClock()), |
2095 sender_ssrc_(0), | 2095 sender_ssrc_(0), |
2096 remb_bitrate_bps_(1000000), | 2096 remb_bitrate_bps_(1000000), |
2097 receive_transport_(nullptr), | 2097 receive_transport_(nullptr), |
2098 event_(false, false), | 2098 stop_event_(false, false), |
2099 poller_thread_(&BitrateStatsPollingThread, | 2099 poller_thread_(&BitrateStatsPollingThread, |
2100 this, | 2100 this, |
2101 "BitrateStatsPollingThread"), | 2101 "BitrateStatsPollingThread"), |
2102 state_(kWaitForFirstRampUp), | 2102 state_(kWaitForFirstRampUp), |
2103 retransmission_rate_limiter_(clock_, 1000) {} | 2103 retransmission_rate_limiter_(clock_, 1000) {} |
2104 | 2104 |
2105 ~BweObserver() {} | 2105 ~BweObserver() {} |
2106 | 2106 |
2107 test::PacketTransport* CreateReceiveTransport() override { | 2107 test::PacketTransport* CreateReceiveTransport() override { |
2108 receive_transport_ = new test::PacketTransport( | 2108 receive_transport_ = new test::PacketTransport( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2176 break; | 2176 break; |
2177 | 2177 |
2178 case kWaitForSecondRampUp: | 2178 case kWaitForSecondRampUp: |
2179 if (stats.send_bandwidth_bps == remb_bitrate_bps_) { | 2179 if (stats.send_bandwidth_bps == remb_bitrate_bps_) { |
2180 observation_complete_.Set(); | 2180 observation_complete_.Set(); |
2181 } | 2181 } |
2182 break; | 2182 break; |
2183 } | 2183 } |
2184 } | 2184 } |
2185 | 2185 |
2186 return !event_.Wait(1000); | 2186 return !stop_event_.Wait(1000); |
2187 } | 2187 } |
2188 | 2188 |
2189 void PerformTest() override { | 2189 void PerformTest() override { |
2190 poller_thread_.Start(); | 2190 poller_thread_.Start(); |
2191 EXPECT_TRUE(Wait()) | 2191 EXPECT_TRUE(Wait()) |
2192 << "Timed out while waiting for bitrate to change according to REMB."; | 2192 << "Timed out while waiting for bitrate to change according to REMB."; |
| 2193 stop_event_.Set(); |
2193 poller_thread_.Stop(); | 2194 poller_thread_.Stop(); |
2194 } | 2195 } |
2195 | 2196 |
2196 private: | 2197 private: |
2197 enum TestState { kWaitForFirstRampUp, kWaitForRemb, kWaitForSecondRampUp }; | 2198 enum TestState { kWaitForFirstRampUp, kWaitForRemb, kWaitForSecondRampUp }; |
2198 | 2199 |
2199 Call* sender_call_; | 2200 Call* sender_call_; |
2200 Clock* const clock_; | 2201 Clock* const clock_; |
2201 uint32_t sender_ssrc_; | 2202 uint32_t sender_ssrc_; |
2202 int remb_bitrate_bps_; | 2203 int remb_bitrate_bps_; |
2203 std::unique_ptr<RtpRtcp> rtp_rtcp_; | 2204 std::unique_ptr<RtpRtcp> rtp_rtcp_; |
2204 test::PacketTransport* receive_transport_; | 2205 test::PacketTransport* receive_transport_; |
2205 rtc::Event event_; | 2206 rtc::Event stop_event_; |
2206 rtc::PlatformThread poller_thread_; | 2207 rtc::PlatformThread poller_thread_; |
2207 TestState state_; | 2208 TestState state_; |
2208 RateLimiter retransmission_rate_limiter_; | 2209 RateLimiter retransmission_rate_limiter_; |
2209 } test; | 2210 } test; |
2210 | 2211 |
2211 RunBaseTest(&test); | 2212 RunBaseTest(&test); |
2212 } | 2213 } |
2213 | 2214 |
2214 TEST_P(EndToEndTest, VerifyNackStats) { | 2215 TEST_P(EndToEndTest, VerifyNackStats) { |
2215 static const int kPacketNumberToDrop = 200; | 2216 static const int kPacketNumberToDrop = 200; |
(...skipping 1973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4189 std::unique_ptr<VideoEncoder> encoder_; | 4190 std::unique_ptr<VideoEncoder> encoder_; |
4190 std::unique_ptr<VideoDecoder> decoder_; | 4191 std::unique_ptr<VideoDecoder> decoder_; |
4191 rtc::CriticalSection crit_; | 4192 rtc::CriticalSection crit_; |
4192 int recorded_frames_ GUARDED_BY(crit_); | 4193 int recorded_frames_ GUARDED_BY(crit_); |
4193 } test(this); | 4194 } test(this); |
4194 | 4195 |
4195 RunBaseTest(&test); | 4196 RunBaseTest(&test); |
4196 } | 4197 } |
4197 | 4198 |
4198 } // namespace webrtc | 4199 } // namespace webrtc |
OLD | NEW |