Chromium Code Reviews| 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 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1037 Clock* const clock_; | 1037 Clock* const clock_; |
| 1038 std::unique_ptr<internal::TransportAdapter> transport_adapter_; | 1038 std::unique_ptr<internal::TransportAdapter> transport_adapter_; |
| 1039 rtc::CriticalSection crit_; | 1039 rtc::CriticalSection crit_; |
| 1040 int64_t last_packet_time_ms_ GUARDED_BY(crit_); | 1040 int64_t last_packet_time_ms_ GUARDED_BY(crit_); |
| 1041 test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_); | 1041 test::FrameGeneratorCapturer* capturer_ GUARDED_BY(crit_); |
| 1042 } test; | 1042 } test; |
| 1043 | 1043 |
| 1044 RunBaseTest(&test); | 1044 RunBaseTest(&test); |
| 1045 } | 1045 } |
| 1046 | 1046 |
| 1047 TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) { | |
| 1048 class PaddingIsPrimarilyRetransmissions : public test::EndToEndTest { | |
| 1049 public: | |
| 1050 PaddingIsPrimarilyRetransmissions() | |
| 1051 : EndToEndTest(kDefaultTimeoutMs), | |
| 1052 clock_(Clock::GetRealTimeClock()), | |
| 1053 padding_length_(0), | |
| 1054 total_length_(0) {} | |
| 1055 | |
| 1056 private: | |
| 1057 Action OnSendRtp(const uint8_t* packet, size_t length) override { | |
| 1058 rtc::CritScope lock(&crit_); | |
| 1059 | |
| 1060 RTPHeader header; | |
| 1061 parser_->Parse(packet, length, &header); | |
| 1062 padding_length_ += header.paddingLength; | |
| 1063 total_length_ += length; | |
| 1064 | |
| 1065 return SEND_PACKET; | |
| 1066 } | |
| 1067 | |
| 1068 test::PacketTransport* CreateSendTransport(Call* sender_call) override { | |
| 1069 const int kNetworkDelayMs = 50; | |
| 1070 FakeNetworkPipe::Config config; | |
| 1071 config.loss_percent = 10; | |
| 1072 config.link_capacity_kbps = 10000; // 10 Mbps | |
| 1073 config.queue_delay_ms = kNetworkDelayMs; | |
| 1074 return new test::PacketTransport(sender_call, this, | |
| 1075 test::PacketTransport::kSender, config); | |
| 1076 } | |
| 1077 | |
| 1078 void ModifyVideoConfigs( | |
| 1079 VideoSendStream::Config* send_config, | |
| 1080 std::vector<VideoReceiveStream::Config>* receive_configs, | |
| 1081 VideoEncoderConfig* encoder_config) override { | |
| 1082 send_config->rtp.extensions.clear(); | |
| 1083 send_config->rtp.extensions.push_back( | |
| 1084 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | |
| 1085 test::kTransportSequenceNumberExtensionId)); | |
| 1086 (*receive_configs)[0].rtp.extensions.clear(); | |
| 1087 (*receive_configs)[0].rtp.extensions.push_back( | |
| 1088 RtpExtension(RtpExtension::kTransportSequenceNumberUri, | |
| 1089 test::kTransportSequenceNumberExtensionId)); | |
| 1090 (*receive_configs)[0].rtp.transport_cc = true; | |
| 1091 } | |
| 1092 | |
| 1093 void PerformTest() override { | |
| 1094 SleepMs(5000); | |
|
stefan-webrtc
2016/09/27 14:18:33
Should you instead run the test until Call::Stats:
| |
| 1095 // Expect padding to not dominate the data sent while probing for BW. | |
| 1096 EXPECT_LT(padding_length_, .5 * total_length_); | |
| 1097 } | |
| 1098 | |
| 1099 rtc::CriticalSection crit_; | |
| 1100 Clock* const clock_; | |
| 1101 size_t padding_length_; | |
| 1102 size_t total_length_; | |
| 1103 } test; | |
| 1104 | |
| 1105 RunBaseTest(&test); | |
| 1106 } | |
| 1107 | |
| 1047 // This test first observes "high" bitrate use at which point it sends a REMB to | 1108 // This test first observes "high" bitrate use at which point it sends a REMB to |
| 1048 // indicate that it should be lowered significantly. The test then observes that | 1109 // indicate that it should be lowered significantly. The test then observes that |
| 1049 // the bitrate observed is sinking well below the min-transmit-bitrate threshold | 1110 // the bitrate observed is sinking well below the min-transmit-bitrate threshold |
| 1050 // to verify that the min-transmit bitrate respects incoming REMB. | 1111 // to verify that the min-transmit bitrate respects incoming REMB. |
| 1051 // | 1112 // |
| 1052 // Note that the test starts at "high" bitrate and does not ramp up to "higher" | 1113 // Note that the test starts at "high" bitrate and does not ramp up to "higher" |
| 1053 // bitrate since no receiver block or remb is sent in the initial phase. | 1114 // bitrate since no receiver block or remb is sent in the initial phase. |
| 1054 TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) { | 1115 TEST_F(VideoSendStreamTest, MinTransmitBitrateRespectsRemb) { |
| 1055 static const int kMinTransmitBitrateBps = 400000; | 1116 static const int kMinTransmitBitrateBps = 400000; |
| 1056 static const int kHighBitrateBps = 150000; | 1117 static const int kHighBitrateBps = 150000; |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2570 observation_complete_.Set(); | 2631 observation_complete_.Set(); |
| 2571 } | 2632 } |
| 2572 } | 2633 } |
| 2573 } test; | 2634 } test; |
| 2574 | 2635 |
| 2575 RunBaseTest(&test); | 2636 RunBaseTest(&test); |
| 2576 } | 2637 } |
| 2577 #endif // !defined(RTC_DISABLE_VP9) | 2638 #endif // !defined(RTC_DISABLE_VP9) |
| 2578 | 2639 |
| 2579 } // namespace webrtc | 2640 } // namespace webrtc |
| OLD | NEW |