| 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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 *lower_limit = (target_level_ * 3) / 4; | 364 *lower_limit = (target_level_ * 3) / 4; |
| 365 // |higher_limit| is equal to |target_level_|, but should at | 365 // |higher_limit| is equal to |target_level_|, but should at |
| 366 // least be 20 ms higher than |lower_limit_|. | 366 // least be 20 ms higher than |lower_limit_|. |
| 367 *higher_limit = std::max(target_level_, *lower_limit + window_20ms); | 367 *higher_limit = std::max(target_level_, *lower_limit + window_20ms); |
| 368 } | 368 } |
| 369 | 369 |
| 370 int DelayManager::TargetLevel() const { | 370 int DelayManager::TargetLevel() const { |
| 371 return target_level_; | 371 return target_level_; |
| 372 } | 372 } |
| 373 | 373 |
| 374 void DelayManager::LastDecoderType(NetEqDecoder decoder_type) { | 374 void DelayManager::LastDecodedWasCngOrDtmf(bool it_was) { |
| 375 if (decoder_type == NetEqDecoder::kDecoderAVT || | 375 if (it_was) { |
| 376 decoder_type == NetEqDecoder::kDecoderCNGnb || | |
| 377 decoder_type == NetEqDecoder::kDecoderCNGwb || | |
| 378 decoder_type == NetEqDecoder::kDecoderCNGswb32kHz || | |
| 379 decoder_type == NetEqDecoder::kDecoderCNGswb48kHz) { | |
| 380 last_pack_cng_or_dtmf_ = 1; | 376 last_pack_cng_or_dtmf_ = 1; |
| 381 } else if (last_pack_cng_or_dtmf_ != 0) { | 377 } else if (last_pack_cng_or_dtmf_ != 0) { |
| 382 last_pack_cng_or_dtmf_ = -1; | 378 last_pack_cng_or_dtmf_ = -1; |
| 383 } | 379 } |
| 384 } | 380 } |
| 385 | 381 |
| 386 bool DelayManager::SetMinimumDelay(int delay_ms) { | 382 bool DelayManager::SetMinimumDelay(int delay_ms) { |
| 387 // Minimum delay shouldn't be more than maximum delay, if any maximum is set. | 383 // Minimum delay shouldn't be more than maximum delay, if any maximum is set. |
| 388 // Also, if possible check |delay| to less than 75% of | 384 // Also, if possible check |delay| to less than 75% of |
| 389 // |max_packets_in_buffer_|. | 385 // |max_packets_in_buffer_|. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 417 int DelayManager::base_target_level() const { return base_target_level_; } | 413 int DelayManager::base_target_level() const { return base_target_level_; } |
| 418 void DelayManager::set_streaming_mode(bool value) { streaming_mode_ = value; } | 414 void DelayManager::set_streaming_mode(bool value) { streaming_mode_ = value; } |
| 419 int DelayManager::last_pack_cng_or_dtmf() const { | 415 int DelayManager::last_pack_cng_or_dtmf() const { |
| 420 return last_pack_cng_or_dtmf_; | 416 return last_pack_cng_or_dtmf_; |
| 421 } | 417 } |
| 422 | 418 |
| 423 void DelayManager::set_last_pack_cng_or_dtmf(int value) { | 419 void DelayManager::set_last_pack_cng_or_dtmf(int value) { |
| 424 last_pack_cng_or_dtmf_ = value; | 420 last_pack_cng_or_dtmf_ = value; |
| 425 } | 421 } |
| 426 } // namespace webrtc | 422 } // namespace webrtc |
| OLD | NEW |