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