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

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

Issue 12220076: Ensures that WASAPI audio output does not go silent in rare cases (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 7 years, 10 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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 available amount of space in the endpoint buffer and reads
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
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_
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