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

Side by Side Diff: media/audio/audio_input_device.h

Issue 2076793002: Cleanup AudioDeviceThread to reduce locking and unused features. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 // Stores the Automatic Gain Control state. Default is false. 149 // Stores the Automatic Gain Control state. Default is false.
150 // Only modified on the IO thread. 150 // Only modified on the IO thread.
151 bool agc_is_enabled_; 151 bool agc_is_enabled_;
152 152
153 // Our audio thread callback class. See source file for details. 153 // Our audio thread callback class. See source file for details.
154 class AudioThreadCallback; 154 class AudioThreadCallback;
155 155
156 // In order to avoid a race between OnStreamCreated and Stop(), we use this 156 // In order to avoid a race between OnStreamCreated and Stop(), we use this
157 // guard to control stopping and starting the audio thread. 157 // guard to control stopping and starting the audio thread.
158 base::Lock audio_thread_lock_; 158 base::Lock audio_thread_lock_;
159 AudioDeviceThread audio_thread_;
160 std::unique_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_; 159 std::unique_ptr<AudioInputDevice::AudioThreadCallback> audio_callback_;
160 std::unique_ptr<AudioDeviceThread> audio_thread_;
161 161
162 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop() 162 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop()
163 // so we don't start the audio thread pointing to a potentially freed 163 // so we don't start the audio thread pointing to a potentially freed
164 // |callback_|. 164 // |callback_|.
165 // 165 //
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698