| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 // completed. | 177 // completed. |
| 178 void DoFlush_Locked(); | 178 void DoFlush_Locked(); |
| 179 | 179 |
| 180 // Calls |decoder_|.Reset() and arranges for ResetDecoderDone() to get | 180 // Calls |decoder_|.Reset() and arranges for ResetDecoderDone() to get |
| 181 // called when the reset completes. | 181 // called when the reset completes. |
| 182 void ResetDecoder(); | 182 void ResetDecoder(); |
| 183 | 183 |
| 184 // Called when the |decoder_|.Reset() has completed. | 184 // Called when the |decoder_|.Reset() has completed. |
| 185 void ResetDecoderDone(); | 185 void ResetDecoderDone(); |
| 186 | 186 |
| 187 // Stops the |decoder_| if present. Ensures |stop_cb_| is called. |
| 188 void StopDecoder(); |
| 189 |
| 187 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 190 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 188 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 191 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
| 189 base::WeakPtr<AudioRendererImpl> weak_this_; | 192 base::WeakPtr<AudioRendererImpl> weak_this_; |
| 190 | 193 |
| 191 scoped_ptr<AudioSplicer> splicer_; | 194 scoped_ptr<AudioSplicer> splicer_; |
| 192 | 195 |
| 193 // The sink (destination) for rendered audio. |sink_| must only be accessed | 196 // The sink (destination) for rendered audio. |sink_| must only be accessed |
| 194 // on |task_runner_|. |sink_| must never be called under |lock_| or else we | 197 // on |task_runner_|. |sink_| must never be called under |lock_| or else we |
| 195 // may deadlock between |task_runner_| and the audio callback thread. | 198 // may deadlock between |task_runner_| and the audio callback thread. |
| 196 scoped_refptr<media::AudioRendererSink> sink_; | 199 scoped_refptr<media::AudioRendererSink> sink_; |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 bool preroll_aborted_; | 279 bool preroll_aborted_; |
| 277 | 280 |
| 278 // End variables which must be accessed under |lock_|. ---------------------- | 281 // End variables which must be accessed under |lock_|. ---------------------- |
| 279 | 282 |
| 280 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 283 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
| 281 }; | 284 }; |
| 282 | 285 |
| 283 } // namespace media | 286 } // namespace media |
| 284 | 287 |
| 285 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 288 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
| OLD | NEW |