| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2008 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2008 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 stats.ext_seqnum = 789; | 473 stats.ext_seqnum = 789; |
| 474 stats.jitter_ms = 12; | 474 stats.jitter_ms = 12; |
| 475 stats.rtt_ms = 345; | 475 stats.rtt_ms = 345; |
| 476 stats.audio_level = 678; | 476 stats.audio_level = 678; |
| 477 stats.aec_quality_min = 9.01f; | 477 stats.aec_quality_min = 9.01f; |
| 478 stats.echo_delay_median_ms = 234; | 478 stats.echo_delay_median_ms = 234; |
| 479 stats.echo_delay_std_ms = 567; | 479 stats.echo_delay_std_ms = 567; |
| 480 stats.echo_return_loss = 890; | 480 stats.echo_return_loss = 890; |
| 481 stats.echo_return_loss_enhancement = 1234; | 481 stats.echo_return_loss_enhancement = 1234; |
| 482 stats.residual_echo_likelihood = 0.432f; | 482 stats.residual_echo_likelihood = 0.432f; |
| 483 stats.residual_echo_likelihood_recent_max = 0.6f; |
| 483 stats.typing_noise_detected = true; | 484 stats.typing_noise_detected = true; |
| 484 return stats; | 485 return stats; |
| 485 } | 486 } |
| 486 void SetAudioSendStreamStats() { | 487 void SetAudioSendStreamStats() { |
| 487 for (auto* s : call_.GetAudioSendStreams()) { | 488 for (auto* s : call_.GetAudioSendStreams()) { |
| 488 s->SetStats(GetAudioSendStreamStats()); | 489 s->SetStats(GetAudioSendStreamStats()); |
| 489 } | 490 } |
| 490 } | 491 } |
| 491 void VerifyVoiceSenderInfo(const cricket::VoiceSenderInfo& info, | 492 void VerifyVoiceSenderInfo(const cricket::VoiceSenderInfo& info, |
| 492 bool is_sending) { | 493 bool is_sending) { |
| 493 const auto stats = GetAudioSendStreamStats(); | 494 const auto stats = GetAudioSendStreamStats(); |
| 494 EXPECT_EQ(info.ssrc(), stats.local_ssrc); | 495 EXPECT_EQ(info.ssrc(), stats.local_ssrc); |
| 495 EXPECT_EQ(info.bytes_sent, stats.bytes_sent); | 496 EXPECT_EQ(info.bytes_sent, stats.bytes_sent); |
| 496 EXPECT_EQ(info.packets_sent, stats.packets_sent); | 497 EXPECT_EQ(info.packets_sent, stats.packets_sent); |
| 497 EXPECT_EQ(info.packets_lost, stats.packets_lost); | 498 EXPECT_EQ(info.packets_lost, stats.packets_lost); |
| 498 EXPECT_EQ(info.fraction_lost, stats.fraction_lost); | 499 EXPECT_EQ(info.fraction_lost, stats.fraction_lost); |
| 499 EXPECT_EQ(info.codec_name, stats.codec_name); | 500 EXPECT_EQ(info.codec_name, stats.codec_name); |
| 500 EXPECT_EQ(info.codec_payload_type, stats.codec_payload_type); | 501 EXPECT_EQ(info.codec_payload_type, stats.codec_payload_type); |
| 501 EXPECT_EQ(info.ext_seqnum, stats.ext_seqnum); | 502 EXPECT_EQ(info.ext_seqnum, stats.ext_seqnum); |
| 502 EXPECT_EQ(info.jitter_ms, stats.jitter_ms); | 503 EXPECT_EQ(info.jitter_ms, stats.jitter_ms); |
| 503 EXPECT_EQ(info.rtt_ms, stats.rtt_ms); | 504 EXPECT_EQ(info.rtt_ms, stats.rtt_ms); |
| 504 EXPECT_EQ(info.audio_level, stats.audio_level); | 505 EXPECT_EQ(info.audio_level, stats.audio_level); |
| 505 EXPECT_EQ(info.aec_quality_min, stats.aec_quality_min); | 506 EXPECT_EQ(info.aec_quality_min, stats.aec_quality_min); |
| 506 EXPECT_EQ(info.echo_delay_median_ms, stats.echo_delay_median_ms); | 507 EXPECT_EQ(info.echo_delay_median_ms, stats.echo_delay_median_ms); |
| 507 EXPECT_EQ(info.echo_delay_std_ms, stats.echo_delay_std_ms); | 508 EXPECT_EQ(info.echo_delay_std_ms, stats.echo_delay_std_ms); |
| 508 EXPECT_EQ(info.echo_return_loss, stats.echo_return_loss); | 509 EXPECT_EQ(info.echo_return_loss, stats.echo_return_loss); |
| 509 EXPECT_EQ(info.echo_return_loss_enhancement, | 510 EXPECT_EQ(info.echo_return_loss_enhancement, |
| 510 stats.echo_return_loss_enhancement); | 511 stats.echo_return_loss_enhancement); |
| 511 EXPECT_EQ(info.residual_echo_likelihood, stats.residual_echo_likelihood); | 512 EXPECT_EQ(info.residual_echo_likelihood, stats.residual_echo_likelihood); |
| 513 EXPECT_EQ(info.residual_echo_likelihood_recent_max, |
| 514 stats.residual_echo_likelihood_recent_max); |
| 512 EXPECT_EQ(info.typing_noise_detected, | 515 EXPECT_EQ(info.typing_noise_detected, |
| 513 stats.typing_noise_detected && is_sending); | 516 stats.typing_noise_detected && is_sending); |
| 514 } | 517 } |
| 515 | 518 |
| 516 webrtc::AudioReceiveStream::Stats GetAudioReceiveStreamStats() const { | 519 webrtc::AudioReceiveStream::Stats GetAudioReceiveStreamStats() const { |
| 517 webrtc::AudioReceiveStream::Stats stats; | 520 webrtc::AudioReceiveStream::Stats stats; |
| 518 stats.remote_ssrc = 123; | 521 stats.remote_ssrc = 123; |
| 519 stats.bytes_rcvd = 456; | 522 stats.bytes_rcvd = 456; |
| 520 stats.packets_rcvd = 768; | 523 stats.packets_rcvd = 768; |
| 521 stats.packets_lost = 101; | 524 stats.packets_lost = 101; |
| (...skipping 3151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3673 nullptr, webrtc::CreateBuiltinAudioDecoderFactory(), nullptr); | 3676 nullptr, webrtc::CreateBuiltinAudioDecoderFactory(), nullptr); |
| 3674 webrtc::RtcEventLogNullImpl event_log; | 3677 webrtc::RtcEventLogNullImpl event_log; |
| 3675 std::unique_ptr<webrtc::Call> call( | 3678 std::unique_ptr<webrtc::Call> call( |
| 3676 webrtc::Call::Create(webrtc::Call::Config(&event_log))); | 3679 webrtc::Call::Create(webrtc::Call::Config(&event_log))); |
| 3677 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), | 3680 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), |
| 3678 cricket::AudioOptions(), call.get()); | 3681 cricket::AudioOptions(), call.get()); |
| 3679 cricket::AudioRecvParameters parameters; | 3682 cricket::AudioRecvParameters parameters; |
| 3680 parameters.codecs = engine.recv_codecs(); | 3683 parameters.codecs = engine.recv_codecs(); |
| 3681 EXPECT_TRUE(channel.SetRecvParameters(parameters)); | 3684 EXPECT_TRUE(channel.SetRecvParameters(parameters)); |
| 3682 } | 3685 } |
| OLD | NEW |