| 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 #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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // | 111 // |
| 112 // It is safe to call this method more than once. Calls after the first one | 112 // It is safe to call this method more than once. Calls after the first one |
| 113 // will have no effect. | 113 // will have no effect. |
| 114 virtual void Close(); | 114 virtual void Close(); |
| 115 | 115 |
| 116 bool LowLatencyMode() const { return sync_writer_ != NULL; } | 116 bool LowLatencyMode() const { return sync_writer_ != NULL; } |
| 117 | 117 |
| 118 /////////////////////////////////////////////////////////////////////////// | 118 /////////////////////////////////////////////////////////////////////////// |
| 119 // AudioInputCallback methods. | 119 // AudioInputCallback methods. |
| 120 virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size, | 120 virtual void OnData(AudioInputStream* stream, const uint8* src, uint32 size, |
| 121 uint32 hardware_delay_bytes); | 121 uint32 hardware_delay_bytes) OVERRIDE; |
| 122 virtual void OnClose(AudioInputStream* stream); | 122 virtual void OnClose(AudioInputStream* stream) OVERRIDE; |
| 123 virtual void OnError(AudioInputStream* stream, int code); | 123 virtual void OnError(AudioInputStream* stream, int code) OVERRIDE; |
| 124 | 124 |
| 125 protected: | 125 protected: |
| 126 // Internal state of the source. | 126 // Internal state of the source. |
| 127 enum State { | 127 enum State { |
| 128 kEmpty, | 128 kEmpty, |
| 129 kCreated, | 129 kCreated, |
| 130 kRecording, | 130 kRecording, |
| 131 kClosed, | 131 kClosed, |
| 132 kError | 132 kError |
| 133 }; | 133 }; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 SyncWriter* sync_writer_; | 165 SyncWriter* sync_writer_; |
| 166 | 166 |
| 167 static Factory* factory_; | 167 static Factory* factory_; |
| 168 | 168 |
| 169 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 169 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
| 170 }; | 170 }; |
| 171 | 171 |
| 172 } // namespace media | 172 } // namespace media |
| 173 | 173 |
| 174 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 174 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
| OLD | NEW |