OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_BASE_MOVING_AVERAGE_H_ | 5 #ifndef MEDIA_BASE_MOVING_AVERAGE_H_ |
6 #define MEDIA_BASE_MOVING_AVERAGE_H_ | 6 #define MEDIA_BASE_MOVING_AVERAGE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
| 10 #include "base/macros.h" |
10 #include "base/time/time.h" | 11 #include "base/time/time.h" |
11 #include "media/base/media_export.h" | 12 #include "media/base/media_export.h" |
12 | 13 |
13 namespace media { | 14 namespace media { |
14 | 15 |
15 // Simple class for calculating a moving average of fixed size. | 16 // Simple class for calculating a moving average of fixed size. |
16 class MEDIA_EXPORT MovingAverage { | 17 class MEDIA_EXPORT MovingAverage { |
17 public: | 18 public: |
18 // Creates a MovingAverage instance with space for |depth| samples. | 19 // Creates a MovingAverage instance with space for |depth| samples. |
19 explicit MovingAverage(size_t depth); | 20 explicit MovingAverage(size_t depth); |
(...skipping 24 matching lines...) Expand all Loading... |
44 std::vector<base::TimeDelta> samples_; | 45 std::vector<base::TimeDelta> samples_; |
45 base::TimeDelta total_; | 46 base::TimeDelta total_; |
46 uint64_t square_sum_us_; | 47 uint64_t square_sum_us_; |
47 | 48 |
48 DISALLOW_COPY_AND_ASSIGN(MovingAverage); | 49 DISALLOW_COPY_AND_ASSIGN(MovingAverage); |
49 }; | 50 }; |
50 | 51 |
51 } // namespace media | 52 } // namespace media |
52 | 53 |
53 #endif // MEDIA_BASE_MOVING_AVERAGE_H_ | 54 #endif // MEDIA_BASE_MOVING_AVERAGE_H_ |
OLD | NEW |