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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 }; | 121 }; |
122 | 122 |
123 // Callback from the audio decoder delivering decoded audio samples. | 123 // Callback from the audio decoder delivering decoded audio samples. |
124 void DecodedAudioReady(AudioBufferStream::Status status, | 124 void DecodedAudioReady(AudioBufferStream::Status status, |
125 const scoped_refptr<AudioBuffer>& buffer); | 125 const scoped_refptr<AudioBuffer>& buffer); |
126 | 126 |
127 // Handles buffers that come out of |splicer_|. | 127 // Handles buffers that come out of |splicer_|. |
128 // Returns true if more buffers are needed. | 128 // Returns true if more buffers are needed. |
129 bool HandleSplicerBuffer_Locked(const scoped_refptr<AudioBuffer>& buffer); | 129 bool HandleSplicerBuffer_Locked(const scoped_refptr<AudioBuffer>& buffer); |
130 | 130 |
131 // Helper functions for AudioDecoder::Status values passed to | 131 // Helper functions for DecodeStatus values passed to |
132 // DecodedAudioReady(). | 132 // DecodedAudioReady(). |
133 void HandleAbortedReadOrDecodeError(PipelineStatus status); | 133 void HandleAbortedReadOrDecodeError(PipelineStatus status); |
134 | 134 |
135 void StartRendering_Locked(); | 135 void StartRendering_Locked(); |
136 void StopRendering_Locked(); | 136 void StopRendering_Locked(); |
137 | 137 |
138 // AudioRendererSink::RenderCallback implementation. | 138 // AudioRendererSink::RenderCallback implementation. |
139 // | 139 // |
140 // NOTE: These are called on the audio callback thread! | 140 // NOTE: These are called on the audio callback thread! |
141 // | 141 // |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 292 |
293 // NOTE: Weak pointers must be invalidated before all other member variables. | 293 // NOTE: Weak pointers must be invalidated before all other member variables. |
294 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; | 294 base::WeakPtrFactory<AudioRendererImpl> weak_factory_; |
295 | 295 |
296 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 296 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
297 }; | 297 }; |
298 | 298 |
299 } // namespace media | 299 } // namespace media |
300 | 300 |
301 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ | 301 #endif // MEDIA_RENDERERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |