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

Unified Diff: webrtc/modules/audio_coding/neteq/statistics_calculator.h

Issue 1296633002: NetEq/ACM: Refactor how packet waiting times are calculated (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebasing Created 5 years, 4 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
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 3bd3e55d46e276e6092ae6c28a7604ab62f1fd34..5bb66b669736f790720ff60e5d018a19a2fd4e13 100644
--- a/webrtc/modules/audio_coding/neteq/statistics_calculator.h
+++ b/webrtc/modules/audio_coding/neteq/statistics_calculator.h
@@ -11,8 +11,8 @@
#ifndef WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_
#define WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_
+#include <deque>
#include <string>
-#include <vector>
#include "webrtc/base/constructormagic.h"
#include "webrtc/modules/audio_coding/neteq/interface/neteq.h"
@@ -29,7 +29,7 @@ class StatisticsCalculator {
public:
StatisticsCalculator();
- virtual ~StatisticsCalculator() {}
+ virtual ~StatisticsCalculator();
// Resets most of the counters.
void Reset();
@@ -37,9 +37,6 @@ class StatisticsCalculator {
// Resets the counters that are not handled by Reset().
void ResetMcu();
- // Resets the waiting time statistics.
- void ResetWaitingTimeStatistics();
-
// Reports that |num_samples| samples were produced through expansion, and
// that the expansion produced other than just noise samples.
void ExpandedVoiceSamples(size_t num_samples);
@@ -91,11 +88,9 @@ class StatisticsCalculator {
const DecisionLogic& decision_logic,
NetEqNetworkStatistics *stats);
- void WaitingTimes(std::vector<int>* waiting_times);
-
private:
static const int kMaxReportPeriod = 60; // Seconds before auto-reset.
- static const int kLenWaitingTimes = 100;
+ static const size_t kLenWaitingTimes = 100;
class PeriodicUmaLogger {
public:
@@ -160,9 +155,7 @@ class StatisticsCalculator {
size_t discarded_packets_;
size_t lost_timestamps_;
uint32_t timestamps_since_last_report_;
- int waiting_times_[kLenWaitingTimes]; // Used as a circular buffer.
- int len_waiting_times_;
- int next_waiting_time_index_;
+ std::deque<int> waiting_times_;
uint32_t secondary_decoded_samples_;
PeriodicUmaCount delayed_packet_outage_counter_;
PeriodicUmaAverage excess_buffer_delay_;

Powered by Google App Engine
This is Rietveld 408576698