| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // - The Multimedia Class Scheduler service (MMCSS) is utilized to boost | 50 // - The Multimedia Class Scheduler service (MMCSS) is utilized to boost |
| 51 // the priority of the capture thread. | 51 // the priority of the capture thread. |
| 52 // | 52 // |
| 53 #ifndef MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 53 #ifndef MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
| 54 #define MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 54 #define MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
| 55 | 55 |
| 56 #include <Audioclient.h> | 56 #include <Audioclient.h> |
| 57 #include <MMDeviceAPI.h> | 57 #include <MMDeviceAPI.h> |
| 58 | 58 |
| 59 #include "base/compiler_specific.h" | 59 #include "base/compiler_specific.h" |
| 60 #include "base/media_export.h" |
| 60 #include "base/threading/platform_thread.h" | 61 #include "base/threading/platform_thread.h" |
| 61 #include "base/threading/simple_thread.h" | 62 #include "base/threading/simple_thread.h" |
| 62 #include "base/win/scoped_co_mem.h" | 63 #include "base/win/scoped_co_mem.h" |
| 63 #include "base/win/scoped_com_initializer.h" | 64 #include "base/win/scoped_com_initializer.h" |
| 64 #include "base/win/scoped_comptr.h" | 65 #include "base/win/scoped_comptr.h" |
| 65 #include "base/win/scoped_handle.h" | 66 #include "base/win/scoped_handle.h" |
| 66 #include "media/audio/audio_io.h" | 67 #include "media/audio/audio_io.h" |
| 67 #include "media/audio/audio_parameters.h" | 68 #include "media/audio/audio_parameters.h" |
| 68 | 69 |
| 69 class AudioManagerWin; | 70 class AudioManagerWin; |
| 70 | 71 |
| 71 // AudioInputStream implementation using Windows Core Audio APIs. | 72 // AudioInputStream implementation using Windows Core Audio APIs. |
| 72 class WASAPIAudioInputStream | 73 class MEDIA_EXPORT WASAPIAudioInputStream |
| 73 : public AudioInputStream, | 74 : public AudioInputStream, |
| 74 public base::DelegateSimpleThread::Delegate { | 75 public base::DelegateSimpleThread::Delegate { |
| 75 public: | 76 public: |
| 76 // The ctor takes all the usual parameters, plus |manager| which is the | 77 // The ctor takes all the usual parameters, plus |manager| which is the |
| 77 // the audio manager who is creating this object. | 78 // the audio manager who is creating this object. |
| 78 WASAPIAudioInputStream(AudioManagerWin* manager, | 79 WASAPIAudioInputStream(AudioManagerWin* manager, |
| 79 const AudioParameters& params, | 80 const AudioParameters& params, |
| 80 ERole device_role); | 81 ERole device_role); |
| 81 // The dtor is typically called by the AudioManager only and it is usually | 82 // The dtor is typically called by the AudioManager only and it is usually |
| 82 // triggered by calling AudioInputStream::Close(). | 83 // triggered by calling AudioInputStream::Close(). |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // recorded. | 174 // recorded. |
| 174 base::win::ScopedHandle audio_samples_ready_event_; | 175 base::win::ScopedHandle audio_samples_ready_event_; |
| 175 | 176 |
| 176 // This event will be signaled when capturing shall stop. | 177 // This event will be signaled when capturing shall stop. |
| 177 base::win::ScopedHandle stop_capture_event_; | 178 base::win::ScopedHandle stop_capture_event_; |
| 178 | 179 |
| 179 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); | 180 DISALLOW_COPY_AND_ASSIGN(WASAPIAudioInputStream); |
| 180 }; | 181 }; |
| 181 | 182 |
| 182 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ | 183 #endif // MEDIA_AUDIO_WIN_AUDIO_LOW_LATENCY_INPUT_WIN_H_ |
| OLD | NEW |