OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_output.h" |
| 6 |
5 #include <windows.h> | 7 #include <windows.h> |
6 #include <mmsystem.h> | 8 #include <mmsystem.h> |
7 | 9 |
8 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
9 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
10 #include "media/audio/audio_output.h" | |
11 #include "media/audio/win/audio_manager_win.h" | 12 #include "media/audio/win/audio_manager_win.h" |
12 #include "media/audio/win/waveout_output_win.h" | 13 #include "media/audio/win/waveout_output_win.h" |
13 | 14 |
14 // A do-nothing audio stream. It behaves like a regular audio stream but does | 15 // A do-nothing audio stream. It behaves like a regular audio stream but does |
15 // not have any side effect, except possibly the creation and tear-down of | 16 // not have any side effect, except possibly the creation and tear-down of |
16 // of a thread. It is useful to test code that uses audio streams such as | 17 // of a thread. It is useful to test code that uses audio streams such as |
17 // audio sources. | 18 // audio sources. |
18 class AudioOutputStreamMockWin : public AudioOutputStream { | 19 class AudioOutputStreamMockWin : public AudioOutputStream { |
19 public: | 20 public: |
20 explicit AudioOutputStreamMockWin(AudioManagerWin* manager) | 21 explicit AudioOutputStreamMockWin(AudioManagerWin* manager) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 g_audio_manager = NULL; | 143 g_audio_manager = NULL; |
143 } | 144 } |
144 | 145 |
145 AudioManager* AudioManager::GetAudioManager() { | 146 AudioManager* AudioManager::GetAudioManager() { |
146 if (!g_audio_manager) { | 147 if (!g_audio_manager) { |
147 g_audio_manager = new AudioManagerWin(); | 148 g_audio_manager = new AudioManagerWin(); |
148 base::AtExitManager::RegisterCallback(&DestroyAudioManagerWin, NULL); | 149 base::AtExitManager::RegisterCallback(&DestroyAudioManagerWin, NULL); |
149 } | 150 } |
150 return g_audio_manager; | 151 return g_audio_manager; |
151 } | 152 } |
152 | |
OLD | NEW |