Revert 5228 "Use the RTT from RtcpRttStats class if provided whe..."

> Use the RTT from RtcpRttStats class if provided when sending/receiving NACK.
> 
> R=holmer@google.com
> 
> Review URL: https://webrtc-codereview.appspot.com/5049004

TBR=asapersson@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/5799004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5285 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
asapersson@webrtc.org 2013-12-13 16:16:45 +00:00
parent 0a222eba69
commit 86bb56a7f5
3 changed files with 7 additions and 20 deletions

View File

@ -1135,13 +1135,10 @@ int32_t ModuleRtpRtcpImpl::SendNACK(const uint16_t* nack_list,
id_,
"SendNACK(size:%u)", size);
// Use RTT from RtcpRttStats class if provided.
uint16_t rtt = rtt_ms();
if (rtt == 0) {
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &rtt, NULL, NULL);
}
uint16_t avg_rtt = 0;
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &avg_rtt, NULL, NULL);
int64_t wait_time = 5 + ((rtt * 3) >> 1); // 5 + RTT * 1.5.
int64_t wait_time = 5 + ((avg_rtt * 3) >> 1); // 5 + RTT * 1.5.
if (wait_time == 5) {
wait_time = 100; // During startup we don't have an RTT.
}
@ -1625,12 +1622,9 @@ void ModuleRtpRtcpImpl::OnReceivedNACK(
nack_sequence_numbers.size() == 0) {
return;
}
// Use RTT from RtcpRttStats class if provided.
uint16_t rtt = rtt_ms();
if (rtt == 0) {
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &rtt, NULL, NULL);
}
rtp_sender_.OnReceivedNACK(nack_sequence_numbers, rtt);
uint16_t avg_rtt = 0;
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &avg_rtt, NULL, NULL);
rtp_sender_.OnReceivedNACK(nack_sequence_numbers, avg_rtt);
}
int32_t ModuleRtpRtcpImpl::LastReceivedNTP(

View File

@ -410,7 +410,6 @@ class ModuleRtpRtcpImpl : public RtpRtcp {
Clock* clock_;
private:
FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, Rtt);
FRIEND_TEST_ALL_PREFIXES(RtpRtcpImplTest, RttForReceiverOnly);
int64_t RtcpReportInterval();
void SetRtcpReceiverSsrcs(uint32_t main_ssrc);

View File

@ -122,13 +122,6 @@ TEST_F(RtpRtcpImplTest, Rtt) {
// No RTT from other ssrc.
EXPECT_EQ(-1,
rtp_rtcp_impl_->RTT(kSsrc + 1, &rtt, &avg_rtt, &min_rtt, &max_rtt));
// Verify RTT from rtt_stats config.
EXPECT_EQ(0U, rtt_stats_.LastProcessedRtt());
EXPECT_EQ(0U, rtp_rtcp_impl_->rtt_ms());
rtp_rtcp_impl_->Process();
EXPECT_EQ(100U, rtt_stats_.LastProcessedRtt());
EXPECT_EQ(100U, rtp_rtcp_impl_->rtt_ms());
}
TEST_F(RtpRtcpImplTest, SetRtcpXrRrtrStatus) {
@ -154,6 +147,7 @@ TEST_F(RtpRtcpImplTest, RttForReceiverOnly) {
// Verify RTT.
EXPECT_EQ(0U, rtt_stats_.LastProcessedRtt());
EXPECT_EQ(0U, rtp_rtcp_impl_->rtt_ms());
rtp_rtcp_impl_->Process();
EXPECT_EQ(100U, rtt_stats_.LastProcessedRtt());
EXPECT_EQ(100U, rtp_rtcp_impl_->rtt_ms());