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> // max | 10 #include <algorithm> // max |
(...skipping 1117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1128 std::unique_ptr<RtpRtcp> rtp_rtcp_; | 1128 std::unique_ptr<RtpRtcp> rtp_rtcp_; |
1129 std::unique_ptr<internal::TransportAdapter> feedback_transport_; | 1129 std::unique_ptr<internal::TransportAdapter> feedback_transport_; |
1130 RateLimiter retranmission_rate_limiter_; | 1130 RateLimiter retranmission_rate_limiter_; |
1131 VideoSendStream* stream_; | 1131 VideoSendStream* stream_; |
1132 bool bitrate_capped_; | 1132 bool bitrate_capped_; |
1133 } test; | 1133 } test; |
1134 | 1134 |
1135 RunBaseTest(&test); | 1135 RunBaseTest(&test); |
1136 } | 1136 } |
1137 | 1137 |
1138 TEST_F(VideoSendStreamTest, DISABLED_ChangingNetworkRoute) { | 1138 TEST_F(VideoSendStreamTest, ChangingNetworkRoute) { |
| 1139 static const int kStartBitrateBps = 300000; |
| 1140 static const int kNewMaxBitrateBps = 1234567; |
| 1141 static const uint8_t kExtensionId = 13; |
1139 class ChangingNetworkRouteTest : public test::EndToEndTest { | 1142 class ChangingNetworkRouteTest : public test::EndToEndTest { |
1140 public: | 1143 public: |
1141 const int kStartBitrateBps = 300000; | |
1142 const int kNewMaxBitrateBps = 1234567; | |
1143 | |
1144 ChangingNetworkRouteTest() | 1144 ChangingNetworkRouteTest() |
1145 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), | 1145 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), call_(nullptr) { |
1146 call_(nullptr) {} | 1146 EXPECT_TRUE(parser_->RegisterRtpHeaderExtension( |
| 1147 kRtpExtensionTransportSequenceNumber, kExtensionId)); |
| 1148 } |
1147 | 1149 |
1148 void OnCallsCreated(Call* sender_call, Call* receiver_call) override { | 1150 void OnCallsCreated(Call* sender_call, Call* receiver_call) override { |
1149 call_ = sender_call; | 1151 call_ = sender_call; |
1150 } | 1152 } |
1151 | 1153 |
| 1154 void ModifyVideoConfigs( |
| 1155 VideoSendStream::Config* send_config, |
| 1156 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1157 VideoEncoderConfig* encoder_config) override { |
| 1158 send_config->rtp.extensions.clear(); |
| 1159 send_config->rtp.extensions.push_back(RtpExtension( |
| 1160 RtpExtension::kTransportSequenceNumberUri, kExtensionId)); |
| 1161 (*receive_configs)[0].rtp.extensions = send_config->rtp.extensions; |
| 1162 (*receive_configs)[0].rtp.transport_cc = true; |
| 1163 } |
| 1164 |
| 1165 void ModifyAudioConfigs( |
| 1166 AudioSendStream::Config* send_config, |
| 1167 std::vector<AudioReceiveStream::Config>* receive_configs) override { |
| 1168 send_config->rtp.extensions.clear(); |
| 1169 send_config->rtp.extensions.push_back(RtpExtension( |
| 1170 RtpExtension::kTransportSequenceNumberUri, kExtensionId)); |
| 1171 (*receive_configs)[0].rtp.extensions.clear(); |
| 1172 (*receive_configs)[0].rtp.extensions = send_config->rtp.extensions; |
| 1173 (*receive_configs)[0].rtp.transport_cc = true; |
| 1174 } |
| 1175 |
1152 Action OnSendRtp(const uint8_t* packet, size_t length) override { | 1176 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
1153 if (call_->GetStats().send_bandwidth_bps > kStartBitrateBps) { | 1177 if (call_->GetStats().send_bandwidth_bps > kStartBitrateBps) { |
1154 observation_complete_.Set(); | 1178 observation_complete_.Set(); |
1155 } | 1179 } |
1156 | 1180 |
1157 return SEND_PACKET; | 1181 return SEND_PACKET; |
1158 } | 1182 } |
1159 | 1183 |
1160 void PerformTest() override { | 1184 void PerformTest() override { |
1161 rtc::NetworkRoute new_route(true, 10, 20, -1); | 1185 rtc::NetworkRoute new_route(true, 10, 20, -1); |
(...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2597 observation_complete_.Set(); | 2621 observation_complete_.Set(); |
2598 } | 2622 } |
2599 } | 2623 } |
2600 } test; | 2624 } test; |
2601 | 2625 |
2602 RunBaseTest(&test); | 2626 RunBaseTest(&test); |
2603 } | 2627 } |
2604 #endif // !defined(RTC_DISABLE_VP9) | 2628 #endif // !defined(RTC_DISABLE_VP9) |
2605 | 2629 |
2606 } // namespace webrtc | 2630 } // namespace webrtc |
OLD | NEW |