| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 namespace { | 147 namespace { |
| 148 | 148 |
| 149 // Returns a new speech encoder, or null on error. | 149 // Returns a new speech encoder, or null on error. |
| 150 // TODO(kwiberg): Don't handle errors here (bug 5033) | 150 // TODO(kwiberg): Don't handle errors here (bug 5033) |
| 151 std::unique_ptr<AudioEncoder> CreateEncoder( | 151 std::unique_ptr<AudioEncoder> CreateEncoder( |
| 152 const CodecInst& speech_inst, | 152 const CodecInst& speech_inst, |
| 153 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { | 153 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { |
| 154 #if defined(WEBRTC_CODEC_ISACFX) | 154 #if defined(WEBRTC_CODEC_ISACFX) |
| 155 if (STR_CASE_CMP(speech_inst.plname, "isac") == 0) | 155 if (STR_CASE_CMP(speech_inst.plname, "isac") == 0) |
| 156 return std::unique_ptr<AudioEncoder>( | 156 return std::unique_ptr<AudioEncoder>( |
| 157 new AudioEncoderIsacFix(speech_inst, bwinfo)); | 157 new AudioEncoderIsacFixImpl(speech_inst, bwinfo)); |
| 158 #endif | 158 #endif |
| 159 #if defined(WEBRTC_CODEC_ISAC) | 159 #if defined(WEBRTC_CODEC_ISAC) |
| 160 if (STR_CASE_CMP(speech_inst.plname, "isac") == 0) | 160 if (STR_CASE_CMP(speech_inst.plname, "isac") == 0) |
| 161 return std::unique_ptr<AudioEncoder>( | 161 return std::unique_ptr<AudioEncoder>( |
| 162 new AudioEncoderIsac(speech_inst, bwinfo)); | 162 new AudioEncoderIsacFloatImpl(speech_inst, bwinfo)); |
| 163 #endif | 163 #endif |
| 164 #ifdef WEBRTC_CODEC_OPUS | 164 #ifdef WEBRTC_CODEC_OPUS |
| 165 if (STR_CASE_CMP(speech_inst.plname, "opus") == 0) | 165 if (STR_CASE_CMP(speech_inst.plname, "opus") == 0) |
| 166 return std::unique_ptr<AudioEncoder>(new AudioEncoderOpus(speech_inst)); | 166 return std::unique_ptr<AudioEncoder>(new AudioEncoderOpus(speech_inst)); |
| 167 #endif | 167 #endif |
| 168 if (STR_CASE_CMP(speech_inst.plname, "pcmu") == 0) | 168 if (STR_CASE_CMP(speech_inst.plname, "pcmu") == 0) |
| 169 return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmU(speech_inst)); | 169 return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmU(speech_inst)); |
| 170 if (STR_CASE_CMP(speech_inst.plname, "pcma") == 0) | 170 if (STR_CASE_CMP(speech_inst.plname, "pcma") == 0) |
| 171 return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmA(speech_inst)); | 171 return std::unique_ptr<AudioEncoder>(new AudioEncoderPcmA(speech_inst)); |
| 172 if (STR_CASE_CMP(speech_inst.plname, "l16") == 0) | 172 if (STR_CASE_CMP(speech_inst.plname, "l16") == 0) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 FATAL(); | 222 FATAL(); |
| 223 } | 223 } |
| 224 return std::unique_ptr<AudioEncoder>(new AudioEncoderCng(std::move(config))); | 224 return std::unique_ptr<AudioEncoder>(new AudioEncoderCng(std::move(config))); |
| 225 } | 225 } |
| 226 | 226 |
| 227 std::unique_ptr<AudioDecoder> CreateIsacDecoder( | 227 std::unique_ptr<AudioDecoder> CreateIsacDecoder( |
| 228 int sample_rate_hz, | 228 int sample_rate_hz, |
| 229 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { | 229 const rtc::scoped_refptr<LockedIsacBandwidthInfo>& bwinfo) { |
| 230 #if defined(WEBRTC_CODEC_ISACFX) | 230 #if defined(WEBRTC_CODEC_ISACFX) |
| 231 return std::unique_ptr<AudioDecoder>( | 231 return std::unique_ptr<AudioDecoder>( |
| 232 new AudioDecoderIsacFix(sample_rate_hz, bwinfo)); | 232 new AudioDecoderIsacFixImpl(sample_rate_hz, bwinfo)); |
| 233 #elif defined(WEBRTC_CODEC_ISAC) | 233 #elif defined(WEBRTC_CODEC_ISAC) |
| 234 return std::unique_ptr<AudioDecoder>( | 234 return std::unique_ptr<AudioDecoder>( |
| 235 new AudioDecoderIsac(sample_rate_hz, bwinfo)); | 235 new AudioDecoderIsacFloatImpl(sample_rate_hz, bwinfo)); |
| 236 #else | 236 #else |
| 237 FATAL() << "iSAC is not supported."; | 237 FATAL() << "iSAC is not supported."; |
| 238 return std::unique_ptr<AudioDecoder>(); | 238 return std::unique_ptr<AudioDecoder>(); |
| 239 #endif | 239 #endif |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace | 242 } // namespace |
| 243 | 243 |
| 244 RentACodec::RentACodec() { | 244 RentACodec::RentACodec() { |
| 245 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) | 245 #if defined(WEBRTC_CODEC_ISACFX) || defined(WEBRTC_CODEC_ISAC) |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 } | 305 } |
| 306 return encoder_stack; | 306 return encoder_stack; |
| 307 } | 307 } |
| 308 | 308 |
| 309 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder(int sample_rate_hz) { | 309 std::unique_ptr<AudioDecoder> RentACodec::RentIsacDecoder(int sample_rate_hz) { |
| 310 return CreateIsacDecoder(sample_rate_hz, isac_bandwidth_info_); | 310 return CreateIsacDecoder(sample_rate_hz, isac_bandwidth_info_); |
| 311 } | 311 } |
| 312 | 312 |
| 313 } // namespace acm2 | 313 } // namespace acm2 |
| 314 } // namespace webrtc | 314 } // namespace webrtc |
| OLD | NEW |