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

Side by Side Diff: webrtc/modules/audio_coding/neteq/decoder_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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 NetEqDecoder codec_type) const { 143 NetEqDecoder codec_type) const {
144 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type); 144 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type);
145 if (it == decoders_.end()) { 145 if (it == decoders_.end()) {
146 // Decoder not found. 146 // Decoder not found.
147 return false; 147 return false;
148 } 148 }
149 return ((*it).second.codec_type == codec_type); 149 return ((*it).second.codec_type == codec_type);
150 } 150 }
151 151
152 bool DecoderDatabase::IsComfortNoise(uint8_t rtp_payload_type) const { 152 bool DecoderDatabase::IsComfortNoise(uint8_t rtp_payload_type) const {
153 if (IsType(rtp_payload_type, kDecoderCNGnb) || 153 if (IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGnb) ||
154 IsType(rtp_payload_type, kDecoderCNGwb) || 154 IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGwb) ||
155 IsType(rtp_payload_type, kDecoderCNGswb32kHz) || 155 IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGswb32kHz) ||
156 IsType(rtp_payload_type, kDecoderCNGswb48kHz)) { 156 IsType(rtp_payload_type, NetEqDecoder::kDecoderCNGswb48kHz)) {
157 return true; 157 return true;
158 } else { 158 } else {
159 return false; 159 return false;
160 } 160 }
161 } 161 }
162 162
163 bool DecoderDatabase::IsDtmf(uint8_t rtp_payload_type) const { 163 bool DecoderDatabase::IsDtmf(uint8_t rtp_payload_type) const {
164 return IsType(rtp_payload_type, kDecoderAVT); 164 return IsType(rtp_payload_type, NetEqDecoder::kDecoderAVT);
165 } 165 }
166 166
167 bool DecoderDatabase::IsRed(uint8_t rtp_payload_type) const { 167 bool DecoderDatabase::IsRed(uint8_t rtp_payload_type) const {
168 return IsType(rtp_payload_type, kDecoderRED); 168 return IsType(rtp_payload_type, NetEqDecoder::kDecoderRED);
169 } 169 }
170 170
171 int DecoderDatabase::SetActiveDecoder(uint8_t rtp_payload_type, 171 int DecoderDatabase::SetActiveDecoder(uint8_t rtp_payload_type,
172 bool* new_decoder) { 172 bool* new_decoder) {
173 // Check that |rtp_payload_type| exists in the database. 173 // Check that |rtp_payload_type| exists in the database.
174 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type); 174 DecoderMap::const_iterator it = decoders_.find(rtp_payload_type);
175 if (it == decoders_.end()) { 175 if (it == decoders_.end()) {
176 // Decoder not found. 176 // Decoder not found.
177 return kDecoderNotFound; 177 return kDecoderNotFound;
178 } 178 }
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type " 251 LOG(LS_WARNING) << "CheckPayloadTypes: unknown RTP payload type "
252 << static_cast<int>((*it)->header.payloadType); 252 << static_cast<int>((*it)->header.payloadType);
253 return kDecoderNotFound; 253 return kDecoderNotFound;
254 } 254 }
255 } 255 }
256 return kOK; 256 return kOK;
257 } 257 }
258 258
259 259
260 } // namespace webrtc 260 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/decoder_database.h ('k') | webrtc/modules/audio_coding/neteq/decoder_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698