OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2014 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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 EXPECT_TRUE(GetValue(report, StatsReport::kStatsValueNameAnaDtxActionCounter, | 447 EXPECT_TRUE(GetValue(report, StatsReport::kStatsValueNameAnaDtxActionCounter, |
448 &value_in_report)); | 448 &value_in_report)); |
449 ASSERT_TRUE(sinfo.ana_statistics.dtx_action_counter); | 449 ASSERT_TRUE(sinfo.ana_statistics.dtx_action_counter); |
450 EXPECT_EQ(rtc::ToString<uint32_t>(*sinfo.ana_statistics.dtx_action_counter), | 450 EXPECT_EQ(rtc::ToString<uint32_t>(*sinfo.ana_statistics.dtx_action_counter), |
451 value_in_report); | 451 value_in_report); |
452 EXPECT_TRUE(GetValue(report, StatsReport::kStatsValueNameAnaFecActionCounter, | 452 EXPECT_TRUE(GetValue(report, StatsReport::kStatsValueNameAnaFecActionCounter, |
453 &value_in_report)); | 453 &value_in_report)); |
454 ASSERT_TRUE(sinfo.ana_statistics.fec_action_counter); | 454 ASSERT_TRUE(sinfo.ana_statistics.fec_action_counter); |
455 EXPECT_EQ(rtc::ToString<uint32_t>(*sinfo.ana_statistics.fec_action_counter), | 455 EXPECT_EQ(rtc::ToString<uint32_t>(*sinfo.ana_statistics.fec_action_counter), |
456 value_in_report); | 456 value_in_report); |
| 457 EXPECT_TRUE(GetValue( |
| 458 report, StatsReport::kStatsValueNameAnaFrameLengthIncreaseCounter, |
| 459 &value_in_report)); |
| 460 ASSERT_TRUE(sinfo.ana_statistics.frame_length_increase_counter); |
| 461 EXPECT_EQ(rtc::ToString<uint32_t>( |
| 462 *sinfo.ana_statistics.frame_length_increase_counter), |
| 463 value_in_report); |
| 464 EXPECT_TRUE(GetValue( |
| 465 report, StatsReport::kStatsValueNameAnaFrameLengthDecreaseCounter, |
| 466 &value_in_report)); |
| 467 ASSERT_TRUE(sinfo.ana_statistics.frame_length_decrease_counter); |
| 468 EXPECT_EQ(rtc::ToString<uint32_t>( |
| 469 *sinfo.ana_statistics.frame_length_decrease_counter), |
| 470 value_in_report); |
457 EXPECT_TRUE(GetValue(report, | 471 EXPECT_TRUE(GetValue(report, |
458 StatsReport::kStatsValueNameAnaFrameLengthActionCounter, | 472 StatsReport::kStatsValueNameAnaUplinkPacketLossFraction, |
459 &value_in_report)); | 473 &value_in_report)); |
460 ASSERT_TRUE(sinfo.ana_statistics.frame_length_action_counter); | 474 ASSERT_TRUE(sinfo.ana_statistics.uplink_packet_loss_fraction); |
461 EXPECT_EQ(rtc::ToString<uint32_t>( | 475 EXPECT_EQ( |
462 *sinfo.ana_statistics.frame_length_action_counter), | 476 rtc::ToString<float>(*sinfo.ana_statistics.uplink_packet_loss_fraction), |
463 value_in_report); | 477 value_in_report); |
464 } | 478 } |
465 | 479 |
466 // Helper methods to avoid duplication of code. | 480 // Helper methods to avoid duplication of code. |
467 void InitVoiceSenderInfo(cricket::VoiceSenderInfo* voice_sender_info) { | 481 void InitVoiceSenderInfo(cricket::VoiceSenderInfo* voice_sender_info) { |
468 voice_sender_info->add_ssrc(kSsrcOfTrack); | 482 voice_sender_info->add_ssrc(kSsrcOfTrack); |
469 voice_sender_info->codec_name = "fake_codec"; | 483 voice_sender_info->codec_name = "fake_codec"; |
470 voice_sender_info->bytes_sent = 100; | 484 voice_sender_info->bytes_sent = 100; |
471 voice_sender_info->packets_sent = 101; | 485 voice_sender_info->packets_sent = 101; |
472 voice_sender_info->rtt_ms = 102; | 486 voice_sender_info->rtt_ms = 102; |
473 voice_sender_info->fraction_lost = 103; | 487 voice_sender_info->fraction_lost = 103; |
474 voice_sender_info->jitter_ms = 104; | 488 voice_sender_info->jitter_ms = 104; |
475 voice_sender_info->packets_lost = 105; | 489 voice_sender_info->packets_lost = 105; |
476 voice_sender_info->ext_seqnum = 106; | 490 voice_sender_info->ext_seqnum = 106; |
477 voice_sender_info->audio_level = 107; | 491 voice_sender_info->audio_level = 107; |
478 voice_sender_info->echo_return_loss = 108; | 492 voice_sender_info->echo_return_loss = 108; |
479 voice_sender_info->echo_return_loss_enhancement = 109; | 493 voice_sender_info->echo_return_loss_enhancement = 109; |
480 voice_sender_info->echo_delay_median_ms = 110; | 494 voice_sender_info->echo_delay_median_ms = 110; |
481 voice_sender_info->echo_delay_std_ms = 111; | 495 voice_sender_info->echo_delay_std_ms = 111; |
482 voice_sender_info->aec_quality_min = 112.0f; | 496 voice_sender_info->aec_quality_min = 112.0f; |
483 voice_sender_info->typing_noise_detected = false; | 497 voice_sender_info->typing_noise_detected = false; |
484 voice_sender_info->ana_statistics.bitrate_action_counter = | 498 voice_sender_info->ana_statistics.bitrate_action_counter = |
485 rtc::Optional<uint32_t>(113); | 499 rtc::Optional<uint32_t>(113); |
486 voice_sender_info->ana_statistics.channel_action_counter = | 500 voice_sender_info->ana_statistics.channel_action_counter = |
487 rtc::Optional<uint32_t>(114); | 501 rtc::Optional<uint32_t>(114); |
488 voice_sender_info->ana_statistics.dtx_action_counter = | 502 voice_sender_info->ana_statistics.dtx_action_counter = |
489 rtc::Optional<uint32_t>(115); | 503 rtc::Optional<uint32_t>(115); |
490 voice_sender_info->ana_statistics.fec_action_counter = | 504 voice_sender_info->ana_statistics.fec_action_counter = |
491 rtc::Optional<uint32_t>(116); | 505 rtc::Optional<uint32_t>(116); |
492 voice_sender_info->ana_statistics.frame_length_action_counter = | 506 voice_sender_info->ana_statistics.frame_length_increase_counter = |
493 rtc::Optional<uint32_t>(117); | 507 rtc::Optional<uint32_t>(117); |
| 508 voice_sender_info->ana_statistics.frame_length_decrease_counter = |
| 509 rtc::Optional<uint32_t>(118); |
| 510 voice_sender_info->ana_statistics.uplink_packet_loss_fraction = |
| 511 rtc::Optional<float>(119.0); |
494 } | 512 } |
495 | 513 |
496 void UpdateVoiceSenderInfoFromAudioTrack( | 514 void UpdateVoiceSenderInfoFromAudioTrack( |
497 AudioTrackInterface* audio_track, | 515 AudioTrackInterface* audio_track, |
498 cricket::VoiceSenderInfo* voice_sender_info) { | 516 cricket::VoiceSenderInfo* voice_sender_info) { |
499 audio_track->GetSignalLevel(&voice_sender_info->audio_level); | 517 audio_track->GetSignalLevel(&voice_sender_info->audio_level); |
500 webrtc::AudioProcessorInterface::AudioProcessorStats audio_processor_stats; | 518 webrtc::AudioProcessorInterface::AudioProcessorStats audio_processor_stats; |
501 audio_track->GetAudioProcessor()->GetStats(&audio_processor_stats); | 519 audio_track->GetAudioProcessor()->GetStats(&audio_processor_stats); |
502 voice_sender_info->typing_noise_detected = | 520 voice_sender_info->typing_noise_detected = |
503 audio_processor_stats.typing_noise_detected; | 521 audio_processor_stats.typing_noise_detected; |
(...skipping 1647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2151 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); | 2169 stats.UpdateStats(PeerConnectionInterface::kStatsOutputLevelStandard); |
2152 stats.GetStats(NULL, &reports); | 2170 stats.GetStats(NULL, &reports); |
2153 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), | 2171 EXPECT_EQ(rtc::ToString(video_receiver_info.frames_decoded), |
2154 ExtractSsrcStatsValue(reports, | 2172 ExtractSsrcStatsValue(reports, |
2155 StatsReport::kStatsValueNameFramesDecoded)); | 2173 StatsReport::kStatsValueNameFramesDecoded)); |
2156 EXPECT_EQ(rtc::ToString(*video_receiver_info.qp_sum), | 2174 EXPECT_EQ(rtc::ToString(*video_receiver_info.qp_sum), |
2157 ExtractSsrcStatsValue(reports, StatsReport::kStatsValueNameQpSum)); | 2175 ExtractSsrcStatsValue(reports, StatsReport::kStatsValueNameQpSum)); |
2158 } | 2176 } |
2159 | 2177 |
2160 } // namespace webrtc | 2178 } // namespace webrtc |
OLD | NEW |