From 5c58f63d3fbce3f894a583a438c164b00c0b15dc Mon Sep 17 00:00:00 2001 From: "stefan@webrtc.org" Date: Thu, 23 May 2013 13:36:55 +0000 Subject: [PATCH] Fix regression where retransmission bitrate is no longer estimated. BUG=1813 R=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1530004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4095 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/modules/rtp_rtcp/source/rtp_sender.cc | 4 ++-- .../rtp_rtcp/source/rtp_sender_unittest.cc | 2 +- .../auto_test/source/vie_autotest_rtp_rtcp.cc | 17 ++++++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc index ed2412e18..a0e27a8bd 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender.cc @@ -519,12 +519,12 @@ int32_t RTPSender::ReSendPacket(uint16_t packet_id, uint32_t min_resend_time) { length)) { // We can't send the packet right now. // We will be called when it is time. - return 0; + return length; } } if (SendPacketToNetwork(buffer_to_send_ptr, length)) { - return 0; + return length; } return -1; } diff --git a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc index 9ee59e229..17416ef7c 100644 --- a/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc +++ b/webrtc/modules/rtp_rtcp/source/rtp_sender_unittest.cc @@ -413,7 +413,7 @@ TEST_F(RtpSenderTest, TrafficSmoothingRetransmits) { const int kStoredTimeInMs = 100; fake_clock_.AdvanceTimeMilliseconds(kStoredTimeInMs); - EXPECT_EQ(0, rtp_sender_->ReSendPacket(kSeqNum)); + EXPECT_EQ(rtp_length, rtp_sender_->ReSendPacket(kSeqNum)); EXPECT_EQ(0, transport_.packets_sent_); rtp_sender_->TimeToSendPacket(kSeqNum, capture_time_ms); diff --git a/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc b/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc index 03d5b5eb9..f9fe5dcf1 100644 --- a/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc +++ b/webrtc/video_engine/test/auto_test/source/vie_autotest_rtp_rtcp.cc @@ -115,6 +115,10 @@ void ViEAutoTest::ViERtpRtcpStandardTest() ViETest::Log("Set start sequence number: %u", startSequenceNumber); EXPECT_EQ(0, ViE.rtp_rtcp->SetStartSequenceNumber( tbChannel.videoChannel, startSequenceNumber)); + const unsigned int kVideoSsrc = 123456; + // Set an SSRC to avoid issues with collisions. + EXPECT_EQ(0, ViE.rtp_rtcp->SetLocalSSRC(tbChannel.videoChannel, kVideoSsrc, + webrtc::kViEStreamTypeNormal, 0)); myTransport.EnableSequenceNumberCheck(); @@ -263,7 +267,7 @@ void ViEAutoTest::ViERtpRtcpStandardTest() if (FLAGS_include_timing_dependent_tests) { EXPECT_GT(sentTotalBitrate, 0u); - EXPECT_GE(sentFecBitrate, 10u); + EXPECT_GT(sentFecBitrate, 0u); EXPECT_EQ(sentNackBitrate, 0u); } @@ -279,12 +283,11 @@ void ViEAutoTest::ViERtpRtcpStandardTest() tbChannel.videoChannel, sentTotalBitrate, sentVideoBitrate, sentFecBitrate, sentNackBitrate)); - // TODO(holmer): Write a non-flaky verification of this API. - // numberOfErrors += ViETest::TestError(sentTotalBitrate > 0 && - // sentFecBitrate == 0 && - // sentNackBitrate > 0, - // "ERROR: %s at line %d", - // __FUNCTION__, __LINE__); + if (FLAGS_include_timing_dependent_tests) { + EXPECT_GT(sentTotalBitrate, 0u); + EXPECT_EQ(sentFecBitrate, 0u); + EXPECT_GT(sentNackBitrate, 0u); + } EXPECT_EQ(0, ViE.base->StopReceive(tbChannel.videoChannel)); EXPECT_EQ(0, ViE.base->StopSend(tbChannel.videoChannel));