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

Side by Side Diff: webrtc/modules/audio_coding/neteq/tools/neteq_rtpplay.cc

Issue 1484343003: NetEq: Add codec name and RTP timestamp rate to DecoderInfo (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase Created 5 years 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
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 case webrtc::NetEqDecoder::kDecoderCNGswb48kHz: 182 case webrtc::NetEqDecoder::kDecoderCNGswb48kHz:
183 return "comfort noise (48 kHz)"; 183 return "comfort noise (48 kHz)";
184 default: 184 default:
185 assert(false); 185 assert(false);
186 return "undefined"; 186 return "undefined";
187 } 187 }
188 } 188 }
189 189
190 void RegisterPayloadType(NetEq* neteq, 190 void RegisterPayloadType(NetEq* neteq,
191 webrtc::NetEqDecoder codec, 191 webrtc::NetEqDecoder codec,
192 const std::string& name,
192 google::int32 flag) { 193 google::int32 flag) {
193 if (neteq->RegisterPayloadType(codec, static_cast<uint8_t>(flag))) { 194 if (neteq->RegisterPayloadType(codec, name, static_cast<uint8_t>(flag))) {
194 std::cerr << "Cannot register payload type " << flag << " as " 195 std::cerr << "Cannot register payload type " << flag << " as "
195 << CodecName(codec) << std::endl; 196 << CodecName(codec) << std::endl;
196 exit(1); 197 exit(1);
197 } 198 }
198 } 199 }
199 200
200 // Registers all decoders in |neteq|. 201 // Registers all decoders in |neteq|.
201 void RegisterPayloadTypes(NetEq* neteq) { 202 void RegisterPayloadTypes(NetEq* neteq) {
202 assert(neteq); 203 assert(neteq);
203 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMu, FLAGS_pcmu); 204 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMu, "pcmu",
204 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMa, FLAGS_pcma); 205 FLAGS_pcmu);
205 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderILBC, FLAGS_ilbc); 206 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCMa, "pcma",
206 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISAC, FLAGS_isac); 207 FLAGS_pcma);
207 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISACswb, 208 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderILBC, "ilbc",
209 FLAGS_ilbc);
210 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISAC, "isac",
211 FLAGS_isac);
212 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderISACswb, "isac-swb",
208 FLAGS_isac_swb); 213 FLAGS_isac_swb);
209 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderOpus, FLAGS_opus); 214 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderOpus, "opus",
210 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16B, 215 FLAGS_opus);
216 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16B, "pcm16-nb",
211 FLAGS_pcm16b); 217 FLAGS_pcm16b);
212 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bwb, 218 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bwb, "pcm16-wb",
213 FLAGS_pcm16b_wb); 219 FLAGS_pcm16b_wb);
214 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz, 220 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb32kHz,
215 FLAGS_pcm16b_swb32); 221 "pcm16-swb32", FLAGS_pcm16b_swb32);
216 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz, 222 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderPCM16Bswb48kHz,
217 FLAGS_pcm16b_swb48); 223 "pcm16-swb48", FLAGS_pcm16b_swb48);
218 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderG722, FLAGS_g722); 224 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderG722, "g722",
219 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderAVT, FLAGS_avt); 225 FLAGS_g722);
220 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderRED, FLAGS_red); 226 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderAVT, "avt",
221 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGnb, FLAGS_cn_nb); 227 FLAGS_avt);
222 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGwb, FLAGS_cn_wb); 228 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderRED, "red",
229 FLAGS_red);
230 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGnb, "cng-nb",
231 FLAGS_cn_nb);
232 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGwb, "cng-wb",
233 FLAGS_cn_wb);
223 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb32kHz, 234 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb32kHz,
224 FLAGS_cn_swb32); 235 "cng-swb32", FLAGS_cn_swb32);
225 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb48kHz, 236 RegisterPayloadType(neteq, webrtc::NetEqDecoder::kDecoderCNGswb48kHz,
226 FLAGS_cn_swb48); 237 "cng-swb48", FLAGS_cn_swb48);
227 } 238 }
228 239
229 void PrintCodecMappingEntry(webrtc::NetEqDecoder codec, google::int32 flag) { 240 void PrintCodecMappingEntry(webrtc::NetEqDecoder codec, google::int32 flag) {
230 std::cout << CodecName(codec) << ": " << flag << std::endl; 241 std::cout << CodecName(codec) << ": " << flag << std::endl;
231 } 242 }
232 243
233 void PrintCodecMapping() { 244 void PrintCodecMapping() {
234 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMu, FLAGS_pcmu); 245 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMu, FLAGS_pcmu);
235 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMa, FLAGS_pcma); 246 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderPCMa, FLAGS_pcma);
236 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderILBC, FLAGS_ilbc); 247 PrintCodecMappingEntry(webrtc::NetEqDecoder::kDecoderILBC, FLAGS_ilbc);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
631 } 642 }
632 } 643 }
633 printf("Simulation done\n"); 644 printf("Simulation done\n");
634 printf("Produced %i ms of audio\n", 645 printf("Produced %i ms of audio\n",
635 static_cast<int>(time_now_ms - start_time_ms)); 646 static_cast<int>(time_now_ms - start_time_ms));
636 647
637 delete neteq; 648 delete neteq;
638 webrtc::Trace::ReturnTrace(); 649 webrtc::Trace::ReturnTrace();
639 return 0; 650 return 0;
640 } 651 }
OLDNEW
« no previous file with comments | « webrtc/modules/audio_coding/neteq/tools/neteq_quality_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698