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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 protected: | 124 protected: |
125 virtual ~EventHandler() {} | 125 virtual ~EventHandler() {} |
126 }; | 126 }; |
127 | 127 |
128 // A synchronous writer interface used by AudioInputController for | 128 // A synchronous writer interface used by AudioInputController for |
129 // synchronous writing. | 129 // synchronous writing. |
130 class SyncWriter { | 130 class SyncWriter { |
131 public: | 131 public: |
132 virtual ~SyncWriter() {} | 132 virtual ~SyncWriter() {} |
133 | 133 |
134 // Notify the synchronous writer about the number of bytes in the | |
135 // soundcard which has been recorded. | |
136 virtual void UpdateRecordedBytes(uint32 bytes) = 0; | |
137 | |
138 // Write certain amount of data from |data|. | 134 // Write certain amount of data from |data|. |
139 virtual void Write(const AudioBus* data, | 135 virtual void Write(const AudioBus* data, |
140 double volume, | 136 double volume, |
141 bool key_pressed) = 0; | 137 bool key_pressed, |
| 138 uint32 hardware_delay_bytes) = 0; |
142 | 139 |
143 // Close this synchronous writer. | 140 // Close this synchronous writer. |
144 virtual void Close() = 0; | 141 virtual void Close() = 0; |
145 }; | 142 }; |
146 | 143 |
147 // AudioInputController::Create() can use the currently registered Factory | 144 // AudioInputController::Create() can use the currently registered Factory |
148 // to create the AudioInputController. Factory is intended for testing only. | 145 // to create the AudioInputController. Factory is intended for testing only. |
149 // |user_input_monitor| is used for typing detection and can be NULL. | 146 // |user_input_monitor| is used for typing detection and can be NULL. |
150 class Factory { | 147 class Factory { |
151 public: | 148 public: |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 | 365 |
369 // Time when a low-latency stream is created. | 366 // Time when a low-latency stream is created. |
370 base::TimeTicks low_latency_create_time_; | 367 base::TimeTicks low_latency_create_time_; |
371 | 368 |
372 DISALLOW_COPY_AND_ASSIGN(AudioInputController); | 369 DISALLOW_COPY_AND_ASSIGN(AudioInputController); |
373 }; | 370 }; |
374 | 371 |
375 } // namespace media | 372 } // namespace media |
376 | 373 |
377 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ | 374 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ |
OLD | NEW |