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

Side by Side Diff: webrtc/media/engine/webrtcvoiceengine_unittest.cc

Issue 2341293002: Add new decoding statistics for muted output (Closed)
Patch Set: Updates after reviews Created 4 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
OLDNEW
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 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 stats.speech_expand_rate = 8.90f; 443 stats.speech_expand_rate = 8.90f;
444 stats.secondary_decoded_rate = 1.23f; 444 stats.secondary_decoded_rate = 1.23f;
445 stats.accelerate_rate = 4.56f; 445 stats.accelerate_rate = 4.56f;
446 stats.preemptive_expand_rate = 7.89f; 446 stats.preemptive_expand_rate = 7.89f;
447 stats.decoding_calls_to_silence_generator = 12; 447 stats.decoding_calls_to_silence_generator = 12;
448 stats.decoding_calls_to_neteq = 345; 448 stats.decoding_calls_to_neteq = 345;
449 stats.decoding_normal = 67890; 449 stats.decoding_normal = 67890;
450 stats.decoding_plc = 1234; 450 stats.decoding_plc = 1234;
451 stats.decoding_cng = 5678; 451 stats.decoding_cng = 5678;
452 stats.decoding_plc_cng = 9012; 452 stats.decoding_plc_cng = 9012;
453 stats.capture_start_ntp_time_ms = 3456; 453 stats.decoding_muted_output = 3456;
454 stats.capture_start_ntp_time_ms = 7890;
454 return stats; 455 return stats;
455 } 456 }
456 void SetAudioReceiveStreamStats() { 457 void SetAudioReceiveStreamStats() {
457 for (auto* s : call_.GetAudioReceiveStreams()) { 458 for (auto* s : call_.GetAudioReceiveStreams()) {
458 s->SetStats(GetAudioReceiveStreamStats()); 459 s->SetStats(GetAudioReceiveStreamStats());
459 } 460 }
460 } 461 }
461 void VerifyVoiceReceiverInfo(const cricket::VoiceReceiverInfo& info) { 462 void VerifyVoiceReceiverInfo(const cricket::VoiceReceiverInfo& info) {
462 const auto stats = GetAudioReceiveStreamStats(); 463 const auto stats = GetAudioReceiveStreamStats();
463 EXPECT_EQ(info.ssrc(), stats.remote_ssrc); 464 EXPECT_EQ(info.ssrc(), stats.remote_ssrc);
(...skipping 14 matching lines...) Expand all
478 EXPECT_EQ(info.secondary_decoded_rate, stats.secondary_decoded_rate); 479 EXPECT_EQ(info.secondary_decoded_rate, stats.secondary_decoded_rate);
479 EXPECT_EQ(info.accelerate_rate, stats.accelerate_rate); 480 EXPECT_EQ(info.accelerate_rate, stats.accelerate_rate);
480 EXPECT_EQ(info.preemptive_expand_rate, stats.preemptive_expand_rate); 481 EXPECT_EQ(info.preemptive_expand_rate, stats.preemptive_expand_rate);
481 EXPECT_EQ(info.decoding_calls_to_silence_generator, 482 EXPECT_EQ(info.decoding_calls_to_silence_generator,
482 stats.decoding_calls_to_silence_generator); 483 stats.decoding_calls_to_silence_generator);
483 EXPECT_EQ(info.decoding_calls_to_neteq, stats.decoding_calls_to_neteq); 484 EXPECT_EQ(info.decoding_calls_to_neteq, stats.decoding_calls_to_neteq);
484 EXPECT_EQ(info.decoding_normal, stats.decoding_normal); 485 EXPECT_EQ(info.decoding_normal, stats.decoding_normal);
485 EXPECT_EQ(info.decoding_plc, stats.decoding_plc); 486 EXPECT_EQ(info.decoding_plc, stats.decoding_plc);
486 EXPECT_EQ(info.decoding_cng, stats.decoding_cng); 487 EXPECT_EQ(info.decoding_cng, stats.decoding_cng);
487 EXPECT_EQ(info.decoding_plc_cng, stats.decoding_plc_cng); 488 EXPECT_EQ(info.decoding_plc_cng, stats.decoding_plc_cng);
489 EXPECT_EQ(info.decoding_muted_output, stats.decoding_muted_output);
488 EXPECT_EQ(info.capture_start_ntp_time_ms, stats.capture_start_ntp_time_ms); 490 EXPECT_EQ(info.capture_start_ntp_time_ms, stats.capture_start_ntp_time_ms);
489 } 491 }
490 492
491 protected: 493 protected:
492 StrictMock<webrtc::test::MockAudioDeviceModule> adm_; 494 StrictMock<webrtc::test::MockAudioDeviceModule> adm_;
493 cricket::FakeCall call_; 495 cricket::FakeCall call_;
494 cricket::FakeWebRtcVoiceEngine voe_; 496 cricket::FakeWebRtcVoiceEngine voe_;
495 std::unique_ptr<cricket::WebRtcVoiceEngine> engine_; 497 std::unique_ptr<cricket::WebRtcVoiceEngine> engine_;
496 cricket::VoiceMediaChannel* channel_ = nullptr; 498 cricket::VoiceMediaChannel* channel_ = nullptr;
497 cricket::AudioSendParameters send_parameters_; 499 cricket::AudioSendParameters send_parameters_;
(...skipping 2993 matching lines...) Expand 10 before | Expand all | Expand 10 after
3491 cricket::WebRtcVoiceEngine engine( 3493 cricket::WebRtcVoiceEngine engine(
3492 nullptr, webrtc::CreateBuiltinAudioDecoderFactory()); 3494 nullptr, webrtc::CreateBuiltinAudioDecoderFactory());
3493 std::unique_ptr<webrtc::Call> call( 3495 std::unique_ptr<webrtc::Call> call(
3494 webrtc::Call::Create(webrtc::Call::Config())); 3496 webrtc::Call::Create(webrtc::Call::Config()));
3495 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(), 3497 cricket::WebRtcVoiceMediaChannel channel(&engine, cricket::MediaConfig(),
3496 cricket::AudioOptions(), call.get()); 3498 cricket::AudioOptions(), call.get());
3497 cricket::AudioRecvParameters parameters; 3499 cricket::AudioRecvParameters parameters;
3498 parameters.codecs = engine.recv_codecs(); 3500 parameters.codecs = engine.recv_codecs();
3499 EXPECT_TRUE(channel.SetRecvParameters(parameters)); 3501 EXPECT_TRUE(channel.SetRecvParameters(parameters));
3500 } 3502 }
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvoiceengine.cc ('k') | webrtc/modules/audio_coding/acm2/acm_receiver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698