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 // This object is created on the render thread. | 9 // This object is created on the render thread. |
10 // 2. Pipeline thread | 10 // 2. Pipeline thread |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 // Estimate earliest time when current buffer can stop playing. | 113 // Estimate earliest time when current buffer can stop playing. |
114 void UpdateEarliestEndTime(int bytes_filled, | 114 void UpdateEarliestEndTime(int bytes_filled, |
115 base::TimeDelta request_delay, | 115 base::TimeDelta request_delay, |
116 base::Time time_now); | 116 base::Time time_now); |
117 | 117 |
118 // Methods called on pipeline thread ---------------------------------------- | 118 // Methods called on pipeline thread ---------------------------------------- |
119 void DoPlay(); | 119 void DoPlay(); |
120 void DoPause(); | 120 void DoPause(); |
121 | 121 |
122 // media::AudioRendererSink::RenderCallback implementation. | 122 // media::AudioRendererSink::RenderCallback implementation. |
123 virtual int Render(const std::vector<float*>& audio_data, | 123 virtual int Render(AudioBus* audio_bus, |
124 int number_of_frames, | |
125 int audio_delay_milliseconds) OVERRIDE; | 124 int audio_delay_milliseconds) OVERRIDE; |
126 virtual void OnRenderError() OVERRIDE; | 125 virtual void OnRenderError() OVERRIDE; |
127 | 126 |
128 // Helper method that schedules an asynchronous read from the decoder and | 127 // Helper method that schedules an asynchronous read from the decoder and |
129 // increments |pending_reads_|. | 128 // increments |pending_reads_|. |
130 // | 129 // |
131 // Safe to call from any thread. | 130 // Safe to call from any thread. |
132 void ScheduleRead_Locked(); | 131 void ScheduleRead_Locked(); |
133 | 132 |
134 // Returns true if the data in the buffer is all before | 133 // Returns true if the data in the buffer is all before |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 bool underflow_disabled_; | 214 bool underflow_disabled_; |
216 | 215 |
217 AudioDecoder::ReadCB read_cb_; | 216 AudioDecoder::ReadCB read_cb_; |
218 | 217 |
219 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); | 218 DISALLOW_COPY_AND_ASSIGN(AudioRendererImpl); |
220 }; | 219 }; |
221 | 220 |
222 } // namespace media | 221 } // namespace media |
223 | 222 |
224 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ | 223 #endif // MEDIA_FILTERS_AUDIO_RENDERER_IMPL_H_ |
OLD | NEW |