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

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

Issue 1928293002: NetEq: Use a BuiltinAudioDecoderFactory to create decoders (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rejigger Opus config Created 4 years, 7 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 case NetEqDecoder::kDecoderCNGswb48kHz: { 130 case NetEqDecoder::kDecoderCNGswb48kHz: {
131 // TODO(tlegrand): Remove limitation once ACM has full 48 kHz support. 131 // TODO(tlegrand): Remove limitation once ACM has full 48 kHz support.
132 return 32000; 132 return 32000;
133 } 133 }
134 default: { 134 default: {
135 return -1; // Undefined sample rate. 135 return -1; // Undefined sample rate.
136 } 136 }
137 } 137 }
138 } 138 }
139 139
140 AudioDecoder* CreateAudioDecoder(NetEqDecoder codec_type) {
141 if (!CodecSupported(codec_type)) {
142 return NULL;
143 }
144 switch (codec_type) {
145 case NetEqDecoder::kDecoderPCMu:
146 return new AudioDecoderPcmU(1);
147 case NetEqDecoder::kDecoderPCMa:
148 return new AudioDecoderPcmA(1);
149 case NetEqDecoder::kDecoderPCMu_2ch:
150 return new AudioDecoderPcmU(2);
151 case NetEqDecoder::kDecoderPCMa_2ch:
152 return new AudioDecoderPcmA(2);
153 #ifdef WEBRTC_CODEC_ILBC
154 case NetEqDecoder::kDecoderILBC:
155 return new AudioDecoderIlbc;
156 #endif
157 #if defined(WEBRTC_CODEC_ISACFX)
158 case NetEqDecoder::kDecoderISAC:
159 return new AudioDecoderIsacFix();
160 #elif defined(WEBRTC_CODEC_ISAC)
161 case NetEqDecoder::kDecoderISAC:
162 case NetEqDecoder::kDecoderISACswb:
163 return new AudioDecoderIsac();
164 #endif
165 case NetEqDecoder::kDecoderPCM16B:
166 case NetEqDecoder::kDecoderPCM16Bwb:
167 case NetEqDecoder::kDecoderPCM16Bswb32kHz:
168 case NetEqDecoder::kDecoderPCM16Bswb48kHz:
169 return new AudioDecoderPcm16B(1);
170 case NetEqDecoder::kDecoderPCM16B_2ch:
171 case NetEqDecoder::kDecoderPCM16Bwb_2ch:
172 case NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch:
173 case NetEqDecoder::kDecoderPCM16Bswb48kHz_2ch:
174 return new AudioDecoderPcm16B(2);
175 case NetEqDecoder::kDecoderPCM16B_5ch:
176 return new AudioDecoderPcm16B(5);
177 #ifdef WEBRTC_CODEC_G722
178 case NetEqDecoder::kDecoderG722:
179 return new AudioDecoderG722;
180 case NetEqDecoder::kDecoderG722_2ch:
181 return new AudioDecoderG722Stereo;
182 #endif
183 #ifdef WEBRTC_CODEC_OPUS
184 case NetEqDecoder::kDecoderOpus:
185 return new AudioDecoderOpus(1);
186 case NetEqDecoder::kDecoderOpus_2ch:
187 return new AudioDecoderOpus(2);
188 #endif
189 case NetEqDecoder::kDecoderCNGnb:
190 case NetEqDecoder::kDecoderCNGwb:
191 case NetEqDecoder::kDecoderCNGswb32kHz:
192 case NetEqDecoder::kDecoderCNGswb48kHz:
193 RTC_CHECK(false) << "CNG should not be created like this anymore!";
194 case NetEqDecoder::kDecoderRED:
195 case NetEqDecoder::kDecoderAVT:
196 case NetEqDecoder::kDecoderArbitrary:
197 default: {
198 return NULL;
199 }
200 }
201 }
202
203 } // namespace webrtc 140 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698