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 | 11 |
12 #include "base/basictypes.h" | |
13 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
14 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
15 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
16 #include "media/audio/audio_io.h" | 15 #include "media/audio/audio_io.h" |
17 #include "media/audio/audio_parameters.h" | 16 #include "media/audio/audio_parameters.h" |
18 | 17 |
19 namespace media { | 18 namespace media { |
20 | 19 |
21 class AudioManagerWin; | 20 class AudioManagerWin; |
22 | 21 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // we close so it can release its own resources. | 88 // we close so it can release its own resources. |
90 AudioManagerWin* manager_; | 89 AudioManagerWin* manager_; |
91 | 90 |
92 // We use the callback mostly to periodically request more audio data. | 91 // We use the callback mostly to periodically request more audio data. |
93 AudioSourceCallback* callback_; | 92 AudioSourceCallback* callback_; |
94 | 93 |
95 // The number of buffers of size |buffer_size_| each to use. | 94 // The number of buffers of size |buffer_size_| each to use. |
96 const int num_buffers_; | 95 const int num_buffers_; |
97 | 96 |
98 // The size in bytes of each audio buffer, we usually have two of these. | 97 // The size in bytes of each audio buffer, we usually have two of these. |
99 uint32 buffer_size_; | 98 uint32_t buffer_size_; |
100 | 99 |
101 // Volume level from 0 to 1. | 100 // Volume level from 0 to 1. |
102 float volume_; | 101 float volume_; |
103 | 102 |
104 // Channels from 0 to 8. | 103 // Channels from 0 to 8. |
105 const int channels_; | 104 const int channels_; |
106 | 105 |
107 // Number of bytes yet to be played in the hardware buffer. | 106 // Number of bytes yet to be played in the hardware buffer. |
108 uint32 pending_bytes_; | 107 uint32_t pending_bytes_; |
109 | 108 |
110 // The id assigned by the operating system to the selected wave output | 109 // The id assigned by the operating system to the selected wave output |
111 // hardware device. Usually this is just -1 which means 'default device'. | 110 // hardware device. Usually this is just -1 which means 'default device'. |
112 UINT device_id_; | 111 UINT device_id_; |
113 | 112 |
114 // Windows native structure to encode the format parameters. | 113 // Windows native structure to encode the format parameters. |
115 WAVEFORMATPCMEX format_; | 114 WAVEFORMATPCMEX format_; |
116 | 115 |
117 // Handle to the instance of the wave device. | 116 // Handle to the instance of the wave device. |
118 HWAVEOUT waveout_; | 117 HWAVEOUT waveout_; |
(...skipping 13 matching lines...) Expand all Loading... |
132 | 131 |
133 // Container for retrieving data from AudioSourceCallback::OnMoreData(). | 132 // Container for retrieving data from AudioSourceCallback::OnMoreData(). |
134 scoped_ptr<AudioBus> audio_bus_; | 133 scoped_ptr<AudioBus> audio_bus_; |
135 | 134 |
136 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); | 135 DISALLOW_COPY_AND_ASSIGN(PCMWaveOutAudioOutputStream); |
137 }; | 136 }; |
138 | 137 |
139 } // namespace media | 138 } // namespace media |
140 | 139 |
141 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ | 140 #endif // MEDIA_AUDIO_WIN_WAVEOUT_OUTPUT_WIN_H_ |
OLD | NEW |