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 #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 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
10 #include <mmreg.h> | 10 #include <mmreg.h> |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 #include <stdint.h> | 12 #include <stdint.h> |
13 | 13 |
| 14 #include <memory> |
| 15 |
14 #include "base/macros.h" | 16 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/synchronization/lock.h" | 17 #include "base/synchronization/lock.h" |
17 #include "base/win/scoped_handle.h" | 18 #include "base/win/scoped_handle.h" |
18 #include "media/audio/audio_io.h" | 19 #include "media/audio/audio_io.h" |
19 #include "media/base/audio_parameters.h" | 20 #include "media/base/audio_parameters.h" |
20 | 21 |
21 namespace media { | 22 namespace media { |
22 | 23 |
23 class AudioManagerWin; | 24 class AudioManagerWin; |
24 | 25 |
25 // Implements PCM audio output support for Windows using the WaveXXX API. | 26 // Implements PCM audio output support for Windows using the WaveXXX API. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 HWAVEOUT waveout_; | 121 HWAVEOUT waveout_; |
121 | 122 |
122 // Handle to the buffer event. | 123 // Handle to the buffer event. |
123 base::win::ScopedHandle buffer_event_; | 124 base::win::ScopedHandle buffer_event_; |
124 | 125 |
125 // Handle returned by RegisterWaitForSingleObject(). | 126 // Handle returned by RegisterWaitForSingleObject(). |
126 HANDLE waiting_handle_; | 127 HANDLE waiting_handle_; |
127 | 128 |
128 // Pointer to the allocated audio buffers, we allocate all buffers in one big | 129 // Pointer to the allocated audio buffers, we allocate all buffers in one big |
129 // chunk. This object owns them. | 130 // chunk. This object owns them. |
130 scoped_ptr<char[]> buffers_; | 131 std::unique_ptr<char[]> buffers_; |
131 | 132 |
132 // Lock used to avoid the conflict when callbacks are called simultaneously. | 133 // Lock used to avoid the conflict when callbacks are called simultaneously. |
133 base::Lock lock_; | 134 base::Lock lock_; |
134 | 135 |
135 // Container for retrieving data from AudioSourceCallback::OnMoreData(). | 136 // Container for retrieving data from AudioSourceCallback::OnMoreData(). |
136 scoped_ptr<AudioBus> audio_bus_; | 137 std::unique_ptr<AudioBus> audio_bus_; |
137 | 138 |
138 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); | 139 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); |
139 }; | 140 }; |
140 | 141 |
141 } // namespace media | 142 } // namespace media |
142 | 143 |
143 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 144 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
OLD | NEW |