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) |
| 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 988 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
985 StreamDataCountersCallback* callback) { | 989 StreamDataCountersCallback* callback) { |
986 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 990 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
987 } | 991 } |
988 | 992 |
989 StreamDataCountersCallback* | 993 StreamDataCountersCallback* |
990 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 994 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
991 return rtp_sender_.GetRtpStatisticsCallback(); | 995 return rtp_sender_.GetRtpStatisticsCallback(); |
992 } | 996 } |
993 } // namespace webrtc | 997 } // namespace webrtc |
OLD | NEW |