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

Unified Diff: webrtc/pc/rtcstatscollector_unittest.cc

Issue 2964593002: Adding stats that can be used to compute output audio levels. (Closed)
Patch Set: Add test coverage in AudioSendStreamTest. Created 3 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/pc/rtcstatscollector.cc ('k') | webrtc/pc/statscollector.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/rtcstatscollector_unittest.cc
diff --git a/webrtc/pc/rtcstatscollector_unittest.cc b/webrtc/pc/rtcstatscollector_unittest.cc
index 7b7863212658fbd442e70b8ac5c7116b6db374a3..2668f16153e6253bc66a9d8dfaf665fcbc18ae0f 100644
--- a/webrtc/pc/rtcstatscollector_unittest.cc
+++ b/webrtc/pc/rtcstatscollector_unittest.cc
@@ -1521,6 +1521,8 @@ TEST_F(RTCStatsCollectorTest,
voice_sender_info_ssrc1.local_stats.push_back(cricket::SsrcSenderInfo());
voice_sender_info_ssrc1.local_stats[0].ssrc = 1;
voice_sender_info_ssrc1.audio_level = 32767;
+ voice_sender_info_ssrc1.total_input_energy = 0.25;
+ voice_sender_info_ssrc1.total_input_duration = 0.5;
voice_sender_info_ssrc1.echo_return_loss = 42;
voice_sender_info_ssrc1.echo_return_loss_enhancement = 52;
@@ -1530,6 +1532,8 @@ TEST_F(RTCStatsCollectorTest,
voice_sender_info_ssrc2.local_stats.push_back(cricket::SsrcSenderInfo());
voice_sender_info_ssrc2.local_stats[0].ssrc = 2;
voice_sender_info_ssrc2.audio_level = 0;
+ voice_sender_info_ssrc2.total_input_energy = 0.0;
+ voice_sender_info_ssrc2.total_input_duration = 0.0;
voice_sender_info_ssrc2.echo_return_loss = -100;
voice_sender_info_ssrc2.echo_return_loss_enhancement = -100;
@@ -1544,6 +1548,8 @@ TEST_F(RTCStatsCollectorTest,
voice_receiver_info.local_stats.push_back(cricket::SsrcReceiverInfo());
voice_receiver_info.local_stats[0].ssrc = 3;
voice_receiver_info.audio_level = 16383;
+ voice_receiver_info.total_output_energy = 0.125;
+ voice_receiver_info.total_output_duration = 0.25;
test_->CreateMockRtpSendersReceiversAndChannels(
{ std::make_pair(local_audio_track.get(), voice_sender_info_ssrc1),
@@ -1582,6 +1588,8 @@ TEST_F(RTCStatsCollectorTest,
expected_local_audio_track_ssrc1.ended = true;
expected_local_audio_track_ssrc1.detached = false;
expected_local_audio_track_ssrc1.audio_level = 1.0;
+ expected_local_audio_track_ssrc1.total_audio_energy = 0.25;
+ expected_local_audio_track_ssrc1.total_samples_duration = 0.5;
expected_local_audio_track_ssrc1.echo_return_loss = 42.0;
expected_local_audio_track_ssrc1.echo_return_loss_enhancement = 52.0;
ASSERT_TRUE(report->Get(expected_local_audio_track_ssrc1.id()));
@@ -1597,6 +1605,8 @@ TEST_F(RTCStatsCollectorTest,
expected_local_audio_track_ssrc2.ended = true;
expected_local_audio_track_ssrc2.detached = false;
expected_local_audio_track_ssrc2.audio_level = 0.0;
+ expected_local_audio_track_ssrc2.total_audio_energy = 0.0;
+ expected_local_audio_track_ssrc2.total_samples_duration = 0.0;
// Should be undefined: |expected_local_audio_track_ssrc2.echo_return_loss|
// and |expected_local_audio_track_ssrc2.echo_return_loss_enhancement|.
ASSERT_TRUE(report->Get(expected_local_audio_track_ssrc2.id()));
@@ -1612,6 +1622,8 @@ TEST_F(RTCStatsCollectorTest,
expected_remote_audio_track.ended = false;
expected_remote_audio_track.detached = false;
expected_remote_audio_track.audio_level = 16383.0 / 32767.0;
+ expected_remote_audio_track.total_audio_energy = 0.125;
+ expected_remote_audio_track.total_samples_duration = 0.25;
ASSERT_TRUE(report->Get(expected_remote_audio_track.id()));
EXPECT_EQ(expected_remote_audio_track,
report->Get(expected_remote_audio_track.id())->cast_to<
« no previous file with comments | « webrtc/pc/rtcstatscollector.cc ('k') | webrtc/pc/statscollector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698