Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: content/renderer/media/audio_input_device.h

Issue 9121045: Switch AudioDevice classes from SyncSocket to CancelableSyncSocket. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, add temporary ScopedAllowIO for the audio thread cleanup+TODO for next cl. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 unit utilizing audio input stream provided 5 // Low-latency audio capturing unit utilizing audio input stream provided
6 // by browser process through IPC. 6 // by browser process through IPC.
7 // 7 //
8 // Relationship of classes: 8 // Relationship of classes:
9 // 9 //
10 // AudioInputController AudioInputDevice 10 // AudioInputController AudioInputDevice
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 private: 157 private:
158 // Methods called on IO thread ---------------------------------------------- 158 // Methods called on IO thread ----------------------------------------------
159 // The following methods are tasks posted on the IO thread that needs to 159 // The following methods are tasks posted on the IO thread that needs to
160 // be executed on that thread. They interact with AudioInputMessageFilter and 160 // be executed on that thread. They interact with AudioInputMessageFilter and
161 // sends IPC messages on that thread. 161 // sends IPC messages on that thread.
162 void InitializeOnIOThread(); 162 void InitializeOnIOThread();
163 void SetSessionIdOnIOThread(int session_id); 163 void SetSessionIdOnIOThread(int session_id);
164 void StartOnIOThread(); 164 void StartOnIOThread();
165 void ShutDownOnIOThread(base::WaitableEvent* completion); 165 void ShutDownOnIOThread(base::WaitableEvent* completion);
166 void SetVolumeOnIOThread(double volume); 166 void SetVolumeOnIOThread(double volume);
167 // Closes socket and joins with the audio thread.
168 void ShutDownAudioThread();
167 169
168 void Send(IPC::Message* message); 170 void Send(IPC::Message* message);
169 171
170 // Method called on the audio thread ---------------------------------------- 172 // Method called on the audio thread ----------------------------------------
171 // Calls the client's callback for capturing audio. 173 // Calls the client's callback for capturing audio.
172 void FireCaptureCallback(int16* input_audio); 174 void FireCaptureCallback(int16* input_audio);
173 175
174 // DelegateSimpleThread::Delegate implementation. 176 // DelegateSimpleThread::Delegate implementation.
175 virtual void Run() OVERRIDE; 177 virtual void Run() OVERRIDE;
176 178
(...skipping 25 matching lines...) Expand all
202 204
203 // The media session ID used to identify which input device to be started. 205 // The media session ID used to identify which input device to be started.
204 // Only modified on the IO thread. 206 // Only modified on the IO thread.
205 int session_id_; 207 int session_id_;
206 208
207 // State variable used to indicate it is waiting for a OnDeviceReady() 209 // State variable used to indicate it is waiting for a OnDeviceReady()
208 // callback. Only modified on the IO thread. 210 // callback. Only modified on the IO thread.
209 bool pending_device_ready_; 211 bool pending_device_ready_;
210 212
211 base::SharedMemoryHandle shared_memory_handle_; 213 base::SharedMemoryHandle shared_memory_handle_;
212 base::SyncSocket::Handle socket_handle_; 214 scoped_ptr<base::CancelableSyncSocket> audio_socket_;
213 int memory_length_; 215 int memory_length_;
214 216
215 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); 217 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
216 }; 218 };
217 219
218 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_ 220 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698