Revert 5285 "Revert 5228 "Use the RTT from RtcpRttStats class if..."
> 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 TBR=mflodman@webrtc.org Review URL: https://webrtc-codereview.appspot.com/5989004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@5299 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
1e7d61270c
commit
e7b1e11283
@ -1135,10 +1135,13 @@ int32_t ModuleRtpRtcpImpl::SendNACK(const uint16_t* nack_list,
|
||||
id_,
|
||||
"SendNACK(size:%u)", size);
|
||||
|
||||
uint16_t avg_rtt = 0;
|
||||
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &avg_rtt, NULL, NULL);
|
||||
// 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);
|
||||
}
|
||||
|
||||
int64_t wait_time = 5 + ((avg_rtt * 3) >> 1); // 5 + RTT * 1.5.
|
||||
int64_t wait_time = 5 + ((rtt * 3) >> 1); // 5 + RTT * 1.5.
|
||||
if (wait_time == 5) {
|
||||
wait_time = 100; // During startup we don't have an RTT.
|
||||
}
|
||||
@ -1621,9 +1624,12 @@ void ModuleRtpRtcpImpl::OnReceivedNACK(
|
||||
nack_sequence_numbers.size() == 0) {
|
||||
return;
|
||||
}
|
||||
uint16_t avg_rtt = 0;
|
||||
rtcp_receiver_.RTT(rtcp_receiver_.RemoteSSRC(), NULL, &avg_rtt, NULL, NULL);
|
||||
rtp_sender_.OnReceivedNACK(nack_sequence_numbers, avg_rtt);
|
||||
// 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);
|
||||
}
|
||||
|
||||
int32_t ModuleRtpRtcpImpl::LastReceivedNTP(
|
||||
|
@ -410,6 +410,7 @@ 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);
|
||||
|
@ -122,6 +122,13 @@ 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) {
|
||||
@ -147,7 +154,6 @@ 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());
|
||||
|
Loading…
x
Reference in New Issue
Block a user