| 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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 } | 780 } |
| 781 | 781 |
| 782 // Informs Opus encoder of the maximum playback rate the receiver will render. | 782 // Informs Opus encoder of the maximum playback rate the receiver will render. |
| 783 int AudioCodingModuleImpl::SetOpusMaxPlaybackRate(int frequency_hz) { | 783 int AudioCodingModuleImpl::SetOpusMaxPlaybackRate(int frequency_hz) { |
| 784 CriticalSectionScoped lock(acm_crit_sect_.get()); | 784 CriticalSectionScoped lock(acm_crit_sect_.get()); |
| 785 if (!HaveValidEncoder("SetOpusMaxPlaybackRate")) { | 785 if (!HaveValidEncoder("SetOpusMaxPlaybackRate")) { |
| 786 return -1; | 786 return -1; |
| 787 } | 787 } |
| 788 if (!codec_manager_.CurrentEncoderIsOpus()) | 788 if (!codec_manager_.CurrentEncoderIsOpus()) |
| 789 return -1; | 789 return -1; |
| 790 return codec_manager_.CurrentEncoder()->SetMaxPlaybackRate(frequency_hz) ? 0 | 790 codec_manager_.CurrentEncoder()->SetMaxPlaybackRate(frequency_hz); |
| 791 : -1; | 791 return 0; |
| 792 } | 792 } |
| 793 | 793 |
| 794 int AudioCodingModuleImpl::EnableOpusDtx() { | 794 int AudioCodingModuleImpl::EnableOpusDtx() { |
| 795 CriticalSectionScoped lock(acm_crit_sect_.get()); | 795 CriticalSectionScoped lock(acm_crit_sect_.get()); |
| 796 if (!HaveValidEncoder("EnableOpusDtx")) { | 796 if (!HaveValidEncoder("EnableOpusDtx")) { |
| 797 return -1; | 797 return -1; |
| 798 } | 798 } |
| 799 if (!codec_manager_.CurrentEncoderIsOpus()) | 799 if (!codec_manager_.CurrentEncoderIsOpus()) |
| 800 return -1; | 800 return -1; |
| 801 return codec_manager_.CurrentEncoder()->SetDtx(true) ? 0 : -1; | 801 return codec_manager_.CurrentEncoder()->SetDtx(true) ? 0 : -1; |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1157 *channels = 1; | 1157 *channels = 1; |
| 1158 break; | 1158 break; |
| 1159 #endif | 1159 #endif |
| 1160 default: | 1160 default: |
| 1161 FATAL() << "Codec type " << codec_type << " not supported."; | 1161 FATAL() << "Codec type " << codec_type << " not supported."; |
| 1162 } | 1162 } |
| 1163 return true; | 1163 return true; |
| 1164 } | 1164 } |
| 1165 | 1165 |
| 1166 } // namespace webrtc | 1166 } // namespace webrtc |
| OLD | NEW |