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

Side by Side Diff: webrtc/audio/audio_send_stream_unittest.cc

Issue 2431443003: Add a placeholder stat for logging the estimated residual echo likelihood. (Closed)
Patch Set: Fredrik's comments. Created 4 years, 2 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 | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | 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) 2015 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2015 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 23 matching lines...) Expand all
34 const int kChannelId = 1; 34 const int kChannelId = 1;
35 const uint32_t kSsrc = 1234; 35 const uint32_t kSsrc = 1234;
36 const char* kCName = "foo_name"; 36 const char* kCName = "foo_name";
37 const int kAudioLevelId = 2; 37 const int kAudioLevelId = 2;
38 const int kAbsSendTimeId = 3; 38 const int kAbsSendTimeId = 3;
39 const int kTransportSequenceNumberId = 4; 39 const int kTransportSequenceNumberId = 4;
40 const int kEchoDelayMedian = 254; 40 const int kEchoDelayMedian = 254;
41 const int kEchoDelayStdDev = -3; 41 const int kEchoDelayStdDev = -3;
42 const int kEchoReturnLoss = -65; 42 const int kEchoReturnLoss = -65;
43 const int kEchoReturnLossEnhancement = 101; 43 const int kEchoReturnLossEnhancement = 101;
44 const float kResidualEchoLikelihood = 0.0f;
44 const unsigned int kSpeechInputLevel = 96; 45 const unsigned int kSpeechInputLevel = 96;
45 const CallStatistics kCallStats = { 46 const CallStatistics kCallStats = {
46 1345, 1678, 1901, 1234, 112, 13456, 17890, 1567, -1890, -1123}; 47 1345, 1678, 1901, 1234, 112, 13456, 17890, 1567, -1890, -1123};
47 const CodecInst kCodecInst = {-121, "codec_name_send", 48000, -231, 0, -671}; 48 const CodecInst kCodecInst = {-121, "codec_name_send", 48000, -231, 0, -671};
48 const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354}; 49 const ReportBlock kReportBlock = {456, 780, 123, 567, 890, 132, 143, 13354};
49 const int kTelephoneEventPayloadType = 123; 50 const int kTelephoneEventPayloadType = 123;
50 const int kTelephoneEventCode = 45; 51 const int kTelephoneEventCode = 45;
51 const int kTelephoneEventDuration = 6789; 52 const int kTelephoneEventDuration = 6789;
52 53
53 class MockLimitObserver : public BitrateAllocator::LimitObserver { 54 class MockLimitObserver : public BitrateAllocator::LimitObserver {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 EXPECT_EQ(static_cast<int32_t>(kReportBlock.interarrival_jitter / 260 EXPECT_EQ(static_cast<int32_t>(kReportBlock.interarrival_jitter /
260 (kCodecInst.plfreq / 1000)), 261 (kCodecInst.plfreq / 1000)),
261 stats.jitter_ms); 262 stats.jitter_ms);
262 EXPECT_EQ(kCallStats.rttMs, stats.rtt_ms); 263 EXPECT_EQ(kCallStats.rttMs, stats.rtt_ms);
263 EXPECT_EQ(static_cast<int32_t>(kSpeechInputLevel), stats.audio_level); 264 EXPECT_EQ(static_cast<int32_t>(kSpeechInputLevel), stats.audio_level);
264 EXPECT_EQ(-1, stats.aec_quality_min); 265 EXPECT_EQ(-1, stats.aec_quality_min);
265 EXPECT_EQ(kEchoDelayMedian, stats.echo_delay_median_ms); 266 EXPECT_EQ(kEchoDelayMedian, stats.echo_delay_median_ms);
266 EXPECT_EQ(kEchoDelayStdDev, stats.echo_delay_std_ms); 267 EXPECT_EQ(kEchoDelayStdDev, stats.echo_delay_std_ms);
267 EXPECT_EQ(kEchoReturnLoss, stats.echo_return_loss); 268 EXPECT_EQ(kEchoReturnLoss, stats.echo_return_loss);
268 EXPECT_EQ(kEchoReturnLossEnhancement, stats.echo_return_loss_enhancement); 269 EXPECT_EQ(kEchoReturnLossEnhancement, stats.echo_return_loss_enhancement);
270 EXPECT_EQ(kResidualEchoLikelihood, stats.residual_echo_likelihood);
269 EXPECT_FALSE(stats.typing_noise_detected); 271 EXPECT_FALSE(stats.typing_noise_detected);
270 } 272 }
271 273
272 TEST(AudioSendStreamTest, GetStatsTypingNoiseDetected) { 274 TEST(AudioSendStreamTest, GetStatsTypingNoiseDetected) {
273 ConfigHelper helper; 275 ConfigHelper helper;
274 internal::AudioSendStream send_stream( 276 internal::AudioSendStream send_stream(
275 helper.config(), helper.audio_state(), helper.worker_queue(), 277 helper.config(), helper.audio_state(), helper.worker_queue(),
276 helper.congestion_controller(), helper.bitrate_allocator(), 278 helper.congestion_controller(), helper.bitrate_allocator(),
277 helper.event_log()); 279 helper.event_log());
278 helper.SetupMockForGetStats(); 280 helper.SetupMockForGetStats();
279 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); 281 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
280 282
281 internal::AudioState* internal_audio_state = 283 internal::AudioState* internal_audio_state =
282 static_cast<internal::AudioState*>(helper.audio_state().get()); 284 static_cast<internal::AudioState*>(helper.audio_state().get());
283 VoiceEngineObserver* voe_observer = 285 VoiceEngineObserver* voe_observer =
284 static_cast<VoiceEngineObserver*>(internal_audio_state); 286 static_cast<VoiceEngineObserver*>(internal_audio_state);
285 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING); 287 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_WARNING);
286 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected); 288 EXPECT_TRUE(send_stream.GetStats().typing_noise_detected);
287 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING); 289 voe_observer->CallbackOnError(-1, VE_TYPING_NOISE_OFF_WARNING);
288 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected); 290 EXPECT_FALSE(send_stream.GetStats().typing_noise_detected);
289 } 291 }
290 } // namespace test 292 } // namespace test
291 } // namespace webrtc 293 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/audio/audio_send_stream.cc ('k') | webrtc/media/base/mediachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698