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 // Low-latency audio capturing class utilizing audio input stream provided | 5 // Low-latency audio capturing class utilizing audio input stream provided |
6 // by a server (browser) process by use of an IPC interface. | 6 // by a server (browser) process by use of an IPC interface. |
7 // | 7 // |
8 // Relationship of classes: | 8 // Relationship of classes: |
9 // | 9 // |
10 // AudioInputController AudioInputDevice | 10 // AudioInputController AudioInputDevice |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 friend class base::RefCountedThreadSafe<AudioInputDevice>; | 99 friend class base::RefCountedThreadSafe<AudioInputDevice>; |
100 ~AudioInputDevice() override; | 100 ~AudioInputDevice() override; |
101 | 101 |
102 // Methods called on IO thread ---------------------------------------------- | 102 // Methods called on IO thread ---------------------------------------------- |
103 // AudioInputIPCDelegate implementation. | 103 // AudioInputIPCDelegate implementation. |
104 void OnStreamCreated(base::SharedMemoryHandle handle, | 104 void OnStreamCreated(base::SharedMemoryHandle handle, |
105 base::SyncSocket::Handle socket_handle, | 105 base::SyncSocket::Handle socket_handle, |
106 int length, | 106 int length, |
107 int total_segments) override; | 107 int total_segments) override; |
108 void OnError() override; | 108 void OnError() override; |
| 109 void OnMuted(bool is_muted) override; |
109 void OnIPCClosed() override; | 110 void OnIPCClosed() override; |
110 | 111 |
111 private: | 112 private: |
112 // Note: The ordering of members in this enum is critical to correct behavior! | 113 // Note: The ordering of members in this enum is critical to correct behavior! |
113 enum State { | 114 enum State { |
114 IPC_CLOSED, // No more IPCs can take place. | 115 IPC_CLOSED, // No more IPCs can take place. |
115 IDLE, // Not started. | 116 IDLE, // Not started. |
116 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. | 117 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. |
117 RECORDING, // Receiving audio data. | 118 RECORDING, // Receiving audio data. |
118 }; | 119 }; |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 // Flags that missing callbacks has been detected. Used for statistics, | 197 // Flags that missing callbacks has been detected. Used for statistics, |
197 // reported when stopping. Must only be accessed on the IO thread. | 198 // reported when stopping. Must only be accessed on the IO thread. |
198 bool missing_callbacks_detected_; | 199 bool missing_callbacks_detected_; |
199 | 200 |
200 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 201 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
201 }; | 202 }; |
202 | 203 |
203 } // namespace media | 204 } // namespace media |
204 | 205 |
205 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 206 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
OLD | NEW |