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 // Implementation of AudioInputStream for Windows using Windows Core Audio | 5 // Implementation of AudioInputStream for Windows using Windows Core Audio |
6 // WASAPI for low latency capturing. | 6 // WASAPI for low latency capturing. |
7 // | 7 // |
8 // Overview of operation: | 8 // Overview of operation: |
9 // | 9 // |
10 // - An object of WASAPIAudioInputStream is created by the AudioManager | 10 // - An object of WASAPIAudioInputStream is created by the AudioManager |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 #include "base/win/scoped_co_mem.h" | 68 #include "base/win/scoped_co_mem.h" |
69 #include "base/win/scoped_com_initializer.h" | 69 #include "base/win/scoped_com_initializer.h" |
70 #include "base/win/scoped_comptr.h" | 70 #include "base/win/scoped_comptr.h" |
71 #include "base/win/scoped_handle.h" | 71 #include "base/win/scoped_handle.h" |
72 #include "media/audio/agc_audio_stream.h" | 72 #include "media/audio/agc_audio_stream.h" |
73 #include "media/audio/audio_parameters.h" | 73 #include "media/audio/audio_parameters.h" |
74 #include "media/base/media_export.h" | 74 #include "media/base/media_export.h" |
75 | 75 |
76 namespace media { | 76 namespace media { |
77 | 77 |
78 class AudioBus; | |
79 class AudioManagerWin; | 78 class AudioManagerWin; |
80 | 79 |
81 // AudioInputStream implementation using Windows Core Audio APIs. | 80 // AudioInputStream implementation using Windows Core Audio APIs. |
82 class MEDIA_EXPORT WASAPIAudioInputStream | 81 class MEDIA_EXPORT WASAPIAudioInputStream |
83 : public AgcAudioStream<AudioInputStream>, | 82 : public AgcAudioStream<AudioInputStream>, |
84 public base::DelegateSimpleThread::Delegate, | 83 public base::DelegateSimpleThread::Delegate, |
85 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 84 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
86 public: | 85 public: |
87 // The ctor takes all the usual parameters, plus |manager| which is the | 86 // The ctor takes all the usual parameters, plus |manager| which is the |
88 // the audio manager who is creating this object. | 87 // the audio manager who is creating this object. |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // This interface does only work with shared-mode streams. | 204 // This interface does only work with shared-mode streams. |
206 base::win::ScopedComPtr<ISimpleAudioVolume> simple_audio_volume_; | 205 base::win::ScopedComPtr<ISimpleAudioVolume> simple_audio_volume_; |
207 | 206 |
208 // The audio engine will signal this event each time a buffer has been | 207 // The audio engine will signal this event each time a buffer has been |
209 // recorded. | 208 // recorded. |
210 base::win::ScopedHandle audio_samples_ready_event_; | 209 base::win::ScopedHandle audio_samples_ready_event_; |
211 | 210 |
212 // This event will be signaled when capturing shall stop. | 211 // This event will be signaled when capturing shall stop. |
213 base::win::ScopedHandle stop_capture_event_; | 212 base::win::ScopedHandle stop_capture_event_; |
214 | 213 |
215 // Extra audio bus used for storage of deinterleaved data for the OnData | |
216 // callback. | |
217 scoped_ptr<media::AudioBus> audio_bus_; | |
218 | |
219 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); | 214 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); |
220 }; | 215 }; |
221 | 216 |
222 } // namespace media | 217 } // namespace media |
223 | 218 |
224 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 219 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
OLD | NEW |