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

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

Issue 1424083002: Make an enum class out of NetEqDecoder, and hide the neteq_decoders_ table (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 5 years, 1 month 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 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 #ifdef WEBRTC_CODEC_RED 166 #ifdef WEBRTC_CODEC_RED
167 {1, {0}, 0, 1}, 167 {1, {0}, 0, 1},
168 #endif 168 #endif
169 // To prevent compile errors due to trailing commas. 169 // To prevent compile errors due to trailing commas.
170 {-1, {-1}, -1, -1} 170 {-1, {-1}, -1, -1}
171 }; 171 };
172 172
173 // Create a database of all NetEQ decoders at compile time. 173 // Create a database of all NetEQ decoders at compile time.
174 const NetEqDecoder ACMCodecDB::neteq_decoders_[] = { 174 const NetEqDecoder ACMCodecDB::neteq_decoders_[] = {
175 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX)) 175 #if (defined(WEBRTC_CODEC_ISAC) || defined(WEBRTC_CODEC_ISACFX))
176 kDecoderISAC, 176 NetEqDecoder::kDecoderISAC,
177 # if (defined(WEBRTC_CODEC_ISAC)) 177 # if (defined(WEBRTC_CODEC_ISAC))
178 kDecoderISACswb, 178 NetEqDecoder::kDecoderISACswb,
179 # endif 179 # endif
180 #endif 180 #endif
181 // Mono 181 // Mono
182 kDecoderPCM16B, 182 NetEqDecoder::kDecoderPCM16B, NetEqDecoder::kDecoderPCM16Bwb,
183 kDecoderPCM16Bwb, 183 NetEqDecoder::kDecoderPCM16Bswb32kHz,
184 kDecoderPCM16Bswb32kHz,
185 // Stereo 184 // Stereo
186 kDecoderPCM16B_2ch, 185 NetEqDecoder::kDecoderPCM16B_2ch, NetEqDecoder::kDecoderPCM16Bwb_2ch,
187 kDecoderPCM16Bwb_2ch, 186 NetEqDecoder::kDecoderPCM16Bswb32kHz_2ch,
188 kDecoderPCM16Bswb32kHz_2ch,
189 // G.711, PCM mu-las and A-law. 187 // G.711, PCM mu-las and A-law.
190 // Mono 188 // Mono
191 kDecoderPCMu, 189 NetEqDecoder::kDecoderPCMu, NetEqDecoder::kDecoderPCMa,
192 kDecoderPCMa,
193 // Stereo 190 // Stereo
194 kDecoderPCMu_2ch, 191 NetEqDecoder::kDecoderPCMu_2ch, NetEqDecoder::kDecoderPCMa_2ch,
195 kDecoderPCMa_2ch,
196 #ifdef WEBRTC_CODEC_ILBC 192 #ifdef WEBRTC_CODEC_ILBC
197 kDecoderILBC, 193 NetEqDecoder::kDecoderILBC,
198 #endif 194 #endif
199 #ifdef WEBRTC_CODEC_G722 195 #ifdef WEBRTC_CODEC_G722
200 // Mono 196 // Mono
201 kDecoderG722, 197 NetEqDecoder::kDecoderG722,
202 // Stereo 198 // Stereo
203 kDecoderG722_2ch, 199 NetEqDecoder::kDecoderG722_2ch,
204 #endif 200 #endif
205 #ifdef WEBRTC_CODEC_OPUS 201 #ifdef WEBRTC_CODEC_OPUS
206 // Mono and stereo. 202 // Mono and stereo.
207 kDecoderOpus, 203 NetEqDecoder::kDecoderOpus,
208 #endif 204 #endif
209 // Comfort noise for three different sampling frequencies. 205 // Comfort noise for three different sampling frequencies.
210 kDecoderCNGnb, 206 NetEqDecoder::kDecoderCNGnb, NetEqDecoder::kDecoderCNGwb,
211 kDecoderCNGwb, 207 NetEqDecoder::kDecoderCNGswb32kHz,
212 kDecoderCNGswb32kHz
213 #ifdef ENABLE_48000_HZ 208 #ifdef ENABLE_48000_HZ
214 , kDecoderCNGswb48kHz 209 NetEqDecoder::kDecoderCNGswb48kHz,
215 #endif 210 #endif
216 , kDecoderAVT 211 NetEqDecoder::kDecoderAVT,
217 #ifdef WEBRTC_CODEC_RED 212 #ifdef WEBRTC_CODEC_RED
218 , kDecoderRED 213 NetEqDecoder::kDecoderRED,
219 #endif 214 #endif
220 }; 215 };
221 216
222 // Get codec information from database. 217 // Get codec information from database.
223 // TODO(tlegrand): replace memcpy with a pointer to the data base memory. 218 // TODO(tlegrand): replace memcpy with a pointer to the data base memory.
224 int ACMCodecDB::Codec(int codec_id, CodecInst* codec_inst) { 219 int ACMCodecDB::Codec(int codec_id, CodecInst* codec_inst) {
225 // Error check to see that codec_id is not out of bounds. 220 // Error check to see that codec_id is not out of bounds.
226 if (static_cast<size_t>(codec_id) >= RentACodec::NumberOfCodecs()) { 221 if (static_cast<size_t>(codec_id) >= RentACodec::NumberOfCodecs()) {
227 return -1; 222 return -1;
228 } 223 }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 355 }
361 356
362 // Checks if the payload type is in the valid range. 357 // Checks if the payload type is in the valid range.
363 bool ACMCodecDB::ValidPayloadType(int payload_type) { 358 bool ACMCodecDB::ValidPayloadType(int payload_type) {
364 return (payload_type >= 0) && (payload_type <= 127); 359 return (payload_type >= 0) && (payload_type <= 127);
365 } 360 }
366 361
367 } // namespace acm2 362 } // namespace acm2
368 363
369 } // namespace webrtc 364 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_codec_database.h ('k') | webrtc/modules/audio_coding/main/acm2/acm_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698