| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include <string> | 66 #include <string> |
| 67 | 67 |
| 68 #include "base/compiler_specific.h" | 68 #include "base/compiler_specific.h" |
| 69 #include "base/threading/non_thread_safe.h" | 69 #include "base/threading/non_thread_safe.h" |
| 70 #include "base/threading/platform_thread.h" | 70 #include "base/threading/platform_thread.h" |
| 71 #include "base/threading/simple_thread.h" | 71 #include "base/threading/simple_thread.h" |
| 72 #include "base/win/scoped_co_mem.h" | 72 #include "base/win/scoped_co_mem.h" |
| 73 #include "base/win/scoped_com_initializer.h" | 73 #include "base/win/scoped_com_initializer.h" |
| 74 #include "base/win/scoped_comptr.h" | 74 #include "base/win/scoped_comptr.h" |
| 75 #include "base/win/scoped_handle.h" | 75 #include "base/win/scoped_handle.h" |
| 76 #include "media/audio/audio_io.h" | 76 #include "media/audio/audio_input_stream_impl.h" |
| 77 #include "media/audio/audio_parameters.h" | 77 #include "media/audio/audio_parameters.h" |
| 78 #include "media/base/media_export.h" | 78 #include "media/base/media_export.h" |
| 79 | 79 |
| 80 class AudioManagerWin; | 80 class AudioManagerWin; |
| 81 | 81 |
| 82 // AudioInputStream implementation using Windows Core Audio APIs. | 82 // AudioInputStream implementation using Windows Core Audio APIs. |
| 83 class MEDIA_EXPORT WASAPIAudioInputStream | 83 class MEDIA_EXPORT WASAPIAudioInputStream |
| 84 : public AudioInputStream, | 84 : public AudioInputStreamImpl, |
| 85 public base::DelegateSimpleThread::Delegate, | 85 public base::DelegateSimpleThread::Delegate, |
| 86 NON_EXPORTED_BASE(public base::NonThreadSafe) { | 86 NON_EXPORTED_BASE(public base::NonThreadSafe) { |
| 87 public: | 87 public: |
| 88 // The ctor takes all the usual parameters, plus |manager| which is the | 88 // The ctor takes all the usual parameters, plus |manager| which is the |
| 89 // the audio manager who is creating this object. | 89 // the audio manager who is creating this object. |
| 90 WASAPIAudioInputStream(AudioManagerWin* manager, | 90 WASAPIAudioInputStream(AudioManagerWin* manager, |
| 91 const AudioParameters& params, | 91 const AudioParameters& params, |
| 92 const std::string& device_id); | 92 const std::string& device_id); |
| 93 // The dtor is typically called by the AudioManager only and it is usually | 93 // The dtor is typically called by the AudioManager only and it is usually |
| 94 // triggered by calling AudioInputStream::Close(). | 94 // triggered by calling AudioInputStream::Close(). |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 // recorded. | 204 // recorded. |
| 205 base::win::ScopedHandle audio_samples_ready_event_; | 205 base::win::ScopedHandle audio_samples_ready_event_; |
| 206 | 206 |
| 207 // This event will be signaled when capturing shall stop. | 207 // This event will be signaled when capturing shall stop. |
| 208 base::win::ScopedHandle stop_capture_event_; | 208 base::win::ScopedHandle stop_capture_event_; |
| 209 | 209 |
| 210 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); | 210 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); |
| 211 }; | 211 }; |
| 212 | 212 |
| 213 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 213 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
| OLD | NEW |