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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/rent_a_codec.h

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) 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 #ifndef WEBRTC_CODEC_RED 90 #ifndef WEBRTC_CODEC_RED
91 kRED = -1, 91 kRED = -1,
92 #endif 92 #endif
93 #ifndef ENABLE_48000_HZ 93 #ifndef ENABLE_48000_HZ
94 kCNFB = -1, 94 kCNFB = -1,
95 #endif 95 #endif
96 96
97 kNone = -1 97 kNone = -1
98 }; 98 };
99 99
100 enum class NetEqDecoder {
101 kDecoderPCMu,
102 kDecoderPCMa,
103 kDecoderPCMu_2ch,
104 kDecoderPCMa_2ch,
105 kDecoderILBC,
106 kDecoderISAC,
107 kDecoderISACswb,
108 kDecoderPCM16B,
109 kDecoderPCM16Bwb,
110 kDecoderPCM16Bswb32kHz,
111 kDecoderPCM16Bswb48kHz,
112 kDecoderPCM16B_2ch,
113 kDecoderPCM16Bwb_2ch,
114 kDecoderPCM16Bswb32kHz_2ch,
115 kDecoderPCM16Bswb48kHz_2ch,
116 kDecoderPCM16B_5ch,
117 kDecoderG722,
118 kDecoderG722_2ch,
119 kDecoderRED,
120 kDecoderAVT,
121 kDecoderCNGnb,
122 kDecoderCNGwb,
123 kDecoderCNGswb32kHz,
124 kDecoderCNGswb48kHz,
125 kDecoderArbitrary,
126 kDecoderOpus,
127 kDecoderOpus_2ch,
128 };
129
100 static inline size_t NumberOfCodecs() { 130 static inline size_t NumberOfCodecs() {
101 return static_cast<size_t>(CodecId::kNumCodecs); 131 return static_cast<size_t>(CodecId::kNumCodecs);
102 } 132 }
103 133
104 static inline rtc::Maybe<int> CodecIndexFromId(CodecId codec_id) { 134 static inline rtc::Maybe<int> CodecIndexFromId(CodecId codec_id) {
105 const int i = static_cast<int>(codec_id); 135 const int i = static_cast<int>(codec_id);
106 return i < static_cast<int>(NumberOfCodecs()) ? i : rtc::Maybe<int>(); 136 return i < static_cast<int>(NumberOfCodecs()) ? i : rtc::Maybe<int>();
107 } 137 }
108 138
109 static inline rtc::Maybe<CodecId> CodecIdFromIndex(int codec_index) { 139 static inline rtc::Maybe<CodecId> CodecIdFromIndex(int codec_index) {
110 return static_cast<size_t>(codec_index) < NumberOfCodecs() 140 return static_cast<size_t>(codec_index) < NumberOfCodecs()
111 ? static_cast<RentACodec::CodecId>(codec_index) 141 ? static_cast<RentACodec::CodecId>(codec_index)
112 : rtc::Maybe<RentACodec::CodecId>(); 142 : rtc::Maybe<RentACodec::CodecId>();
113 } 143 }
114 144
115 static rtc::Maybe<CodecId> CodecIdByParams(const char* payload_name, 145 static rtc::Maybe<CodecId> CodecIdByParams(const char* payload_name,
116 int sampling_freq_hz, 146 int sampling_freq_hz,
117 int channels); 147 int channels);
118 static rtc::Maybe<CodecInst> CodecInstById(CodecId codec_id); 148 static rtc::Maybe<CodecInst> CodecInstById(CodecId codec_id);
119 static rtc::Maybe<CodecInst> CodecInstByParams(const char* payload_name, 149 static rtc::Maybe<CodecInst> CodecInstByParams(const char* payload_name,
120 int sampling_freq_hz, 150 int sampling_freq_hz,
121 int channels); 151 int channels);
122 static bool IsCodecValid(const CodecInst& codec_inst); 152 static bool IsCodecValid(const CodecInst& codec_inst);
123 static rtc::ArrayView<const CodecInst> Database(); 153 static rtc::ArrayView<const CodecInst> Database();
154
155 static rtc::Maybe<NetEqDecoder> NetEqDecoderFromCodecId(CodecId codec_id,
156 int num_channels);
124 }; 157 };
125 158
126 } // namespace acm2 159 } // namespace acm2
127 } // namespace webrtc 160 } // namespace webrtc
128 161
129 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_RENT_A_CODEC_H_ 162 #endif // WEBRTC_MODULES_AUDIO_CODING_MAIN_ACM2_RENT_A_CODEC_H_
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/main/acm2/acm_receiver.cc ('k') | webrtc/modules/audio_coding/main/acm2/rent_a_codec.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698