Index: webrtc/modules/audio_coding/neteq/delay_peak_detector.h |
diff --git a/webrtc/modules/audio_coding/neteq/delay_peak_detector.h b/webrtc/modules/audio_coding/neteq/delay_peak_detector.h |
index 69433b452489fe552ba48f43b1953b06a9e23058..82db09e55a95babb93a36679e88168e6f2a72ac1 100644 |
--- a/webrtc/modules/audio_coding/neteq/delay_peak_detector.h |
+++ b/webrtc/modules/audio_coding/neteq/delay_peak_detector.h |
@@ -16,12 +16,13 @@ |
#include <list> |
#include "webrtc/base/constructormagic.h" |
+#include "webrtc/modules/audio_coding/neteq/tick_timer.h" |
namespace webrtc { |
class DelayPeakDetector { |
public: |
- DelayPeakDetector(); |
+ DelayPeakDetector(const TickTimer& tick_timer); |
virtual ~DelayPeakDetector(); |
virtual void Reset(); |
@@ -39,18 +40,13 @@ class DelayPeakDetector { |
// Calculates and returns the maximum delay peak distance in ms. |
// Returns -1 if no delay peaks have been observed recently. |
- virtual int MaxPeakPeriod() const; |
+ virtual uint64_t MaxPeakPeriod() const; |
// Updates the DelayPeakDetector with a new inter-arrival time (in packets) |
// and the current target buffer level (needed to decide if a peak is observed |
// or not). Returns true if peak-mode is active, false if not. |
virtual bool Update(int inter_arrival_time, int target_level); |
- // Increments the |peak_period_counter_ms_| with |inc_ms|. Only increments |
- // the counter if it is non-negative. A negative denotes that no peak has |
- // been observed. |
- virtual void IncrementCounter(int inc_ms); |
- |
private: |
static const size_t kMaxNumPeaks = 8; |
static const size_t kMinPeaksToTrigger = 2; |
@@ -58,7 +54,7 @@ class DelayPeakDetector { |
static const int kMaxPeakPeriodMs = 10000; |
typedef struct { |
- int period_ms; |
+ uint64_t period_ms; |
int peak_height_packets; |
} Peak; |
@@ -67,7 +63,8 @@ class DelayPeakDetector { |
std::list<Peak> peak_history_; |
bool peak_found_; |
int peak_detection_threshold_; |
- int peak_period_counter_ms_; |
+ const TickTimer& tick_timer_; |
+ std::unique_ptr<TickTimer::Stopwatch> peak_period_stopwatch_; |
RTC_DISALLOW_COPY_AND_ASSIGN(DelayPeakDetector); |
}; |