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_WAVEIN_INPUT_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 6 #define MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include <windows.h> | 10 #include <windows.h> |
11 #include <mmsystem.h> | 11 #include <mmsystem.h> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
16 #include "base/threading/thread_checker.h" | 16 #include "base/threading/thread_checker.h" |
17 #include "base/win/scoped_handle.h" | 17 #include "base/win/scoped_handle.h" |
18 #include "media/audio/audio_io.h" | 18 #include "media/audio/audio_io.h" |
19 #include "media/audio/audio_parameters.h" | 19 #include "media/audio/audio_parameters.h" |
20 | 20 |
21 namespace media { | 21 namespace media { |
22 | 22 |
23 class AudioBus; | |
24 class AudioManagerWin; | 23 class AudioManagerWin; |
25 | 24 |
26 class PCMWaveInAudioInputStream : public AudioInputStream { | 25 class PCMWaveInAudioInputStream : public AudioInputStream { |
27 public: | 26 public: |
28 // The ctor takes all the usual parameters, plus |manager| which is the | 27 // The ctor takes all the usual parameters, plus |manager| which is the |
29 // the audio manager who is creating this object and |device_id| which | 28 // the audio manager who is creating this object and |device_id| which |
30 // is provided by the operating system. | 29 // is provided by the operating system. |
31 PCMWaveInAudioInputStream(AudioManagerWin* manager, | 30 PCMWaveInAudioInputStream(AudioManagerWin* manager, |
32 const AudioParameters& params, | 31 const AudioParameters& params, |
33 int num_buffers, | 32 int num_buffers, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 116 |
118 // Pointer to the first allocated audio buffer. This object owns it. | 117 // Pointer to the first allocated audio buffer. This object owns it. |
119 WAVEHDR* buffer_; | 118 WAVEHDR* buffer_; |
120 | 119 |
121 // An event that is signaled when the callback thread is ready to stop. | 120 // An event that is signaled when the callback thread is ready to stop. |
122 base::win::ScopedHandle stopped_event_; | 121 base::win::ScopedHandle stopped_event_; |
123 | 122 |
124 // Lock used to avoid conflicts when Stop() is called during a callback. | 123 // Lock used to avoid conflicts when Stop() is called during a callback. |
125 base::Lock lock_; | 124 base::Lock lock_; |
126 | 125 |
127 // Extra audio bus used for storage of deinterleaved data for the OnData | |
128 // callback. | |
129 scoped_ptr<media::AudioBus> audio_bus_; | |
130 | |
131 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); | 126 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); |
132 }; | 127 }; |
133 | 128 |
134 } // namespace media | 129 } // namespace media |
135 | 130 |
136 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 131 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
OLD | NEW |