OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 nack_list_.erase(nack_list_.begin(), nack_list_.lower_bound(seq_num)); | 111 nack_list_.erase(nack_list_.begin(), nack_list_.lower_bound(seq_num)); |
112 keyframe_list_.erase(keyframe_list_.begin(), | 112 keyframe_list_.erase(keyframe_list_.begin(), |
113 keyframe_list_.lower_bound(seq_num)); | 113 keyframe_list_.lower_bound(seq_num)); |
114 } | 114 } |
115 | 115 |
116 void NackModule::UpdateRtt(int64_t rtt_ms) { | 116 void NackModule::UpdateRtt(int64_t rtt_ms) { |
117 rtc::CritScope lock(&crit_); | 117 rtc::CritScope lock(&crit_); |
118 rtt_ms_ = rtt_ms; | 118 rtt_ms_ = rtt_ms; |
119 } | 119 } |
120 | 120 |
| 121 void NackModule::Clear() { |
| 122 rtc::CritScope lock(&crit_); |
| 123 nack_list_.clear(); |
| 124 keyframe_list_.clear(); |
| 125 } |
| 126 |
121 void NackModule::Stop() { | 127 void NackModule::Stop() { |
122 rtc::CritScope lock(&crit_); | 128 rtc::CritScope lock(&crit_); |
123 running_ = false; | 129 running_ = false; |
124 } | 130 } |
125 | 131 |
126 int64_t NackModule::TimeUntilNextProcess() { | 132 int64_t NackModule::TimeUntilNextProcess() { |
127 rtc::CritScope lock(&crit_); | 133 rtc::CritScope lock(&crit_); |
128 return std::max<int64_t>(next_process_time_ms_ - clock_->TimeInMilliseconds(), | 134 return std::max<int64_t>(next_process_time_ms_ - clock_->TimeInMilliseconds(), |
129 0); | 135 0); |
130 } | 136 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 reordering_histogram_.Add(diff); | 254 reordering_histogram_.Add(diff); |
249 } | 255 } |
250 | 256 |
251 int NackModule::WaitNumberOfPackets(float probability) const { | 257 int NackModule::WaitNumberOfPackets(float probability) const { |
252 if (reordering_histogram_.NumValues() == 0) | 258 if (reordering_histogram_.NumValues() == 0) |
253 return 0; | 259 return 0; |
254 return reordering_histogram_.InverseCdf(probability); | 260 return reordering_histogram_.InverseCdf(probability); |
255 } | 261 } |
256 | 262 |
257 } // namespace webrtc | 263 } // namespace webrtc |
OLD | NEW |