Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(781)

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_impl.cc

Issue 1332573003: Change return type of AudioEncoder::SetMaxPlaybackRate to void (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@ifc-merge-2
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/codecs/red/audio_encoder_copy_red.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698