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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 // Returns the number of milliseconds until the module want a worker thread | 112 // Returns the number of milliseconds until the module want a worker thread |
113 // to call Process. | 113 // to call Process. |
114 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { | 114 int64_t ModuleRtpRtcpImpl::TimeUntilNextProcess() { |
115 const int64_t now = clock_->TimeInMilliseconds(); | 115 const int64_t now = clock_->TimeInMilliseconds(); |
116 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; | 116 const int64_t kRtpRtcpMaxIdleTimeProcessMs = 5; |
117 return kRtpRtcpMaxIdleTimeProcessMs - (now - last_process_time_); | 117 return kRtpRtcpMaxIdleTimeProcessMs - (now - last_process_time_); |
118 } | 118 } |
119 | 119 |
120 // Process any pending tasks such as timeouts (non time critical events). | 120 // Process any pending tasks such as timeouts (non time critical events). |
121 int32_t ModuleRtpRtcpImpl::Process() { | 121 void ModuleRtpRtcpImpl::Process() { |
122 const int64_t now = clock_->TimeInMilliseconds(); | 122 const int64_t now = clock_->TimeInMilliseconds(); |
123 last_process_time_ = now; | 123 last_process_time_ = now; |
124 | 124 |
125 const int64_t kRtpRtcpBitrateProcessTimeMs = 10; | 125 const int64_t kRtpRtcpBitrateProcessTimeMs = 10; |
126 if (now >= last_bitrate_process_time_ + kRtpRtcpBitrateProcessTimeMs) { | 126 if (now >= last_bitrate_process_time_ + kRtpRtcpBitrateProcessTimeMs) { |
127 rtp_sender_.ProcessBitrate(); | 127 rtp_sender_.ProcessBitrate(); |
128 last_bitrate_process_time_ = now; | 128 last_bitrate_process_time_ = now; |
129 } | 129 } |
130 | 130 |
131 const int64_t kRtpRtcpRttProcessTimeMs = 1000; | 131 const int64_t kRtpRtcpRttProcessTimeMs = 1000; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 RTCPSender::FeedbackState state = GetFeedbackState(); | 195 RTCPSender::FeedbackState state = GetFeedbackState(); |
196 // 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. |
197 if (!rtcp_sender_.Sending() || state.packets_sent > 0) | 197 if (!rtcp_sender_.Sending() || state.packets_sent > 0) |
198 rtcp_sender_.SendRTCP(state, kRtcpReport); | 198 rtcp_sender_.SendRTCP(state, kRtcpReport); |
199 } | 199 } |
200 | 200 |
201 if (UpdateRTCPReceiveInformationTimers()) { | 201 if (UpdateRTCPReceiveInformationTimers()) { |
202 // A receiver has timed out | 202 // A receiver has timed out |
203 rtcp_receiver_.UpdateTMMBR(); | 203 rtcp_receiver_.UpdateTMMBR(); |
204 } | 204 } |
205 return 0; | |
206 } | 205 } |
207 | 206 |
208 void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) { | 207 void ModuleRtpRtcpImpl::SetRtxSendStatus(int mode) { |
209 rtp_sender_.SetRtxStatus(mode); | 208 rtp_sender_.SetRtxStatus(mode); |
210 } | 209 } |
211 | 210 |
212 int ModuleRtpRtcpImpl::RtxSendStatus() const { | 211 int ModuleRtpRtcpImpl::RtxSendStatus() const { |
213 return rtp_sender_.RtxStatus(); | 212 return rtp_sender_.RtxStatus(); |
214 } | 213 } |
215 | 214 |
(...skipping 762 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
978 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( | 977 void ModuleRtpRtcpImpl::RegisterSendChannelRtpStatisticsCallback( |
979 StreamDataCountersCallback* callback) { | 978 StreamDataCountersCallback* callback) { |
980 rtp_sender_.RegisterRtpStatisticsCallback(callback); | 979 rtp_sender_.RegisterRtpStatisticsCallback(callback); |
981 } | 980 } |
982 | 981 |
983 StreamDataCountersCallback* | 982 StreamDataCountersCallback* |
984 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { | 983 ModuleRtpRtcpImpl::GetSendChannelRtpStatisticsCallback() const { |
985 return rtp_sender_.GetRtpStatisticsCallback(); | 984 return rtp_sender_.GetRtpStatisticsCallback(); |
986 } | 985 } |
987 } // namespace webrtc | 986 } // namespace webrtc |
OLD | NEW |