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

Side by Side Diff: media/audio/win/audio_manager_win.cc

Issue 9692038: stopping the audio thread before destroying the AudioManager<Platform> (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased and fixed the speech recognition unittest Created 8 years, 9 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
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 #include "media/audio/audio_io.h" 5 #include "media/audio/audio_io.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <objbase.h> // This has to be before initguid.h 8 #include <objbase.h> // This has to be before initguid.h
9 #include <initguid.h> 9 #include <initguid.h>
10 #include <mmsystem.h> 10 #include <mmsystem.h>
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 enumeration_type_ = kWaveEnumeration; 101 enumeration_type_ = kWaveEnumeration;
102 } else { 102 } else {
103 // Use the MMDevice API for device enumeration if Vista or higher. 103 // Use the MMDevice API for device enumeration if Vista or higher.
104 enumeration_type_ = kMMDeviceEnumeration; 104 enumeration_type_ = kMMDeviceEnumeration;
105 } 105 }
106 106
107 SetMaxOutputStreamsAllowed(kMaxOutputStreams); 107 SetMaxOutputStreamsAllowed(kMaxOutputStreams);
108 } 108 }
109 109
110 AudioManagerWin::~AudioManagerWin() { 110 AudioManagerWin::~AudioManagerWin() {
111 Shutdown();
111 } 112 }
112 113
113 bool AudioManagerWin::HasAudioOutputDevices() { 114 bool AudioManagerWin::HasAudioOutputDevices() {
114 return (::waveOutGetNumDevs() != 0); 115 return (::waveOutGetNumDevs() != 0);
115 } 116 }
116 117
117 bool AudioManagerWin::HasAudioInputDevices() { 118 bool AudioManagerWin::HasAudioInputDevices() {
118 return (::waveInGetNumDevs() != 0); 119 return (::waveInGetNumDevs() != 0);
119 } 120 }
120 121
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 stream = new WASAPIAudioInputStream(this, params, device_id); 294 stream = new WASAPIAudioInputStream(this, params, device_id);
294 } 295 }
295 296
296 return stream; 297 return stream;
297 } 298 }
298 299
299 /// static 300 /// static
300 AudioManager* CreateAudioManager() { 301 AudioManager* CreateAudioManager() {
301 return new AudioManagerWin(); 302 return new AudioManagerWin();
302 } 303 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698