| 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 26 matching lines...) Expand all Loading... |
| 37 streaming_mode_(false), | 37 streaming_mode_(false), |
| 38 last_seq_no_(0), | 38 last_seq_no_(0), |
| 39 last_timestamp_(0), | 39 last_timestamp_(0), |
| 40 minimum_delay_ms_(0), | 40 minimum_delay_ms_(0), |
| 41 least_required_delay_ms_(target_level_), | 41 least_required_delay_ms_(target_level_), |
| 42 maximum_delay_ms_(target_level_), | 42 maximum_delay_ms_(target_level_), |
| 43 iat_cumulative_sum_(0), | 43 iat_cumulative_sum_(0), |
| 44 max_iat_cumulative_sum_(0), | 44 max_iat_cumulative_sum_(0), |
| 45 peak_detector_(*peak_detector), | 45 peak_detector_(*peak_detector), |
| 46 last_pack_cng_or_dtmf_(1) { | 46 last_pack_cng_or_dtmf_(1) { |
| 47 assert(peak_detector); // Should never be NULL. | 47 assert(peak_detector); // Should never be nullptr. |
| 48 Reset(); | 48 Reset(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 DelayManager::~DelayManager() {} | 51 DelayManager::~DelayManager() {} |
| 52 | 52 |
| 53 const DelayManager::IATVector& DelayManager::iat_vector() const { | 53 const DelayManager::IATVector& DelayManager::iat_vector() const { |
| 54 return iat_vector_; | 54 return iat_vector_; |
| 55 } | 55 } |
| 56 | 56 |
| 57 // Set the histogram vector to an exponentially decaying distribution | 57 // Set the histogram vector to an exponentially decaying distribution |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 338 |
| 339 void DelayManager::ResetPacketIatCount() { | 339 void DelayManager::ResetPacketIatCount() { |
| 340 packet_iat_stopwatch_ = tick_timer_->GetNewStopwatch(); | 340 packet_iat_stopwatch_ = tick_timer_->GetNewStopwatch(); |
| 341 } | 341 } |
| 342 | 342 |
| 343 // Note that |low_limit| and |higher_limit| are not assigned to | 343 // Note that |low_limit| and |higher_limit| are not assigned to |
| 344 // |minimum_delay_ms_| and |maximum_delay_ms_| defined by the client of this | 344 // |minimum_delay_ms_| and |maximum_delay_ms_| defined by the client of this |
| 345 // class. They are computed from |target_level_| and used for decision making. | 345 // class. They are computed from |target_level_| and used for decision making. |
| 346 void DelayManager::BufferLimits(int* lower_limit, int* higher_limit) const { | 346 void DelayManager::BufferLimits(int* lower_limit, int* higher_limit) const { |
| 347 if (!lower_limit || !higher_limit) { | 347 if (!lower_limit || !higher_limit) { |
| 348 LOG_F(LS_ERROR) << "NULL pointers supplied as input"; | 348 LOG_F(LS_ERROR) << "null pointers supplied as input"; |
| 349 assert(false); | 349 assert(false); |
| 350 return; | 350 return; |
| 351 } | 351 } |
| 352 | 352 |
| 353 int window_20ms = 0x7FFF; // Default large value for legacy bit-exactness. | 353 int window_20ms = 0x7FFF; // Default large value for legacy bit-exactness. |
| 354 if (packet_len_ms_ > 0) { | 354 if (packet_len_ms_ > 0) { |
| 355 window_20ms = (20 << 8) / packet_len_ms_; | 355 window_20ms = (20 << 8) / packet_len_ms_; |
| 356 } | 356 } |
| 357 | 357 |
| 358 // |target_level_| is in Q8 already. | 358 // |target_level_| is in Q8 already. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 int DelayManager::base_target_level() const { return base_target_level_; } | 408 int DelayManager::base_target_level() const { return base_target_level_; } |
| 409 void DelayManager::set_streaming_mode(bool value) { streaming_mode_ = value; } | 409 void DelayManager::set_streaming_mode(bool value) { streaming_mode_ = value; } |
| 410 int DelayManager::last_pack_cng_or_dtmf() const { | 410 int DelayManager::last_pack_cng_or_dtmf() const { |
| 411 return last_pack_cng_or_dtmf_; | 411 return last_pack_cng_or_dtmf_; |
| 412 } | 412 } |
| 413 | 413 |
| 414 void DelayManager::set_last_pack_cng_or_dtmf(int value) { | 414 void DelayManager::set_last_pack_cng_or_dtmf(int value) { |
| 415 last_pack_cng_or_dtmf_ = value; | 415 last_pack_cng_or_dtmf_ = value; |
| 416 } | 416 } |
| 417 } // namespace webrtc | 417 } // namespace webrtc |
| OLD | NEW |