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

Side by Side Diff: webrtc/modules/audio_coding/neteq/audio_decoder_impl.cc

Issue 1353803002: Simple cleanups of AudioDecoder and AudioEncoder classes (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@dmove-isac
Patch Set: rebase 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
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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 } 176 }
177 } 177 }
178 } 178 }
179 179
180 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) { 180 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) {
181 if (!CodecSupported(codec_type)) { 181 if (!CodecSupported(codec_type)) {
182 return NULL; 182 return NULL;
183 } 183 }
184 switch (codec_type) { 184 switch (codec_type) {
185 case kDecoderPCMu: 185 case kDecoderPCMu:
186 return new AudioDecoderPcmU; 186 return new AudioDecoderPcmU(1);
187 case kDecoderPCMa: 187 case kDecoderPCMa:
188 return new AudioDecoderPcmA; 188 return new AudioDecoderPcmA(1);
189 case kDecoderPCMu_2ch: 189 case kDecoderPCMu_2ch:
190 return new AudioDecoderPcmUMultiCh(2); 190 return new AudioDecoderPcmU(2);
191 case kDecoderPCMa_2ch: 191 case kDecoderPCMa_2ch:
192 return new AudioDecoderPcmAMultiCh(2); 192 return new AudioDecoderPcmA(2);
193 #ifdef WEBRTC_CODEC_ILBC 193 #ifdef WEBRTC_CODEC_ILBC
194 case kDecoderILBC: 194 case kDecoderILBC:
195 return new AudioDecoderIlbc; 195 return new AudioDecoderIlbc;
196 #endif 196 #endif
197 #if defined(WEBRTC_CODEC_ISACFX) 197 #if defined(WEBRTC_CODEC_ISACFX)
198 case kDecoderISAC: 198 case kDecoderISAC:
199 return new AudioDecoderIsacFix(); 199 return new AudioDecoderIsacFix();
200 #elif defined(WEBRTC_CODEC_ISAC) 200 #elif defined(WEBRTC_CODEC_ISAC)
201 case kDecoderISAC: 201 case kDecoderISAC:
202 case kDecoderISACswb: 202 case kDecoderISACswb:
203 case kDecoderISACfb: 203 case kDecoderISACfb:
204 return new AudioDecoderIsac(); 204 return new AudioDecoderIsac();
205 #endif 205 #endif
206 case kDecoderPCM16B: 206 case kDecoderPCM16B:
207 case kDecoderPCM16Bwb: 207 case kDecoderPCM16Bwb:
208 case kDecoderPCM16Bswb32kHz: 208 case kDecoderPCM16Bswb32kHz:
209 case kDecoderPCM16Bswb48kHz: 209 case kDecoderPCM16Bswb48kHz:
210 return new AudioDecoderPcm16B; 210 return new AudioDecoderPcm16B(1);
211 case kDecoderPCM16B_2ch: 211 case kDecoderPCM16B_2ch:
212 case kDecoderPCM16Bwb_2ch: 212 case kDecoderPCM16Bwb_2ch:
213 case kDecoderPCM16Bswb32kHz_2ch: 213 case kDecoderPCM16Bswb32kHz_2ch:
214 case kDecoderPCM16Bswb48kHz_2ch: 214 case kDecoderPCM16Bswb48kHz_2ch:
215 return new AudioDecoderPcm16BMultiCh(2); 215 return new AudioDecoderPcm16B(2);
216 case kDecoderPCM16B_5ch: 216 case kDecoderPCM16B_5ch:
217 return new AudioDecoderPcm16BMultiCh(5); 217 return new AudioDecoderPcm16B(5);
218 #ifdef WEBRTC_CODEC_G722 218 #ifdef WEBRTC_CODEC_G722
219 case kDecoderG722: 219 case kDecoderG722:
220 return new AudioDecoderG722; 220 return new AudioDecoderG722;
221 case kDecoderG722_2ch: 221 case kDecoderG722_2ch:
222 return new AudioDecoderG722Stereo; 222 return new AudioDecoderG722Stereo;
223 #endif 223 #endif
224 #ifdef WEBRTC_CODEC_OPUS 224 #ifdef WEBRTC_CODEC_OPUS
225 case kDecoderOpus: 225 case kDecoderOpus:
226 return new AudioDecoderOpus(1); 226 return new AudioDecoderOpus(1);
227 case kDecoderOpus_2ch: 227 case kDecoderOpus_2ch:
228 return new AudioDecoderOpus(2); 228 return new AudioDecoderOpus(2);
229 #endif 229 #endif
230 case kDecoderCNGnb: 230 case kDecoderCNGnb:
231 case kDecoderCNGwb: 231 case kDecoderCNGwb:
232 case kDecoderCNGswb32kHz: 232 case kDecoderCNGswb32kHz:
233 case kDecoderCNGswb48kHz: 233 case kDecoderCNGswb48kHz:
234 return new AudioDecoderCng; 234 return new AudioDecoderCng;
235 case kDecoderRED: 235 case kDecoderRED:
236 case kDecoderAVT: 236 case kDecoderAVT:
237 case kDecoderArbitrary: 237 case kDecoderArbitrary:
238 default: { 238 default: {
239 return NULL; 239 return NULL;
240 } 240 }
241 } 241 }
242 } 242 }
243 243
244 } // namespace webrtc 244 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698