OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
175 int64_t rtt_ms; | 175 int64_t rtt_ms; |
176 if (rtt_stats_ && rtcp_receiver_.GetAndResetXrRrRtt(&rtt_ms)) { | 176 if (rtt_stats_ && rtcp_receiver_.GetAndResetXrRrRtt(&rtt_ms)) { |
177 rtt_stats_->OnRttUpdate(rtt_ms); | 177 rtt_stats_->OnRttUpdate(rtt_ms); |
178 } | 178 } |
179 } | 179 } |
180 } | 180 } |
181 | 181 |
182 // Get processed rtt. | 182 // Get processed rtt. |
183 if (process_rtt) { | 183 if (process_rtt) { |
184 last_rtt_process_time_ = now; | 184 last_rtt_process_time_ = now; |
185 if (rtt_stats_) | 185 if (rtt_stats_) { |
186 set_rtt_ms(rtt_stats_->LastProcessedRtt()); | 186 // Make sure we have a valid RTT before setting. |
187 int64_t last_rtt = rtt_stats_->LastProcessedRtt(); | |
188 if (last_rtt >= 0) | |
stefan-webrtc
2016/02/19 10:44:16
I have some memory of 0 not being a valid rtt, for
sprang
2016/02/19 15:03:16
Yes, but the behavior from outside won't change fr
| |
189 set_rtt_ms(last_rtt); | |
190 } | |
187 } | 191 } |
188 | 192 |
189 // For sending streams, make sure to not send a SR before media has been sent. | 193 // For sending streams, make sure to not send a SR before media has been sent. |
190 if (rtcp_sender_.TimeToSendRTCPReport()) { | 194 if (rtcp_sender_.TimeToSendRTCPReport()) { |
191 RTCPSender::FeedbackState state = GetFeedbackState(); | 195 RTCPSender::FeedbackState state = GetFeedbackState(); |
192 // Prevent sending streams to send SR before any media has been sent. | 196 // Prevent sending streams to send SR before any media has been sent. |
193 if (!rtcp_sender_.Sending() || state.packets_sent > 0) | 197 if (!rtcp_sender_.Sending() || state.packets_sent > 0) |
194 rtcp_sender_.SendRTCP(state, kRtcpReport); | 198 rtcp_sender_.SendRTCP(state, kRtcpReport); |
195 } | 199 } |
196 | 200 |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
989 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 993 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
990 StreamDataCountersCallback* callback) { | 994 StreamDataCountersCallback* callback) { |
991 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 995 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
992 } | 996 } |
993 | 997 |
994 StreamDataCountersCallback* | 998 StreamDataCountersCallback* |
995 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 999 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
996 return rtp_sender_.GetRtpStatisticsCallback(); | 1000 return rtp_sender_.GetRtpStatisticsCallback(); |
997 } | 1001 } |
998 } // namespace webrtc | 1002 } // namespace webrtc |
OLD | NEW |