Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Side by Side Diff: media/audio/win/audio_low_latency_output_win.h

Issue 27181005: Fail out of WASAPI render loop when errors are encountered. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix signature. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | media/audio/win/audio_low_latency_output_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | media/audio/win/audio_low_latency_output_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698