Index: webrtc/modules/audio_coding/neteq/statistics_calculator.h |
diff --git a/webrtc/modules/audio_coding/neteq/statistics_calculator.h b/webrtc/modules/audio_coding/neteq/statistics_calculator.h |
index c27aabe1281b757926df125dbc4abf85c86907ee..bd14530f0e3aa813a59f2e6c9a55cf8bcb83e38b 100644 |
--- a/webrtc/modules/audio_coding/neteq/statistics_calculator.h |
+++ b/webrtc/modules/audio_coding/neteq/statistics_calculator.h |
@@ -113,6 +113,24 @@ class StatisticsCalculator { |
int timer_ = 0; |
}; |
+ class AverageExcessBufferDelayMs { |
minyue-webrtc
2015/08/17 13:38:08
Since AverageExcessBufferDelayMs and DelayedPacket
hlundin-webrtc
2015/08/18 07:41:44
I thought about it at first. And now I tried it, b
|
+ public: |
+ ~AverageExcessBufferDelayMs() { |
+ LogToUma(); // Log the average for the current (incomplete) interval. |
+ } |
+ void RegisterPacketWaitingTime(int time_ms); |
+ void AdvanceClock(int step_ms); |
+ |
+ private: |
+ static const int kReportIntervalMs = 60 * 1000; // One minute. |
+ |
+ void LogToUma(); |
+ |
+ double sum_ = 0.0; |
+ int num_packets_ = 0; |
+ int timer_ = 0; |
+ }; |
+ |
// Calculates numerator / denominator, and returns the value in Q14. |
static uint16_t CalculateQ14Ratio(uint32_t numerator, uint32_t denominator); |
@@ -129,6 +147,7 @@ class StatisticsCalculator { |
int next_waiting_time_index_; |
uint32_t secondary_decoded_samples_; |
DelayedPacketOutagesPerMinuteCounter delayed_packet_outage_counter_; |
+ AverageExcessBufferDelayMs excess_buffer_delay_; |
DISALLOW_COPY_AND_ASSIGN(StatisticsCalculator); |
}; |