OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
106 | 106 |
107 private: | 107 private: |
108 static const int kReportIntervalMs = 60 * 1000; // One minute. | 108 static const int kReportIntervalMs = 60 * 1000; // One minute. |
109 | 109 |
110 void LogToUma() const; | 110 void LogToUma() const; |
111 | 111 |
112 int counter_ = 0; | 112 int counter_ = 0; |
113 int timer_ = 0; | 113 int timer_ = 0; |
114 }; | 114 }; |
115 | 115 |
116 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
| |
117 public: | |
118 ~AverageExcessBufferDelayMs() { | |
119 LogToUma(); // Log the average for the current (incomplete) interval. | |
120 } | |
121 void RegisterPacketWaitingTime(int time_ms); | |
122 void AdvanceClock(int step_ms); | |
123 | |
124 private: | |
125 static const int kReportIntervalMs = 60 * 1000; // One minute. | |
126 | |
127 void LogToUma(); | |
128 | |
129 double sum_ = 0.0; | |
130 int num_packets_ = 0; | |
131 int timer_ = 0; | |
132 }; | |
133 | |
116 // Calculates numerator / denominator, and returns the value in Q14. | 134 // Calculates numerator / denominator, and returns the value in Q14. |
117 static uint16_t CalculateQ14Ratio(uint32_t numerator, uint32_t denominator); | 135 static uint16_t CalculateQ14Ratio(uint32_t numerator, uint32_t denominator); |
118 | 136 |
119 uint32_t preemptive_samples_; | 137 uint32_t preemptive_samples_; |
120 uint32_t accelerate_samples_; | 138 uint32_t accelerate_samples_; |
121 int added_zero_samples_; | 139 int added_zero_samples_; |
122 uint32_t expanded_speech_samples_; | 140 uint32_t expanded_speech_samples_; |
123 uint32_t expanded_noise_samples_; | 141 uint32_t expanded_noise_samples_; |
124 int discarded_packets_; | 142 int discarded_packets_; |
125 uint32_t lost_timestamps_; | 143 uint32_t lost_timestamps_; |
126 uint32_t timestamps_since_last_report_; | 144 uint32_t timestamps_since_last_report_; |
127 int waiting_times_[kLenWaitingTimes]; // Used as a circular buffer. | 145 int waiting_times_[kLenWaitingTimes]; // Used as a circular buffer. |
128 int len_waiting_times_; | 146 int len_waiting_times_; |
129 int next_waiting_time_index_; | 147 int next_waiting_time_index_; |
130 uint32_t secondary_decoded_samples_; | 148 uint32_t secondary_decoded_samples_; |
131 DelayedPacketOutagesPerMinuteCounter delayed_packet_outage_counter_; | 149 DelayedPacketOutagesPerMinuteCounter delayed_packet_outage_counter_; |
150 AverageExcessBufferDelayMs excess_buffer_delay_; | |
132 | 151 |
133 DISALLOW_COPY_AND_ASSIGN(StatisticsCalculator); | 152 DISALLOW_COPY_AND_ASSIGN(StatisticsCalculator); |
134 }; | 153 }; |
135 | 154 |
136 } // namespace webrtc | 155 } // namespace webrtc |
137 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_ | 156 #endif // WEBRTC_MODULES_AUDIO_CODING_NETEQ_STATISTICS_CALCULATOR_H_ |
OLD | NEW |