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 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1314 EXPECT_GE(call_->GetStats().send_bandwidth_bps, kStartBitrateBps); | 1314 EXPECT_GE(call_->GetStats().send_bandwidth_bps, kStartBitrateBps); |
1315 } | 1315 } |
1316 | 1316 |
1317 private: | 1317 private: |
1318 Call* call_; | 1318 Call* call_; |
1319 } test; | 1319 } test; |
1320 | 1320 |
1321 RunBaseTest(&test); | 1321 RunBaseTest(&test); |
1322 } | 1322 } |
1323 | 1323 |
| 1324 TEST_F(VideoSendStreamTest, ChangingTransportOverhead) { |
| 1325 class ChangingTransportOverheadTest : public test::EndToEndTest { |
| 1326 public: |
| 1327 ChangingTransportOverheadTest() |
| 1328 : EndToEndTest(test::CallTest::kDefaultTimeoutMs), |
| 1329 call_(nullptr), |
| 1330 packets_sent_(0) {} |
| 1331 |
| 1332 void OnCallsCreated(Call* sender_call, Call* receiver_call) override { |
| 1333 call_ = sender_call; |
| 1334 } |
| 1335 |
| 1336 Action OnSendRtp(const uint8_t* packet, size_t length) override { |
| 1337 EXPECT_LE(length, |
| 1338 IP_PACKET_SIZE - static_cast<size_t>(transport_overhead_)); |
| 1339 if (++packets_sent_ < 100) |
| 1340 return SEND_PACKET; |
| 1341 observation_complete_.Set(); |
| 1342 return SEND_PACKET; |
| 1343 } |
| 1344 |
| 1345 void PerformTest() override { |
| 1346 transport_overhead_ = 500; |
| 1347 call_->OnTransportOverheadChanged(webrtc::MediaType::VIDEO, |
| 1348 transport_overhead_); |
| 1349 EXPECT_TRUE(Wait()); |
| 1350 packets_sent_ = 0; |
| 1351 transport_overhead_ = 1000; |
| 1352 call_->OnTransportOverheadChanged(webrtc::MediaType::VIDEO, |
| 1353 transport_overhead_); |
| 1354 EXPECT_TRUE(Wait()); |
| 1355 } |
| 1356 |
| 1357 private: |
| 1358 Call* call_; |
| 1359 int packets_sent_; |
| 1360 int transport_overhead_; |
| 1361 } test; |
| 1362 |
| 1363 RunBaseTest(&test); |
| 1364 } |
| 1365 |
1324 class MaxPaddingSetTest : public test::SendTest { | 1366 class MaxPaddingSetTest : public test::SendTest { |
1325 public: | 1367 public: |
1326 static const uint32_t kMinTransmitBitrateBps = 400000; | 1368 static const uint32_t kMinTransmitBitrateBps = 400000; |
1327 static const uint32_t kActualEncodeBitrateBps = 40000; | 1369 static const uint32_t kActualEncodeBitrateBps = 40000; |
1328 static const uint32_t kMinPacketsToSend = 50; | 1370 static const uint32_t kMinPacketsToSend = 50; |
1329 | 1371 |
1330 explicit MaxPaddingSetTest(bool test_switch_content_type) | 1372 explicit MaxPaddingSetTest(bool test_switch_content_type) |
1331 : SendTest(test::CallTest::kDefaultTimeoutMs), | 1373 : SendTest(test::CallTest::kDefaultTimeoutMs), |
1332 call_(nullptr), | 1374 call_(nullptr), |
1333 send_stream_(nullptr), | 1375 send_stream_(nullptr), |
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2945 RequestSourceRotateIfVideoOrientationExtensionNotSupported) { | 2987 RequestSourceRotateIfVideoOrientationExtensionNotSupported) { |
2946 TestRequestSourceRotateVideo(false); | 2988 TestRequestSourceRotateVideo(false); |
2947 } | 2989 } |
2948 | 2990 |
2949 TEST_F(VideoSendStreamTest, | 2991 TEST_F(VideoSendStreamTest, |
2950 DoNotRequestsRotationIfVideoOrientationExtensionSupported) { | 2992 DoNotRequestsRotationIfVideoOrientationExtensionSupported) { |
2951 TestRequestSourceRotateVideo(true); | 2993 TestRequestSourceRotateVideo(true); |
2952 } | 2994 } |
2953 | 2995 |
2954 } // namespace webrtc | 2996 } // namespace webrtc |
OLD | NEW |