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

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

Issue 10071038: RefCounted types should not have public destructors, content/browser part 2 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Copyright bump Created 8 years, 7 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
« no previous file with comments | « content/renderer/gpu/compositor_thread.cc ('k') | content/renderer/media/audio_input_device.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 virtual void OnDeviceStopped() = 0; 114 virtual void OnDeviceStopped() = 0;
115 115
116 protected: 116 protected:
117 virtual ~CaptureEventHandler() {} 117 virtual ~CaptureEventHandler() {}
118 }; 118 };
119 119
120 // Methods called on main render thread ------------------------------------- 120 // Methods called on main render thread -------------------------------------
121 AudioInputDevice(const media::AudioParameters& params, 121 AudioInputDevice(const media::AudioParameters& params,
122 CaptureCallback* callback, 122 CaptureCallback* callback,
123 CaptureEventHandler* event_handler); 123 CaptureEventHandler* event_handler);
124 virtual ~AudioInputDevice();
125 124
126 // Specify the |session_id| to query which device to use. This method is 125 // Specify the |session_id| to query which device to use. This method is
127 // asynchronous/non-blocking. 126 // asynchronous/non-blocking.
128 // Start() will use the second sequence if this method is called before. 127 // Start() will use the second sequence if this method is called before.
129 void SetDevice(int session_id); 128 void SetDevice(int session_id);
130 129
131 // Starts audio capturing. This method is asynchronous/non-blocking. 130 // Starts audio capturing. This method is asynchronous/non-blocking.
132 // TODO(henrika): add support for notification when recording has started. 131 // TODO(henrika): add support for notification when recording has started.
133 void Start(); 132 void Start();
134 133
(...skipping 24 matching lines...) Expand all
159 158
160 // Methods called on IO thread ---------------------------------------------- 159 // Methods called on IO thread ----------------------------------------------
161 // AudioInputMessageFilter::Delegate impl., called by AudioInputMessageFilter. 160 // AudioInputMessageFilter::Delegate impl., called by AudioInputMessageFilter.
162 virtual void OnStreamCreated(base::SharedMemoryHandle handle, 161 virtual void OnStreamCreated(base::SharedMemoryHandle handle,
163 base::SyncSocket::Handle socket_handle, 162 base::SyncSocket::Handle socket_handle,
164 uint32 length) OVERRIDE; 163 uint32 length) OVERRIDE;
165 virtual void OnVolume(double volume) OVERRIDE; 164 virtual void OnVolume(double volume) OVERRIDE;
166 virtual void OnStateChanged(AudioStreamState state) OVERRIDE; 165 virtual void OnStateChanged(AudioStreamState state) OVERRIDE;
167 virtual void OnDeviceReady(const std::string& device_id) OVERRIDE; 166 virtual void OnDeviceReady(const std::string& device_id) OVERRIDE;
168 167
168 protected:
169 virtual ~AudioInputDevice();
170
169 private: 171 private:
172 friend class base::RefCountedThreadSafe<AudioInputDevice>;
173
170 // Methods called on IO thread ---------------------------------------------- 174 // Methods called on IO thread ----------------------------------------------
171 // The following methods are tasks posted on the IO thread that needs to 175 // The following methods are tasks posted on the IO thread that needs to
172 // be executed on that thread. They interact with AudioInputMessageFilter and 176 // be executed on that thread. They interact with AudioInputMessageFilter and
173 // sends IPC messages on that thread. 177 // sends IPC messages on that thread.
174 void InitializeOnIOThread(); 178 void InitializeOnIOThread();
175 void SetSessionIdOnIOThread(int session_id); 179 void SetSessionIdOnIOThread(int session_id);
176 void StartOnIOThread(); 180 void StartOnIOThread();
177 void ShutDownOnIOThread(); 181 void ShutDownOnIOThread();
178 void SetVolumeOnIOThread(double volume); 182 void SetVolumeOnIOThread(double volume);
179 void SetAutomaticGainControlOnIOThread(bool enabled); 183 void SetAutomaticGainControlOnIOThread(bool enabled);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 // In order to avoid a race between OnStreamCreated and Stop(), we use this 221 // In order to avoid a race between OnStreamCreated and Stop(), we use this
218 // guard to control stopping and starting the audio thread. 222 // guard to control stopping and starting the audio thread.
219 base::Lock audio_thread_lock_; 223 base::Lock audio_thread_lock_;
220 AudioDeviceThread audio_thread_; 224 AudioDeviceThread audio_thread_;
221 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; 225 scoped_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_;
222 226
223 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice); 227 DISALLOW_IMPLICIT_CONSTRUCTORS(AudioInputDevice);
224 }; 228 };
225 229
226 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_ 230 #endif // CONTENT_RENDERER_MEDIA_AUDIO_INPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « content/renderer/gpu/compositor_thread.cc ('k') | content/renderer/media/audio_input_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698