| 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 std::unique_ptr<base::TickClock> tick_clock_; | 227 std::unique_ptr<base::TickClock> tick_clock_; |
| 228 | 228 |
| 229 // Memory usage of |algorithm_| recorded during the last | 229 // Memory usage of |algorithm_| recorded during the last |
| 230 // HandleDecodedBuffer_Locked() call. | 230 // HandleDecodedBuffer_Locked() call. |
| 231 int64_t last_audio_memory_usage_; | 231 int64_t last_audio_memory_usage_; |
| 232 | 232 |
| 233 // Sample rate of the last decoded audio buffer. Allows for detection of | 233 // Sample rate of the last decoded audio buffer. Allows for detection of |
| 234 // sample rate changes due to implicit AAC configuration change. | 234 // sample rate changes due to implicit AAC configuration change. |
| 235 int last_decoded_sample_rate_; | 235 int last_decoded_sample_rate_; |
| 236 | 236 |
| 237 // Indicates which channels are muted and can be ignored by the algorithm. |
| 238 std::vector<bool> channel_mask_; |
| 239 |
| 237 // After Initialize() has completed, all variables below must be accessed | 240 // After Initialize() has completed, all variables below must be accessed |
| 238 // under |lock_|. ------------------------------------------------------------ | 241 // under |lock_|. ------------------------------------------------------------ |
| 239 base::Lock lock_; | 242 base::Lock lock_; |
| 240 | 243 |
| 241 // Algorithm for scaling audio. | 244 // Algorithm for scaling audio. |
| 242 double playback_rate_; | 245 double playback_rate_; |
| 243 std::unique_ptr<AudioRendererAlgorithm> algorithm_; | 246 std::unique_ptr<AudioRendererAlgorithm> algorithm_; |
| 244 | 247 |
| 245 // Simple state tracking variable. | 248 // Simple state tracking variable. |
| 246 State state_; | 249 State state_; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 | 293 |
| 291 // NOTE: Weak pointers must be invalidated before all other member variables. | 294 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 292 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 295 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
| 293 | 296 |
| 294 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 297 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 295 }; | 298 }; |
| 296 | 299 |
| 297 } // namespace media | 300 } // namespace media |
| 298 | 301 |
| 299 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 302 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |