| 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 friend class base::RefCountedThreadSafe<AudioInputDevice>; | 97 friend class base::RefCountedThreadSafe<AudioInputDevice>; |
| 98 ~AudioInputDevice() override; | 98 ~AudioInputDevice() override; |
| 99 | 99 |
| 100 // Methods called on IO thread ---------------------------------------------- | 100 // Methods called on IO thread ---------------------------------------------- |
| 101 // AudioInputIPCDelegate implementation. | 101 // AudioInputIPCDelegate implementation. |
| 102 void OnStreamCreated(base::SharedMemoryHandle handle, | 102 void OnStreamCreated(base::SharedMemoryHandle handle, |
| 103 base::SyncSocket::Handle socket_handle, | 103 base::SyncSocket::Handle socket_handle, |
| 104 int length, | 104 int length, |
| 105 int total_segments) override; | 105 int total_segments) override; |
| 106 void OnVolume(double volume) override; | 106 void OnVolume(double volume) override; |
| 107 void OnStateChanged(AudioInputIPCDelegate::State state) override; | 107 void OnStateChanged(AudioInputIPCDelegateState state) override; |
| 108 void OnIPCClosed() override; | 108 void OnIPCClosed() override; |
| 109 | 109 |
| 110 private: | 110 private: |
| 111 // Note: The ordering of members in this enum is critical to correct behavior! | 111 // Note: The ordering of members in this enum is critical to correct behavior! |
| 112 enum State { | 112 enum State { |
| 113 IPC_CLOSED, // No more IPCs can take place. | 113 IPC_CLOSED, // No more IPCs can take place. |
| 114 IDLE, // Not started. | 114 IDLE, // Not started. |
| 115 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. | 115 CREATING_STREAM, // Waiting for OnStreamCreated() to be called back. |
| 116 RECORDING, // Receiving audio data. | 116 RECORDING, // Receiving audio data. |
| 117 }; | 117 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // TODO(miu): Replace this by changing AudioCapturerSource to accept the | 166 // TODO(miu): Replace this by changing AudioCapturerSource to accept the |
| 167 // callback via Start(). See http://crbug.com/151051 for details. | 167 // callback via Start(). See http://crbug.com/151051 for details. |
| 168 bool stopping_hack_; | 168 bool stopping_hack_; |
| 169 | 169 |
| 170 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 170 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
| 171 }; | 171 }; |
| 172 | 172 |
| 173 } // namespace media | 173 } // namespace media |
| 174 | 174 |
| 175 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 175 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
| OLD | NEW |