| 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 #include "media/audio/win/audio_manager_win.h" | 5 #include "media/audio/win/audio_manager_win.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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 148 |
| 149 // Task must be posted last to avoid races from handing out "this" to the | 149 // Task must be posted last to avoid races from handing out "this" to the |
| 150 // audio thread. | 150 // audio thread. |
| 151 GetTaskRunner()->PostTask( | 151 GetTaskRunner()->PostTask( |
| 152 FROM_HERE, base::Bind(&AudioManagerWin::InitializeOnAudioThread, | 152 FROM_HERE, base::Bind(&AudioManagerWin::InitializeOnAudioThread, |
| 153 base::Unretained(this))); | 153 base::Unretained(this))); |
| 154 } | 154 } |
| 155 | 155 |
| 156 AudioManagerWin::~AudioManagerWin() = default; | 156 AudioManagerWin::~AudioManagerWin() = default; |
| 157 | 157 |
| 158 void AudioManagerWin::ShutdownOnAudioThread() { | 158 void AudioManagerWin::ShutdownOnAudioThread(bool immediately) { |
| 159 AudioManagerBase::ShutdownOnAudioThread(); | 159 AudioManagerBase::ShutdownOnAudioThread(immediately); |
| 160 | 160 |
| 161 // Destroy AudioDeviceListenerWin instance on the audio thread because it | 161 // Destroy AudioDeviceListenerWin instance on the audio thread because it |
| 162 // expects to be constructed and destroyed on the same thread. | 162 // expects to be constructed and destroyed on the same thread. |
| 163 output_device_listener_.reset(); | 163 output_device_listener_.reset(); |
| 164 } | 164 } |
| 165 | 165 |
| 166 bool AudioManagerWin::HasAudioOutputDevices() { | 166 bool AudioManagerWin::HasAudioOutputDevices() { |
| 167 return (::waveOutGetNumDevs() != 0); | 167 return (::waveOutGetNumDevs() != 0); |
| 168 } | 168 } |
| 169 | 169 |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 | 467 |
| 468 // static | 468 // static |
| 469 std::unique_ptr<AudioManager> CreateAudioManager( | 469 std::unique_ptr<AudioManager> CreateAudioManager( |
| 470 std::unique_ptr<AudioThread> audio_thread, | 470 std::unique_ptr<AudioThread> audio_thread, |
| 471 AudioLogFactory* audio_log_factory) { | 471 AudioLogFactory* audio_log_factory) { |
| 472 return base::MakeUnique<AudioManagerWin>(std::move(audio_thread), | 472 return base::MakeUnique<AudioManagerWin>(std::move(audio_thread), |
| 473 audio_log_factory); | 473 audio_log_factory); |
| 474 } | 474 } |
| 475 | 475 |
| 476 } // namespace media | 476 } // namespace media |
| OLD | NEW |