OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
6 #define MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 6 #define MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <windows.h> | 9 #include <windows.h> |
10 #include <mmsystem.h> | 10 #include <mmsystem.h> |
11 #include <mmreg.h> | 11 #include <mmreg.h> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
17 #include "media/audio/audio_io.h" | 17 #include "media/audio/audio_io.h" |
18 #include "media/audio/audio_parameters.h" | 18 #include "media/audio/audio_parameters.h" |
19 | 19 |
| 20 namespace media { |
| 21 |
20 class AudioManagerWin; | 22 class AudioManagerWin; |
21 | 23 |
22 // Implements PCM audio output support for Windows using the WaveXXX API. | 24 // Implements PCM audio output support for Windows using the WaveXXX API. |
23 // While not as nice as the DirectSound-based API, it should work in all target | 25 // While not as nice as the DirectSound-based API, it should work in all target |
24 // operating systems regardless or DirectX version installed. It is known that | 26 // operating systems regardless or DirectX version installed. It is known that |
25 // in some machines WaveXXX based audio is better while in others DirectSound | 27 // in some machines WaveXXX based audio is better while in others DirectSound |
26 // is better. | 28 // is better. |
27 // | 29 // |
28 // Important: the OnXXXX functions in AudioSourceCallback are called by more | 30 // Important: the OnXXXX functions in AudioSourceCallback are called by more |
29 // than one thread so it is important to have some form of synchronization if | 31 // than one thread so it is important to have some form of synchronization if |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // Pointer to the allocated audio buffers, we allocate all buffers in one big | 127 // Pointer to the allocated audio buffers, we allocate all buffers in one big |
126 // chunk. This object owns them. | 128 // chunk. This object owns them. |
127 scoped_array<char> buffers_; | 129 scoped_array<char> buffers_; |
128 | 130 |
129 // Lock used to avoid the conflict when callbacks are called simultaneously. | 131 // Lock used to avoid the conflict when callbacks are called simultaneously. |
130 base::Lock lock_; | 132 base::Lock lock_; |
131 | 133 |
132 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); | 134 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); |
133 }; | 135 }; |
134 | 136 |
| 137 } // namespace media |
| 138 |
135 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 139 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
OLD | NEW |