OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Audio rendering unit utilizing an AudioRendererSink to output data. | 5 // Audio rendering unit utilizing an AudioRendererSink to output data. |
6 // | 6 // |
7 // This class lives inside three threads during it's lifetime, namely: | 7 // This class lives inside three threads during it's lifetime, namely: |
8 // 1. Render thread | 8 // 1. Render thread |
9 // Where the object is created. | 9 // Where the object is created. |
10 // 2. Media thread (provided via constructor) | 10 // 2. Media thread (provided via constructor) |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 scoped_refptr<MediaLog> media_log_; | 208 scoped_refptr<MediaLog> media_log_; |
209 | 209 |
210 // Cached copy of hardware params from |hardware_config_|. | 210 // Cached copy of hardware params from |hardware_config_|. |
211 AudioParameters audio_parameters_; | 211 AudioParameters audio_parameters_; |
212 | 212 |
213 // Callbacks provided during Initialize(). | 213 // Callbacks provided during Initialize(). |
214 PipelineStatusCB init_cb_; | 214 PipelineStatusCB init_cb_; |
215 BufferingStateCB buffering_state_cb_; | 215 BufferingStateCB buffering_state_cb_; |
216 base::Closure ended_cb_; | 216 base::Closure ended_cb_; |
217 PipelineStatusCB error_cb_; | 217 PipelineStatusCB error_cb_; |
| 218 StatisticsCB statistics_cb_; |
218 | 219 |
219 // Callback provided to Flush(). | 220 // Callback provided to Flush(). |
220 base::Closure flush_cb_; | 221 base::Closure flush_cb_; |
221 | 222 |
222 // Overridable tick clock for testing. | 223 // Overridable tick clock for testing. |
223 scoped_ptr<base::TickClock> tick_clock_; | 224 scoped_ptr<base::TickClock> tick_clock_; |
224 | 225 |
| 226 // Memory usage of |algorithm_| recorded during the last |
| 227 // HandleSplicerBuffer_Locked() call. |
| 228 int64_t last_audio_memory_usage_; |
| 229 |
225 // After Initialize() has completed, all variables below must be accessed | 230 // After Initialize() has completed, all variables below must be accessed |
226 // under |lock_|. ------------------------------------------------------------ | 231 // under |lock_|. ------------------------------------------------------------ |
227 base::Lock lock_; | 232 base::Lock lock_; |
228 | 233 |
229 // Algorithm for scaling audio. | 234 // Algorithm for scaling audio. |
230 double playback_rate_; | 235 double playback_rate_; |
231 scoped_ptr<AudioRendererAlgorithm> algorithm_; | 236 scoped_ptr<AudioRendererAlgorithm> algorithm_; |
232 | 237 |
233 // Simple state tracking variable. | 238 // Simple state tracking variable. |
234 State state_; | 239 State state_; |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 | 279 |
275 // NOTE: Weak pointers must be invalidated before all other member variables. | 280 // NOTE: Weak pointers must be invalidated before all other member variables. |
276 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 281 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
277 | 282 |
278 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 283 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
279 }; | 284 }; |
280 | 285 |
281 } // namespace media | 286 } // namespace media |
282 | 287 |
283 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 288 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |