OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <windows.h> | 8 #include <windows.h> |
9 #include <mmsystem.h> | 9 #include <mmsystem.h> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/scoped_handle_win.h" | 12 #include "base/scoped_handle_win.h" |
13 #include "media/audio/audio_io.h" | 13 #include "media/audio/audio_io.h" |
14 #include "media/audio/audio_parameters.h" | 14 #include "media/audio/audio_parameters.h" |
15 | 15 |
16 class AudioManagerWin; | 16 class AudioManagerWin; |
17 | 17 |
18 class PCMWaveInAudioInputStream : public AudioInputStream { | 18 class PCMWaveInAudioInputStream : public AudioInputStream { |
19 public: | 19 public: |
20 // The ctor takes all the usual parameters, plus |manager| which is the | 20 // The ctor takes all the usual parameters, plus |manager| which is the |
21 // the audio manager who is creating this object and |device_id| which | 21 // the audio manager who is creating this object and |device_id| which |
22 // is provided by the operating system. | 22 // is provided by the operating system. |
23 PCMWaveInAudioInputStream(AudioManagerWin* manager, AudioParameters params, | 23 PCMWaveInAudioInputStream(AudioManagerWin* manager, AudioParameters params, |
24 int num_buffers, uint32 samples_per_packet, | 24 int num_buffers, UINT device_id); |
25 UINT device_id); | |
26 virtual ~PCMWaveInAudioInputStream(); | 25 virtual ~PCMWaveInAudioInputStream(); |
27 | 26 |
28 // Implementation of AudioInputStream. | 27 // Implementation of AudioInputStream. |
29 virtual bool Open(); | 28 virtual bool Open(); |
30 virtual void Start(AudioInputCallback* callback); | 29 virtual void Start(AudioInputCallback* callback); |
31 virtual void Stop(); | 30 virtual void Stop(); |
32 virtual void Close(); | 31 virtual void Close(); |
33 | 32 |
34 private: | 33 private: |
35 enum State { | 34 enum State { |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Pointer to the first allocated audio buffer. This object owns it. | 92 // Pointer to the first allocated audio buffer. This object owns it. |
94 WAVEHDR* buffer_; | 93 WAVEHDR* buffer_; |
95 | 94 |
96 // An event that is signaled when the callback thread is ready to stop. | 95 // An event that is signaled when the callback thread is ready to stop. |
97 ScopedHandle stopped_event_; | 96 ScopedHandle stopped_event_; |
98 | 97 |
99 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); | 98 DISALLOW_COPY_AND_ASSIGN(PCMWaveInAudioInputStream); |
100 }; | 99 }; |
101 | 100 |
102 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ | 101 #endif // MEDIA_AUDIO_WIN_WAVEIN_INPUT_WIN_H_ |
OLD | NEW |