| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 bool started() const { return render_thread_.get() != NULL; } | 161 bool started() const { return render_thread_.get() != NULL; } |
| 162 | 162 |
| 163 private: | 163 private: |
| 164 // DelegateSimpleThread::Delegate implementation. | 164 // DelegateSimpleThread::Delegate implementation. |
| 165 virtual void Run() OVERRIDE; | 165 virtual void Run() OVERRIDE; |
| 166 | 166 |
| 167 // Core part of the thread loop which controls the actual rendering. | 167 // Core part of the thread loop which controls the actual rendering. |
| 168 // Checks available amount of space in the endpoint buffer and reads | 168 // Checks available amount of space in the endpoint buffer and reads |
| 169 // data from the client to fill up the buffer without causing audio | 169 // data from the client to fill up the buffer without causing audio |
| 170 // glitches. | 170 // glitches. |
| 171 void RenderAudioFromSource(IAudioClock* audio_clock, UINT64 device_frequency); | 171 bool RenderAudioFromSource(IAudioClock* audio_clock, UINT64 device_frequency); |
| 172 | 172 |
| 173 // Called when the device will be opened in exclusive mode and use the | 173 // Called when the device will be opened in exclusive mode and use the |
| 174 // application specified format. | 174 // application specified format. |
| 175 // TODO(henrika): rewrite and move to CoreAudioUtil when removing flag | 175 // TODO(henrika): rewrite and move to CoreAudioUtil when removing flag |
| 176 // for exclusive audio mode. | 176 // for exclusive audio mode. |
| 177 HRESULT ExclusiveModeInitialization(IAudioClient* client, | 177 HRESULT ExclusiveModeInitialization(IAudioClient* client, |
| 178 HANDLE event_handle, | 178 HANDLE event_handle, |
| 179 uint32* endpoint_buffer_size); | 179 uint32* endpoint_buffer_size); |
| 180 | 180 |
| 181 // If |render_thread_| is valid, sets |stop_render_event_| and blocks until | 181 // If |render_thread_| is valid, sets |stop_render_event_| and blocks until |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 | 260 |
| 261 // Container for retrieving data from AudioSourceCallback::OnMoreData(). | 261 // Container for retrieving data from AudioSourceCallback::OnMoreData(). |
| 262 scoped_ptr<AudioBus> audio_bus_; | 262 scoped_ptr<AudioBus> audio_bus_; |
| 263 | 263 |
| 264 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); | 264 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioOutputStream); |
| 265 }; | 265 }; |
| 266 | 266 |
| 267 } // namespace media | 267 } // namespace media |
| 268 | 268 |
| 269 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ | 269 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_OUTPUT_WIN_H_ |
| OLD | NEW |