OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SILENT_SINK_SUSPENDER_H_ | 5 #ifndef MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ |
6 #define MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ | 6 #define MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <deque> | 10 #include <deque> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 bool is_transition_pending_ = false; | 96 bool is_transition_pending_ = false; |
97 | 97 |
98 // Buffers accumulated during the transition from |fake_sink_| to |sink_|. | 98 // Buffers accumulated during the transition from |fake_sink_| to |sink_|. |
99 std::deque<std::unique_ptr<AudioBus>> buffers_after_silence_; | 99 std::deque<std::unique_ptr<AudioBus>> buffers_after_silence_; |
100 | 100 |
101 // A cancelable task that is posted to switch to or from the |fake_sink_| | 101 // A cancelable task that is posted to switch to or from the |fake_sink_| |
102 // after a period of silence or first non-silent audio respective. We do this | 102 // after a period of silence or first non-silent audio respective. We do this |
103 // on Android to save battery consumption. | 103 // on Android to save battery consumption. |
104 base::CancelableCallback<void(bool)> sink_transition_callback_; | 104 base::CancelableCallback<void(bool)> sink_transition_callback_; |
105 | 105 |
| 106 // Audio output delay at the moment when transition to |fake_sink_| starts. |
| 107 base::TimeDelta latest_output_delay_; |
| 108 // Audio output delay timestamp at the moment when transition to |fake_sink_| |
| 109 // starts. |
| 110 base::TimeTicks latest_output_delay_timestamp_; |
| 111 // Time when transition to |fake_sink_| starts. |
| 112 base::TimeTicks fake_sink_transition_time_; |
| 113 |
106 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender); | 114 DISALLOW_COPY_AND_ASSIGN(SilentSinkSuspender); |
107 }; | 115 }; |
108 | 116 |
109 } // namespace content | 117 } // namespace content |
110 | 118 |
111 #endif // MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ | 119 #endif // MEDIA_BASE_SILENT_SINK_SUSPENDER_H_ |
OLD | NEW |