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 void StopDecoder(); |
| 188 |
187 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 189 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
188 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 190 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
189 base::WeakPtr<AudioRendererImpl> weak_this_; | 191 base::WeakPtr<AudioRendererImpl> weak_this_; |
190 | 192 |
191 scoped_ptr<AudioSplicer> splicer_; | 193 scoped_ptr<AudioSplicer> splicer_; |
192 | 194 |
193 // The sink (destination) for rendered audio. |sink_| must only be accessed | 195 // 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 | 196 // on |task_runner_|. |sink_| must never be called under |lock_| or else we |
195 // may deadlock between |task_runner_| and the audio callback thread. | 197 // may deadlock between |task_runner_| and the audio callback thread. |
196 scoped_refptr<media::AudioRendererSink> sink_; | 198 scoped_refptr<media::AudioRendererSink> sink_; |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 bool preroll_aborted_; | 278 bool preroll_aborted_; |
277 | 279 |
278 // End variables which must be accessed under |lock_|. ---------------------- | 280 // End variables which must be accessed under |lock_|. ---------------------- |
279 | 281 |
280 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 282 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
281 }; | 283 }; |
282 | 284 |
283 } // namespace media | 285 } // namespace media |
284 | 286 |
285 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 287 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |