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

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

Issue 1908923002: Audio Coding Module: Use separate instances for 16 kHz and 32 kHz iSAC decoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: New test checksums for non-ARM platforms Created 4 years, 8 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
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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 712
713 // Check if the payload-type is valid. 713 // Check if the payload-type is valid.
714 if (!RentACodec::IsPayloadTypeValid(codec.pltype)) { 714 if (!RentACodec::IsPayloadTypeValid(codec.pltype)) {
715 LOG_F(LS_ERROR) << "Invalid payload type " << codec.pltype << " for " 715 LOG_F(LS_ERROR) << "Invalid payload type " << codec.pltype << " for "
716 << codec.plname; 716 << codec.plname;
717 return -1; 717 return -1;
718 } 718 }
719 719
720 AudioDecoder* isac_decoder = nullptr; 720 AudioDecoder* isac_decoder = nullptr;
721 if (STR_CASE_CMP(codec.plname, "isac") == 0) { 721 if (STR_CASE_CMP(codec.plname, "isac") == 0) {
722 if (!isac_decoder_) { 722 std::unique_ptr<AudioDecoder>& saved_isac_decoder =
723 isac_decoder_ = isac_factory(); 723 codec.plfreq == 16000 ? isac_decoder_16k_ : isac_decoder_32k_;
724 if (!saved_isac_decoder) {
725 saved_isac_decoder = isac_factory();
724 } 726 }
725 isac_decoder = isac_decoder_.get(); 727 isac_decoder = saved_isac_decoder.get();
726 } 728 }
727 return receiver_.AddCodec(*codec_index, codec.pltype, codec.channels, 729 return receiver_.AddCodec(*codec_index, codec.pltype, codec.channels,
728 codec.plfreq, isac_decoder, codec.plname); 730 codec.plfreq, isac_decoder, codec.plname);
729 } 731 }
730 732
731 int AudioCodingModuleImpl::RegisterExternalReceiveCodec( 733 int AudioCodingModuleImpl::RegisterExternalReceiveCodec(
732 int rtp_payload_type, 734 int rtp_payload_type,
733 AudioDecoder* external_decoder, 735 AudioDecoder* external_decoder,
734 int sample_rate_hz, 736 int sample_rate_hz,
735 int num_channels, 737 int num_channels,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 return receiver_.LeastRequiredDelayMs(); 938 return receiver_.LeastRequiredDelayMs();
937 } 939 }
938 940
939 void AudioCodingModuleImpl::GetDecodingCallStatistics( 941 void AudioCodingModuleImpl::GetDecodingCallStatistics(
940 AudioDecodingCallStats* call_stats) const { 942 AudioDecodingCallStats* call_stats) const {
941 receiver_.GetDecodingCallStatistics(call_stats); 943 receiver_.GetDecodingCallStatistics(call_stats);
942 } 944 }
943 945
944 } // namespace acm2 946 } // namespace acm2
945 } // namespace webrtc 947 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698