Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: webrtc/video/video_send_stream_tests.cc

Issue 2347023002: BitrateProber: Support higher probing bitrates (Closed)
Patch Set: Add test for validating padding overhead Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/modules/pacing/paced_sender_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/video_send_stream_tests.cc
diff --git a/webrtc/video/video_send_stream_tests.cc b/webrtc/video/video_send_stream_tests.cc
index ba15b17c85b229604bd7ba082e836b00ac54fc4f..74a68ff0baa2fd4c0b1f1b3b0ffca91c86cf5d70 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -1044,6 +1044,67 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
RunBaseTest(&test);
}
+TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) {
+ class PaddingIsPrimarilyRetransmissions : public test::EndToEndTest {
+ public:
+ PaddingIsPrimarilyRetransmissions()
+ : EndToEndTest(kDefaultTimeoutMs),
+ clock_(Clock::GetRealTimeClock()),
+ padding_length_(0),
+ total_length_(0) {}
+
+ private:
+ Action OnSendRtp(const uint8_t* packet, size_t length) override {
+ rtc::CritScope lock(&crit_);
+
+ RTPHeader header;
+ parser_->Parse(packet, length, &header);
+ padding_length_ += header.paddingLength;
+ total_length_ += length;
+
+ return SEND_PACKET;
+ }
+
+ test::PacketTransport* CreateSendTransport(Call* sender_call) override {
+ const int kNetworkDelayMs = 50;
+ FakeNetworkPipe::Config config;
+ config.loss_percent = 10;
+ config.link_capacity_kbps = 10000; // 10 Mbps
+ config.queue_delay_ms = kNetworkDelayMs;
+ return new test::PacketTransport(sender_call, this,
+ test::PacketTransport::kSender, config);
+ }
+
+ void ModifyVideoConfigs(
+ VideoSendStream::Config* send_config,
+ std::vector<VideoReceiveStream::Config>* receive_configs,
+ VideoEncoderConfig* encoder_config) override {
+ send_config->rtp.extensions.clear();
+ send_config->rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ test::kTransportSequenceNumberExtensionId));
+ (*receive_configs)[0].rtp.extensions.clear();
+ (*receive_configs)[0].rtp.extensions.push_back(
+ RtpExtension(RtpExtension::kTransportSequenceNumberUri,
+ test::kTransportSequenceNumberExtensionId));
+ (*receive_configs)[0].rtp.transport_cc = true;
+ }
+
+ void PerformTest() override {
+ SleepMs(5000);
stefan-webrtc 2016/09/27 14:18:33 Should you instead run the test until Call::Stats:
+ // Expect padding to not dominate the data sent while probing for BW.
+ EXPECT_LT(padding_length_, .5 * total_length_);
+ }
+
+ rtc::CriticalSection crit_;
+ Clock* const clock_;
+ size_t padding_length_;
+ size_t total_length_;
+ } test;
+
+ RunBaseTest(&test);
+}
+
// This test first observes "high" bitrate use at which point it sends a REMB to
// indicate that it should be lowered significantly. The test then observes that
// the bitrate observed is sinking well below the min-transmit-bitrate threshold
« no previous file with comments | « webrtc/modules/pacing/paced_sender_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698