| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 int64_t last_audio_memory_usage_; | 235 int64_t last_audio_memory_usage_; |
| 236 | 236 |
| 237 // Sample rate of the last decoded audio buffer. Allows for detection of | 237 // Sample rate of the last decoded audio buffer. Allows for detection of |
| 238 // sample rate changes due to implicit AAC configuration change. | 238 // sample rate changes due to implicit AAC configuration change. |
| 239 int last_decoded_sample_rate_; | 239 int last_decoded_sample_rate_; |
| 240 | 240 |
| 241 // Similar to |last_decoded_sample_rate_|, used to configure the channel mask | 241 // Similar to |last_decoded_sample_rate_|, used to configure the channel mask |
| 242 // given to the |algorithm_| for efficient playback rate changes. | 242 // given to the |algorithm_| for efficient playback rate changes. |
| 243 ChannelLayout last_decoded_channel_layout_; | 243 ChannelLayout last_decoded_channel_layout_; |
| 244 | 244 |
| 245 // Similar to |last_decoded_channel_layout_|, used to configure the channel |
| 246 // mask given to the |algorithm_| for efficient playback rate changes. |
| 247 int last_decoded_channels_; |
| 248 |
| 245 // After Initialize() has completed, all variables below must be accessed | 249 // After Initialize() has completed, all variables below must be accessed |
| 246 // under |lock_|. ------------------------------------------------------------ | 250 // under |lock_|. ------------------------------------------------------------ |
| 247 base::Lock lock_; | 251 base::Lock lock_; |
| 248 | 252 |
| 249 // Algorithm for scaling audio. | 253 // Algorithm for scaling audio. |
| 250 double playback_rate_; | 254 double playback_rate_; |
| 251 std::unique_ptr<AudioRendererAlgorithm> algorithm_; | 255 std::unique_ptr<AudioRendererAlgorithm> algorithm_; |
| 252 | 256 |
| 253 // Simple state tracking variable. | 257 // Simple state tracking variable. |
| 254 State state_; | 258 State state_; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 302 |
| 299 // NOTE: Weak pointers must be invalidated before all other member variables. | 303 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 300 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 304 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
| 301 | 305 |
| 302 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 306 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 303 }; | 307 }; |
| 304 | 308 |
| 305 } // namespace media | 309 } // namespace media |
| 306 | 310 |
| 307 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 311 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |