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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 virtual void Stop() OVERRIDE; | 98 virtual void Stop() OVERRIDE; |
99 virtual void SetVolume(double volume) OVERRIDE; | 99 virtual void SetVolume(double volume) OVERRIDE; |
100 virtual void SetDevice(int session_id) OVERRIDE; | 100 virtual void SetDevice(int session_id) OVERRIDE; |
101 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE; | 101 virtual void SetAutomaticGainControl(bool enabled) OVERRIDE; |
102 | 102 |
103 protected: | 103 protected: |
104 // Methods called on IO thread ---------------------------------------------- | 104 // Methods called on IO thread ---------------------------------------------- |
105 // AudioInputIPCDelegate implementation. | 105 // AudioInputIPCDelegate implementation. |
106 virtual void OnStreamCreated(base::SharedMemoryHandle handle, | 106 virtual void OnStreamCreated(base::SharedMemoryHandle handle, |
107 base::SyncSocket::Handle socket_handle, | 107 base::SyncSocket::Handle socket_handle, |
108 int length) OVERRIDE; | 108 int length, |
| 109 int total_segments) OVERRIDE; |
109 virtual void OnVolume(double volume) OVERRIDE; | 110 virtual void OnVolume(double volume) OVERRIDE; |
110 virtual void OnStateChanged( | 111 virtual void OnStateChanged( |
111 AudioInputIPCDelegate::State state) OVERRIDE; | 112 AudioInputIPCDelegate::State state) OVERRIDE; |
112 virtual void OnDeviceReady(const std::string& device_id) OVERRIDE; | 113 virtual void OnDeviceReady(const std::string& device_id) OVERRIDE; |
113 virtual void OnIPCClosed() OVERRIDE; | 114 virtual void OnIPCClosed() OVERRIDE; |
114 | 115 |
115 friend class base::RefCountedThreadSafe<AudioInputDevice>; | 116 friend class base::RefCountedThreadSafe<AudioInputDevice>; |
116 virtual ~AudioInputDevice(); | 117 virtual ~AudioInputDevice(); |
117 | 118 |
118 private: | 119 private: |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 base::Lock audio_thread_lock_; | 162 base::Lock audio_thread_lock_; |
162 AudioDeviceThread audio_thread_; | 163 AudioDeviceThread audio_thread_; |
163 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; | 164 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; |
164 | 165 |
165 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); | 166 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); |
166 }; | 167 }; |
167 | 168 |
168 } // namespace media | 169 } // namespace media |
169 | 170 |
170 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ | 171 #endif // MEDIA_AUDIO_AUDIO_INPUT_DEVICE_H_ |
OLD | NEW |