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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Callback provided to Flush(). | 225 // Callback provided to Flush(). |
226 base::Closure flush_cb_; | 226 base::Closure flush_cb_; |
227 | 227 |
228 // Overridable tick clock for testing. | 228 // Overridable tick clock for testing. |
229 scoped_ptr<base::TickClock> tick_clock_; | 229 scoped_ptr<base::TickClock> tick_clock_; |
230 | 230 |
231 // Memory usage of |algorithm_| recorded during the last | 231 // Memory usage of |algorithm_| recorded during the last |
232 // HandleSplicerBuffer_Locked() call. | 232 // HandleSplicerBuffer_Locked() call. |
233 int64_t last_audio_memory_usage_; | 233 int64_t last_audio_memory_usage_; |
234 | 234 |
| 235 // Sample rate of the last decoded audio buffer. Allows for detection of |
| 236 // sample rate changes due to implicit AAC configuration change. |
| 237 int last_decoded_sample_rate_; |
| 238 |
235 // After Initialize() has completed, all variables below must be accessed | 239 // After Initialize() has completed, all variables below must be accessed |
236 // under |lock_|. ------------------------------------------------------------ | 240 // under |lock_|. ------------------------------------------------------------ |
237 base::Lock lock_; | 241 base::Lock lock_; |
238 | 242 |
239 // Algorithm for scaling audio. | 243 // Algorithm for scaling audio. |
240 double playback_rate_; | 244 double playback_rate_; |
241 scoped_ptr<AudioRendererAlgorithm> algorithm_; | 245 scoped_ptr<AudioRendererAlgorithm> algorithm_; |
242 | 246 |
243 // Simple state tracking variable. | 247 // Simple state tracking variable. |
244 State state_; | 248 State state_; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 | 292 |
289 // NOTE: Weak pointers must be invalidated before all other member variables. | 293 // NOTE: Weak pointers must be invalidated before all other member variables. |
290 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 294 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
291 | 295 |
292 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 296 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
293 }; | 297 }; |
294 | 298 |
295 } // namespace media | 299 } // namespace media |
296 | 300 |
297 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 301 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |