From 6fd930842055525b5c7cff412735515dd463571a Mon Sep 17 00:00:00 2001 From: "minyue@webrtc.org" Date: Mon, 15 Dec 2014 14:56:44 +0000 Subject: [PATCH] Suppressing warnings in GetRTT() in VoE. GetRTT() was separated from GetRTPStatistics() but the warnings were not updated. Now GetRTT() is only only used by GetRTPStatistics() and the warning pops up pointlessly and too often. This CL is to suppress these warnings and maintain a proper warning for GetRTPStatistics(). BUG= R=henrika@webrtc.org Review URL: https://webrtc-codereview.appspot.com/36469004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7899 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/voice_engine/channel.cc | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/webrtc/voice_engine/channel.cc b/webrtc/voice_engine/channel.cc index 91167c0cf..84b5cdf26 100644 --- a/webrtc/voice_engine/channel.cc +++ b/webrtc/voice_engine/channel.cc @@ -3228,10 +3228,13 @@ Channel::GetRTPStatistics(CallStatistics& stats) // --- RTT stats.rttMs = GetRTT(); - - WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, - VoEId(_instanceId, _channelId), - "GetRTPStatistics() => rttMs=%d", stats.rttMs); + if (stats.rttMs == 0) { + WEBRTC_TRACE(kTraceWarning, kTraceVoice, VoEId(_instanceId, _channelId), + "GetRTPStatistics() failed to get RTT"); + } else { + WEBRTC_TRACE(kTraceStateInfo, kTraceVoice, VoEId(_instanceId, _channelId), + "GetRTPStatistics() => rttMs=%d", stats.rttMs); + } // --- Data counters @@ -4279,19 +4282,11 @@ int32_t Channel::GetPlayoutFrequency() { int Channel::GetRTT() const { RTCPMethod method = _rtpRtcpModule->RTCP(); if (method == kRtcpOff) { - WEBRTC_TRACE(kTraceWarning, kTraceVoice, - VoEId(_instanceId, _channelId), - "GetRTPStatistics() RTCP is disabled => valid RTT " - "measurements cannot be retrieved"); return 0; } std::vector report_blocks; _rtpRtcpModule->RemoteRTCPStat(&report_blocks); if (report_blocks.empty()) { - WEBRTC_TRACE(kTraceWarning, kTraceVoice, - VoEId(_instanceId, _channelId), - "GetRTPStatistics() failed to measure RTT since no " - "RTCP packets have been received yet"); return 0; } @@ -4314,10 +4309,6 @@ int Channel::GetRTT() const { uint16_t min_rtt = 0; if (_rtpRtcpModule->RTT(remoteSSRC, &rtt, &avg_rtt, &min_rtt, &max_rtt) != 0) { - WEBRTC_TRACE(kTraceWarning, kTraceVoice, - VoEId(_instanceId, _channelId), - "GetRTPStatistics() failed to retrieve RTT from " - "the RTP/RTCP module"); return 0; } return static_cast(rtt);