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

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

Issue 3004783003: neteq_rtpplay: Add one more RTP header extension and fix some stats (Closed)
Patch Set: Created 3 years, 3 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
« no previous file with comments | « no previous file | 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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 "Only use packets with this SSRC (decimal or hex, the latter " 154 "Only use packets with this SSRC (decimal or hex, the latter "
155 "starting with 0x)"); 155 "starting with 0x)");
156 const bool hex_ssrc_dummy = 156 const bool hex_ssrc_dummy =
157 google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrcValue); 157 google::RegisterFlagValidator(&FLAGS_ssrc, &ValidateSsrcValue);
158 DEFINE_int32(audio_level, 1, "Extension ID for audio level (RFC 6464)"); 158 DEFINE_int32(audio_level, 1, "Extension ID for audio level (RFC 6464)");
159 const bool audio_level_dummy = 159 const bool audio_level_dummy =
160 google::RegisterFlagValidator(&FLAGS_audio_level, &ValidateExtensionId); 160 google::RegisterFlagValidator(&FLAGS_audio_level, &ValidateExtensionId);
161 DEFINE_int32(abs_send_time, 3, "Extension ID for absolute sender time"); 161 DEFINE_int32(abs_send_time, 3, "Extension ID for absolute sender time");
162 const bool abs_send_time_dummy = 162 const bool abs_send_time_dummy =
163 google::RegisterFlagValidator(&FLAGS_abs_send_time, &ValidateExtensionId); 163 google::RegisterFlagValidator(&FLAGS_abs_send_time, &ValidateExtensionId);
164 DEFINE_int32(transport_seq_no, 5, "Extension ID for transport sequence number");
165 const bool transport_seq_no_dummy =
166 google::RegisterFlagValidator(&FLAGS_transport_seq_no,
167 &ValidateExtensionId);
164 DEFINE_bool(matlabplot, 168 DEFINE_bool(matlabplot,
165 false, 169 false,
166 "Generates a matlab script for plotting the delay profile"); 170 "Generates a matlab script for plotting the delay profile");
167 171
168 // Maps a codec type to a printable name string. 172 // Maps a codec type to a printable name string.
169 std::string CodecName(NetEqDecoder codec) { 173 std::string CodecName(NetEqDecoder codec) {
170 switch (codec) { 174 switch (codec) {
171 case NetEqDecoder::kDecoderPCMu: 175 case NetEqDecoder::kDecoderPCMu:
172 return "PCM-u"; 176 return "PCM-u";
173 case NetEqDecoder::kDecoderPCMa: 177 case NetEqDecoder::kDecoderPCMa:
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 a.expand_rate += b.expand_rate / 16384.0; 417 a.expand_rate += b.expand_rate / 16384.0;
414 a.speech_expand_rate += b.speech_expand_rate / 16384.0; 418 a.speech_expand_rate += b.speech_expand_rate / 16384.0;
415 a.preemptive_rate += b.preemptive_rate / 16384.0; 419 a.preemptive_rate += b.preemptive_rate / 16384.0;
416 a.accelerate_rate += b.accelerate_rate / 16384.0; 420 a.accelerate_rate += b.accelerate_rate / 16384.0;
417 a.secondary_decoded_rate += b.secondary_decoded_rate / 16384.0; 421 a.secondary_decoded_rate += b.secondary_decoded_rate / 16384.0;
418 a.secondary_discarded_rate += b.secondary_discarded_rate / 16384.0; 422 a.secondary_discarded_rate += b.secondary_discarded_rate / 16384.0;
419 a.clockdrift_ppm += b.clockdrift_ppm; 423 a.clockdrift_ppm += b.clockdrift_ppm;
420 a.added_zero_samples += b.added_zero_samples; 424 a.added_zero_samples += b.added_zero_samples;
421 a.mean_waiting_time_ms += b.mean_waiting_time_ms; 425 a.mean_waiting_time_ms += b.mean_waiting_time_ms;
422 a.median_waiting_time_ms += b.median_waiting_time_ms; 426 a.median_waiting_time_ms += b.median_waiting_time_ms;
423 a.min_waiting_time_ms += b.min_waiting_time_ms; 427 a.min_waiting_time_ms =
424 a.max_waiting_time_ms += b.max_waiting_time_ms; 428 std::min(a.min_waiting_time_ms,
429 static_cast<double>(b.min_waiting_time_ms));
430 a.max_waiting_time_ms =
431 std::max(a.max_waiting_time_ms,
432 static_cast<double>(b.max_waiting_time_ms));
425 return a; 433 return a;
426 }); 434 });
427 435
428 sum_stats.current_buffer_size_ms /= stats_.size(); 436 sum_stats.current_buffer_size_ms /= stats_.size();
429 sum_stats.preferred_buffer_size_ms /= stats_.size(); 437 sum_stats.preferred_buffer_size_ms /= stats_.size();
430 sum_stats.jitter_peaks_found /= stats_.size(); 438 sum_stats.jitter_peaks_found /= stats_.size();
431 sum_stats.packet_loss_rate /= stats_.size(); 439 sum_stats.packet_loss_rate /= stats_.size();
432 sum_stats.expand_rate /= stats_.size(); 440 sum_stats.expand_rate /= stats_.size();
433 sum_stats.speech_expand_rate /= stats_.size(); 441 sum_stats.speech_expand_rate /= stats_.size();
434 sum_stats.preemptive_rate /= stats_.size(); 442 sum_stats.preemptive_rate /= stats_.size();
435 sum_stats.accelerate_rate /= stats_.size(); 443 sum_stats.accelerate_rate /= stats_.size();
436 sum_stats.secondary_decoded_rate /= stats_.size(); 444 sum_stats.secondary_decoded_rate /= stats_.size();
437 sum_stats.secondary_discarded_rate /= stats_.size(); 445 sum_stats.secondary_discarded_rate /= stats_.size();
438 sum_stats.clockdrift_ppm /= stats_.size(); 446 sum_stats.clockdrift_ppm /= stats_.size();
439 sum_stats.added_zero_samples /= stats_.size(); 447 sum_stats.added_zero_samples /= stats_.size();
440 sum_stats.mean_waiting_time_ms /= stats_.size(); 448 sum_stats.mean_waiting_time_ms /= stats_.size();
441 sum_stats.median_waiting_time_ms /= stats_.size(); 449 sum_stats.median_waiting_time_ms /= stats_.size();
442 sum_stats.min_waiting_time_ms /= stats_.size();
443 sum_stats.max_waiting_time_ms /= stats_.size();
444 450
445 return sum_stats; 451 return sum_stats;
446 } 452 }
447 453
448 private: 454 private:
449 NetEqGetAudioCallback* other_callback_; 455 NetEqGetAudioCallback* other_callback_;
450 size_t counter_ = 0; 456 size_t counter_ = 0;
451 std::vector<NetEqNetworkStatistics> stats_; 457 std::vector<NetEqNetworkStatistics> stats_;
452 }; 458 };
453 459
(...skipping 16 matching lines...) Expand all
470 return 0; 476 return 0;
471 } 477 }
472 // Print usage information. 478 // Print usage information.
473 std::cout << google::ProgramUsage(); 479 std::cout << google::ProgramUsage();
474 return 0; 480 return 0;
475 } 481 }
476 482
477 // Gather RTP header extensions in a map. 483 // Gather RTP header extensions in a map.
478 NetEqPacketSourceInput::RtpHeaderExtensionMap rtp_ext_map = { 484 NetEqPacketSourceInput::RtpHeaderExtensionMap rtp_ext_map = {
479 {FLAGS_audio_level, kRtpExtensionAudioLevel}, 485 {FLAGS_audio_level, kRtpExtensionAudioLevel},
480 {FLAGS_abs_send_time, kRtpExtensionAbsoluteSendTime}}; 486 {FLAGS_abs_send_time, kRtpExtensionAbsoluteSendTime},
487 {FLAGS_transport_seq_no, kRtpExtensionTransportSequenceNumber}};
481 488
482 const std::string input_file_name = argv[1]; 489 const std::string input_file_name = argv[1];
483 std::unique_ptr<NetEqInput> input; 490 std::unique_ptr<NetEqInput> input;
484 if (RtpFileSource::ValidRtpDump(input_file_name) || 491 if (RtpFileSource::ValidRtpDump(input_file_name) ||
485 RtpFileSource::ValidPcap(input_file_name)) { 492 RtpFileSource::ValidPcap(input_file_name)) {
486 input.reset(new NetEqRtpDumpInput(input_file_name, rtp_ext_map)); 493 input.reset(new NetEqRtpDumpInput(input_file_name, rtp_ext_map));
487 } else { 494 } else {
488 input.reset(new NetEqEventLogInput(input_file_name, rtp_ext_map)); 495 input.reset(new NetEqEventLogInput(input_file_name, rtp_ext_map));
489 } 496 }
490 497
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 return 0; 671 return 0;
665 } 672 }
666 673
667 } // namespace 674 } // namespace
668 } // namespace test 675 } // namespace test
669 } // namespace webrtc 676 } // namespace webrtc
670 677
671 int main(int argc, char* argv[]) { 678 int main(int argc, char* argv[]) {
672 webrtc::test::RunTest(argc, argv); 679 webrtc::test::RunTest(argc, argv);
673 } 680 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698