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 // Implementation of AudioOutputStream for Windows using Windows Core Audio | 5 // Implementation of AudioOutputStream for Windows using Windows Core Audio |
6 // WASAPI for low latency rendering. | 6 // WASAPI for low latency rendering. |
7 // | 7 // |
8 // Overview of operation and performance: | 8 // Overview of operation and performance: |
9 // | 9 // |
10 // - An object of WASAPIAudioOutputStream is created by the AudioManager | 10 // - An object of WASAPIAudioOutputStream is created by the AudioManager |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
155 // Returns AUDCLNT_SHAREMODE_EXCLUSIVE if --enable-exclusive-mode is used | 155 // Returns AUDCLNT_SHAREMODE_EXCLUSIVE if --enable-exclusive-mode is used |
156 // as command-line flag and AUDCLNT_SHAREMODE_SHARED otherwise (default). | 156 // as command-line flag and AUDCLNT_SHAREMODE_SHARED otherwise (default). |
157 static AUDCLNT_SHAREMODE GetShareMode(); | 157 static AUDCLNT_SHAREMODE GetShareMode(); |
158 | 158 |
159 bool started() const { return render_thread_.get() != NULL; } | 159 bool started() const { return render_thread_.get() != NULL; } |
160 | 160 |
161 private: | 161 private: |
162 // DelegateSimpleThread::Delegate implementation. | 162 // DelegateSimpleThread::Delegate implementation. |
163 virtual void Run() OVERRIDE; | 163 virtual void Run() OVERRIDE; |
164 | 164 |
165 // Core part of the thread loop which controls the actual rendering. | |
166 // Checks availiable amount of space in the endpoint buffer and reads | |
tommi (sloooow) - chröme
2013/02/08 15:37:54
s/availiable/available
henrika (OOO until Aug 14)
2013/02/08 15:49:37
Done.
| |
167 // data from the client to fill up the buffer without causing audio | |
168 // glitches. | |
169 void RenderAudioFromSource(IAudioClock* audio_clock, UINT64 device_frequency); | |
170 | |
165 // Issues the OnError() callback to the |sink_|. | 171 // Issues the OnError() callback to the |sink_|. |
166 void HandleError(HRESULT err); | 172 void HandleError(HRESULT err); |
167 | 173 |
168 // Called when the device will be opened in exclusive mode and use the | 174 // Called when the device will be opened in exclusive mode and use the |
169 // application specified format. | 175 // application specified format. |
170 // TODO(henrika): rewrite and move to CoreAudioUtil when removing flag | 176 // TODO(henrika): rewrite and move to CoreAudioUtil when removing flag |
171 // for exclusive audio mode. | 177 // for exclusive audio mode. |
172 HRESULT ExclusiveModeInitialization(IAudioClient* client, | 178 HRESULT ExclusiveModeInitialization(IAudioClient* client, |
173 HANDLE event_handle, | 179 HANDLE event_handle, |
174 uint32* endpoint_buffer_size); | 180 uint32* endpoint_buffer_size); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 | 253 |
248 // Container for retrieving data from AudioSourceCallback::OnMoreData(). | 254 // Container for retrieving data from AudioSourceCallback::OnMoreData(). |
249 scoped_ptr<AudioBus> audio_bus_; | 255 scoped_ptr<AudioBus> audio_bus_; |
250 | 256 |
251 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); | 257 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); |
252 }; | 258 }; |
253 | 259 |
254 } // namespace media | 260 } // namespace media |
255 | 261 |
256 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ | 262 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ |
OLD | NEW |