Add delayed packet outage event metric.
Can be used to calculate the average delayed packet outage duration and
number of packet loss events by subtracting from concealment events.
Only used in simulations currently.
Bug: None
Change-Id: I03740a2bcb781af09e28a4d13d9e41c0f84bc506
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/303600
Commit-Queue: Jakob Ivarsson‎ <jakobi@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39957}
diff --git a/api/neteq/neteq.h b/api/neteq/neteq.h
index 5300c56..43e0e09 100644
--- a/api/neteq/neteq.h
+++ b/api/neteq/neteq.h
@@ -76,6 +76,7 @@
uint64_t packets_discarded = 0;
// Below stats are not part of the spec.
uint64_t delayed_packet_outage_samples = 0;
+ uint64_t delayed_packet_outage_events = 0;
// This is sum of relative packet arrival delays of received packets so far.
// Since end-to-end delay of a packet is difficult to measure and is not
// necessarily useful for measuring jitter buffer performance, we report a
diff --git a/modules/audio_coding/neteq/statistics_calculator.cc b/modules/audio_coding/neteq/statistics_calculator.cc
index 52d3fa9..70cfc2b 100644
--- a/modules/audio_coding/neteq/statistics_calculator.cc
+++ b/modules/audio_coding/neteq/statistics_calculator.cc
@@ -300,6 +300,7 @@
100 /* bucket count */);
delayed_packet_outage_counter_.RegisterSample();
lifetime_stats_.delayed_packet_outage_samples += num_samples;
+ ++lifetime_stats_.delayed_packet_outage_events;
}
void StatisticsCalculator::StoreWaitingTime(int waiting_time_ms) {
diff --git a/modules/audio_coding/neteq/tools/neteq_stats_plotter.cc b/modules/audio_coding/neteq/tools/neteq_stats_plotter.cc
index 162a4c9..47bcd31 100644
--- a/modules/audio_coding/neteq/tools/neteq_stats_plotter.cc
+++ b/modules/audio_coding/neteq/tools/neteq_stats_plotter.cc
@@ -90,6 +90,8 @@
lifetime_stats.concealment_events);
printf(" delayed_packet_outage_samples: %" PRIu64 "\n",
lifetime_stats.delayed_packet_outage_samples);
+ printf(" delayed_packet_outage_events: %" PRIu64 "\n",
+ lifetime_stats.delayed_packet_outage_events);
printf(" num_interruptions: %d\n", lifetime_stats.interruption_count);
printf(" sum_interruption_length_ms: %d ms\n",
lifetime_stats.total_interruption_duration_ms);