| 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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 | 525 |
| 526 // Get current receive frequency. | 526 // Get current receive frequency. |
| 527 int AudioCodingModuleImpl::ReceiveFrequency() const { | 527 int AudioCodingModuleImpl::ReceiveFrequency() const { |
| 528 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, | 528 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, |
| 529 "ReceiveFrequency()"); | 529 "ReceiveFrequency()"); |
| 530 | 530 |
| 531 CriticalSectionScoped lock(acm_crit_sect_.get()); | 531 CriticalSectionScoped lock(acm_crit_sect_.get()); |
| 532 | 532 |
| 533 auto codec_id = RentACodec::CodecIdFromIndex(receiver_.last_audio_codec_id()); | 533 auto codec_id = RentACodec::CodecIdFromIndex(receiver_.last_audio_codec_id()); |
| 534 return codec_id ? RentACodec::CodecInstById(*codec_id)->plfreq | 534 return codec_id ? RentACodec::CodecInstById(*codec_id)->plfreq |
| 535 : receiver_.current_sample_rate_hz(); | 535 : receiver_.last_output_sample_rate_hz(); |
| 536 } | 536 } |
| 537 | 537 |
| 538 // Get current playout frequency. | 538 // Get current playout frequency. |
| 539 int AudioCodingModuleImpl::PlayoutFrequency() const { | 539 int AudioCodingModuleImpl::PlayoutFrequency() const { |
| 540 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, | 540 WEBRTC_TRACE(webrtc::kTraceStream, webrtc::kTraceAudioCoding, id_, |
| 541 "PlayoutFrequency()"); | 541 "PlayoutFrequency()"); |
| 542 | 542 return receiver_.last_output_sample_rate_hz(); |
| 543 CriticalSectionScoped lock(acm_crit_sect_.get()); | |
| 544 | |
| 545 return receiver_.current_sample_rate_hz(); | |
| 546 } | 543 } |
| 547 | 544 |
| 548 // Register possible receive codecs, can be called multiple times, | 545 // Register possible receive codecs, can be called multiple times, |
| 549 // for codecs, CNG (NB, WB and SWB), DTMF, RED. | 546 // for codecs, CNG (NB, WB and SWB), DTMF, RED. |
| 550 int AudioCodingModuleImpl::RegisterReceiveCodec(const CodecInst& codec) { | 547 int AudioCodingModuleImpl::RegisterReceiveCodec(const CodecInst& codec) { |
| 551 CriticalSectionScoped lock(acm_crit_sect_.get()); | 548 CriticalSectionScoped lock(acm_crit_sect_.get()); |
| 552 RTC_DCHECK(receiver_initialized_); | 549 RTC_DCHECK(receiver_initialized_); |
| 553 if (codec.channels > 2 || codec.channels < 0) { | 550 if (codec.channels > 2 || codec.channels < 0) { |
| 554 LOG_F(LS_ERROR) << "Unsupported number of channels: " << codec.channels; | 551 LOG_F(LS_ERROR) << "Unsupported number of channels: " << codec.channels; |
| 555 return -1; | 552 return -1; |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 return receiver_.LeastRequiredDelayMs(); | 782 return receiver_.LeastRequiredDelayMs(); |
| 786 } | 783 } |
| 787 | 784 |
| 788 void AudioCodingModuleImpl::GetDecodingCallStatistics( | 785 void AudioCodingModuleImpl::GetDecodingCallStatistics( |
| 789 AudioDecodingCallStats* call_stats) const { | 786 AudioDecodingCallStats* call_stats) const { |
| 790 receiver_.GetDecodingCallStatistics(call_stats); | 787 receiver_.GetDecodingCallStatistics(call_stats); |
| 791 } | 788 } |
| 792 | 789 |
| 793 } // namespace acm2 | 790 } // namespace acm2 |
| 794 } // namespace webrtc | 791 } // namespace webrtc |
| OLD | NEW |