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_CONTENT_FEEDBACK_SIGNAL_ACCUMULATOR_H_ | 5 #ifndef MEDIA_BASE_FEEDBACK_SIGNAL_ACCUMULATOR_H_ |
6 #define MEDIA_CAPTURE_CONTENT_FEEDBACK_SIGNAL_ACCUMULATOR_H_ | 6 #define MEDIA_BASE_FEEDBACK_SIGNAL_ACCUMULATOR_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "media/capture/capture_export.h" | |
10 | 9 |
11 namespace media { | 10 namespace media { |
12 | 11 |
13 // Utility class for maintaining an exponentially-decaying average of feedback | 12 // Utility class for maintaining an exponentially-decaying average of feedback |
14 // signal values whose updates occur at undetermined, possibly irregular time | 13 // signal values whose updates occur at undetermined, possibly irregular time |
15 // intervals. | 14 // intervals. |
16 // | 15 // |
17 // Feedback signals can be made by multiple sources. Meaning, there can be | 16 // Feedback signals can be made by multiple sources. Meaning, there can be |
18 // several values provided for the same timestamp. In this case, the greatest | 17 // several values provided for the same timestamp. In this case, the greatest |
19 // value is retained and used to re-compute the average. Therefore, the values | 18 // value is retained and used to re-compute the average. Therefore, the values |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 TimeType reset_time_; // |timestamp| passed in last call to Reset(). | 98 TimeType reset_time_; // |timestamp| passed in last call to Reset(). |
100 double average_; // Current accumulated average. | 99 double average_; // Current accumulated average. |
101 double update_value_; // Latest |value| accepted by Update(). | 100 double update_value_; // Latest |value| accepted by Update(). |
102 TimeType update_time_; // Latest |timestamp| accepted by Update(). | 101 TimeType update_time_; // Latest |timestamp| accepted by Update(). |
103 double prior_average_; // Accumulated average before last call to Update(). | 102 double prior_average_; // Accumulated average before last call to Update(). |
104 TimeType prior_update_time_; // |timestamp| in prior call to Update(). | 103 TimeType prior_update_time_; // |timestamp| in prior call to Update(). |
105 }; | 104 }; |
106 | 105 |
107 } // namespace media | 106 } // namespace media |
108 | 107 |
109 #endif // MEDIA_CAPTURE_CONTENT_FEEDBACK_SIGNAL_ACCUMULATOR_H_ | 108 #endif // MEDIA_BASE_FEEDBACK_SIGNAL_ACCUMULATOR_H_ |
OLD | NEW |