| 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 protected: | 98 protected: |
| 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, |
| 108 bool initially_muted) override; |
| 108 void OnError() override; | 109 void OnError() override; |
| 109 void OnMuted(bool is_muted) override; | 110 void OnMuted(bool is_muted) override; |
| 110 void OnIPCClosed() override; | 111 void OnIPCClosed() override; |
| 111 | 112 |
| 112 private: | 113 private: |
| 113 // Note: The ordering of members in this enum is critical to correct behavior! | 114 // Note: The ordering of members in this enum is critical to correct behavior! |
| 114 enum State { | 115 enum State { |
| 115 IPC_CLOSED, // No more IPCs can take place. | 116 IPC_CLOSED, // No more IPCs can take place. |
| 116 IDLE, // Not started. | 117 IDLE, // Not started. |
| 117 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. | 118 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 // Flags that missing callbacks has been detected. Used for statistics, | 198 // Flags that missing callbacks has been detected. Used for statistics, |
| 198 // reported when stopping. Must only be accessed on the IO thread. | 199 // reported when stopping. Must only be accessed on the IO thread. |
| 199 bool missing_callbacks_detected_; | 200 bool missing_callbacks_detected_; |
| 200 | 201 |
| 201 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 202 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
| 202 }; | 203 }; |
| 203 | 204 |
| 204 } // namespace media | 205 } // namespace media |
| 205 | 206 |
| 206 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 207 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
| OLD | NEW |