Implement newly standardized stats
Several new audio stats have been added to the standard, and this CL
implements those inside of NetEq. Exposing these metrics on the API will
be done in a follow-up CL.
Bug: webrtc:10442, webrtc:10443, webrtc:10444
Change-Id: Ia7aa5a6d76685fc0fdb446172a0a3fd0310f6cb7
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/133887
Reviewed-by: Minyue Li <minyue@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27755}
diff --git a/modules/audio_coding/neteq/neteq_impl.cc b/modules/audio_coding/neteq/neteq_impl.cc
index b7f5579..fcb09be 100644
--- a/modules/audio_coding/neteq/neteq_impl.cc
+++ b/modules/audio_coding/neteq/neteq_impl.cc
@@ -654,9 +654,13 @@
}
// Calculate the number of primary (non-FEC/RED) packets.
- const int number_of_primary_packets = std::count_if(
+ const size_t number_of_primary_packets = std::count_if(
parsed_packet_list.begin(), parsed_packet_list.end(),
[](const Packet& in) { return in.priority.codec_level == 0; });
+ if (number_of_primary_packets < parsed_packet_list.size()) {
+ stats_->SecondaryPacketsReceived(parsed_packet_list.size() -
+ number_of_primary_packets);
+ }
// Insert packets in buffer.
const int ret = packet_buffer_->InsertPacketList(
@@ -763,7 +767,9 @@
expand_uma_logger_.UpdateSampleCounter(lifetime_stats.concealed_samples,
fs_hz_);
speech_expand_uma_logger_.UpdateSampleCounter(
- lifetime_stats.voice_concealed_samples, fs_hz_);
+ lifetime_stats.concealed_samples -
+ lifetime_stats.silent_concealed_samples,
+ fs_hz_);
// Check for muted state.
if (enable_muted_state_ && expand_->Muted() && packet_buffer_->Empty()) {