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

Unified Diff: webrtc/pc/statscollector.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_unittest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/pc/statscollector.cc
diff --git a/webrtc/pc/statscollector.cc b/webrtc/pc/statscollector.cc
index c9325831598549b50c3d1e63de24cddd54ab8ab3..ac9210d3f4c88af83acb8edba584fd258937d062 100644
--- a/webrtc/pc/statscollector.cc
+++ b/webrtc/pc/statscollector.cc
@@ -146,6 +146,9 @@ void ExtractStats(const cricket::VoiceReceiverInfo& info, StatsReport* report) {
{ StatsReport::kStatsValueNameAccelerateRate, info.accelerate_rate },
{ StatsReport::kStatsValueNamePreemptiveExpandRate,
info.preemptive_expand_rate },
+ { StatsReport::kStatsValueNameTotalAudioEnergy, info.total_output_energy },
+ { StatsReport::kStatsValueNameTotalSamplesDuration,
+ info.total_output_duration }
};
const IntForAdd ints[] = {
@@ -195,6 +198,12 @@ void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) {
info.aec_quality_min, info.echo_delay_std_ms,
info.residual_echo_likelihood, info.residual_echo_likelihood_recent_max);
+ const FloatForAdd floats[] = {
+ { StatsReport::kStatsValueNameTotalAudioEnergy, info.total_input_energy },
+ { StatsReport::kStatsValueNameTotalSamplesDuration,
+ info.total_input_duration }
+ };
+
RTC_DCHECK_GE(info.audio_level, 0);
const IntForAdd ints[] = {
{ StatsReport::kStatsValueNameAudioInputLevel, info.audio_level},
@@ -203,6 +212,10 @@ void ExtractStats(const cricket::VoiceSenderInfo& info, StatsReport* report) {
{ StatsReport::kStatsValueNamePacketsSent, info.packets_sent },
};
+ for (const auto& f : floats) {
+ report->AddFloat(f.name, f.value);
+ }
+
for (const auto& i : ints) {
if (i.value >= 0) {
report->AddInt(i.name, i.value);
« no previous file with comments | « webrtc/pc/rtcstatscollector_unittest.cc ('k') | webrtc/stats/rtcstats_objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698