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

Unified Diff: webrtc/video/video_send_stream_tests.cc

Issue 2347023002: BitrateProber: Support higher probing bitrates (Closed)
Patch Set: Fix thread race and test flakiness on some platforms 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
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 656aadce374c585191134ddfca118cd25e120a20..c33b3cdef6ce7a88db03b93db8d3f4808b0f48b2 100644
--- a/webrtc/video/video_send_stream_tests.cc
+++ b/webrtc/video/video_send_stream_tests.cc
@@ -1044,6 +1044,83 @@ TEST_F(VideoSendStreamTest, NoPaddingWhenVideoIsMuted) {
RunBaseTest(&test);
}
+TEST_F(VideoSendStreamTest, PaddingIsPrimarilyRetransmissions) {
+ const int kCapacityKbps = 10000; // 10 Mbps
+ class PaddingIsPrimarilyRetransmissions : public test::EndToEndTest {
+ public:
+ PaddingIsPrimarilyRetransmissions()
+ : EndToEndTest(kDefaultTimeoutMs),
+ clock_(Clock::GetRealTimeClock()),
+ padding_length_(0),
+ total_length_(0),
+ call_(nullptr) {}
+
+ private:
+ void OnCallsCreated(Call* sender_call, Call* receiver_call) override {
+ call_ = sender_call;
+ }
+
+ 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;
stefan-webrtc 2016/09/30 08:37:21 You only have to protect padding_length_ and total
Irfan 2016/10/03 18:45:26 Right, but given the contention is a one time thin
stefan-webrtc 2016/10/04 14:56:40 Acknowledged.
+ 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 = kCapacityKbps;
+ 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));
+ // Turn on RTX
stefan-webrtc 2016/09/30 08:37:21 End with .
Irfan 2016/10/03 18:45:26 Done.
+ send_config->rtp.rtx.payload_type = kFakeVideoSendPayloadType;
+ send_config->rtp.rtx.ssrcs.push_back(kVideoSendSsrcs[0]);
+
+ (*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 {
+ // TODO(isheriff): Some platforms do not ramp up as expected to full
+ // capacity due to packet scheduling delays. Fix that before getting
+ // rid of this.
+ SleepMs(5000);
+ {
+ rtc::CritScope lock(&crit_);
+ // Expect padding to be a small percentage of total bytes sent.
+ EXPECT_LT(padding_length_, .1 * total_length_);
stefan-webrtc 2016/09/30 08:37:21 Just a question: I would have expected 0% padding.
Irfan 2016/10/03 18:45:26 Adding logs, I see that there are a small number o
stefan-webrtc 2016/10/04 14:56:40 Out of curiosity, are those sent before any media
Irfan 2016/10/04 15:23:33 Clarification here: Turns out, its actually becaus
+ }
+ }
+
+ rtc::CriticalSection crit_;
+ Clock* const clock_;
+ size_t padding_length_;
+ size_t total_length_;
stefan-webrtc 2016/09/30 08:37:21 Add GUARDED_BY
Irfan 2016/10/03 18:45:26 Done.
+ Call* call_;
+ } 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

Powered by Google App Engine
This is Rietveld 408576698