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 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "base/atomicops.h" | 9 #include "base/atomicops.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 virtual void SetAutomaticGainControl(bool enabled); | 169 virtual void SetAutomaticGainControl(bool enabled); |
170 | 170 |
171 // AudioInputCallback implementation. Threading details depends on the | 171 // AudioInputCallback implementation. Threading details depends on the |
172 // device-specific implementation. | 172 // device-specific implementation. |
173 virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size, | 173 virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size, |
174 uint32 hardware_delay_bytes, double volume) OVERRIDE; | 174 uint32 hardware_delay_bytes, double volume) OVERRIDE; |
175 virtual void OnClose(AudioInputStream* stream) OVERRIDE; | 175 virtual void OnClose(AudioInputStream* stream) OVERRIDE; |
176 virtual void OnError(AudioInputStream* stream, int code) OVERRIDE; | 176 virtual void OnError(AudioInputStream* stream, int code) OVERRIDE; |
177 | 177 |
178 bool LowLatencyMode() const { return sync_writer_ != NULL; } | 178 bool LowLatencyMode() const { return sync_writer_ != NULL; } |
179 scoped_refptr<base::MessageLoopProxy> message_loop() const { | |
180 return message_loop_; | |
181 } | |
182 | 179 |
183 protected: | 180 protected: |
184 friend class base::RefCountedThreadSafe<AudioInputController>; | 181 friend class base::RefCountedThreadSafe<AudioInputController>; |
185 | 182 |
186 // Internal state of the source. | 183 // Internal state of the source. |
187 enum State { | 184 enum State { |
188 kEmpty, | 185 kEmpty, |
189 kCreated, | 186 kCreated, |
190 kRecording, | 187 kRecording, |
191 kClosed, | 188 kClosed, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 static Factory* factory_; | 251 static Factory* factory_; |
255 | 252 |
256 double max_volume_; | 253 double max_volume_; |
257 | 254 |
258 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 255 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
259 }; | 256 }; |
260 | 257 |
261 } // namespace media | 258 } // namespace media |
262 | 259 |
263 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 260 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
OLD | NEW |