OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ | 5 #ifndef MEDIA_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ |
6 #define MEDIA_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ | 6 #define MEDIA_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ |
7 | 7 |
| 8 #include "base/macros.h" |
8 #include "base/time/time.h" | 9 #include "base/time/time.h" |
9 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
10 | 11 |
11 namespace media { | 12 namespace media { |
12 | 13 |
13 // Filters a sequence of events to achieve a target frequency. | 14 // Filters a sequence of events to achieve a target frequency. |
14 class MEDIA_EXPORT SmoothEventSampler { | 15 class MEDIA_EXPORT SmoothEventSampler { |
15 public: | 16 public: |
16 enum { | 17 enum { |
17 // The maximum amount of time that can elapse before considering unchanged | 18 // The maximum amount of time that can elapse before considering unchanged |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 base::TimeTicks last_sample_; | 59 base::TimeTicks last_sample_; |
59 int overdue_sample_count_; | 60 int overdue_sample_count_; |
60 base::TimeDelta token_bucket_; | 61 base::TimeDelta token_bucket_; |
61 | 62 |
62 DISALLOW_COPY_AND_ASSIGN(SmoothEventSampler); | 63 DISALLOW_COPY_AND_ASSIGN(SmoothEventSampler); |
63 }; | 64 }; |
64 | 65 |
65 } // namespace media | 66 } // namespace media |
66 | 67 |
67 #endif // MEDIA_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ | 68 #endif // MEDIA_CAPTURE_SMOOTH_EVENT_SAMPLER_H_ |
OLD | NEW |