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

Side by Side Diff: media/audio/audio_output_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 // Audio rendering unit utilizing audio output stream provided by browser 5 // Audio rendering unit utilizing audio output stream provided by browser
6 // process through IPC. 6 // process through IPC.
7 // 7 //
8 // Relationship of classes. 8 // Relationship of classes.
9 // 9 //
10 // AudioOutputController AudioOutputDevice 10 // AudioOutputController AudioOutputDevice
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is 191 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is
192 // received in OnDeviceAuthorized(). 192 // received in OnDeviceAuthorized().
193 std::string matched_device_id_; 193 std::string matched_device_id_;
194 194
195 // Our audio thread callback class. See source file for details. 195 // Our audio thread callback class. See source file for details.
196 class AudioThreadCallback; 196 class AudioThreadCallback;
197 197
198 // In order to avoid a race between OnStreamCreated and Stop(), we use this 198 // In order to avoid a race between OnStreamCreated and Stop(), we use this
199 // guard to control stopping and starting the audio thread. 199 // guard to control stopping and starting the audio thread.
200 base::Lock audio_thread_lock_; 200 base::Lock audio_thread_lock_;
201 AudioDeviceThread audio_thread_;
202 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_; 201 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_;
202 std::unique_ptr<AudioDeviceThread> audio_thread_;
203 203
204 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop() 204 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop()
205 // so we don't start the audio thread pointing to a potentially freed 205 // so we don't start the audio thread pointing to a potentially freed
206 // |callback_|. 206 // |callback_|.
207 // 207 //
208 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept 208 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept
209 // the callback via Start(). See http://crbug.com/151051 for details. 209 // the callback via Start(). See http://crbug.com/151051 for details.
210 bool stopping_hack_; 210 bool stopping_hack_;
211 211
212 base::WaitableEvent did_receive_auth_; 212 base::WaitableEvent did_receive_auth_;
213 AudioParameters output_params_; 213 AudioParameters output_params_;
214 OutputDeviceStatus device_status_; 214 OutputDeviceStatus device_status_;
215 215
216 const base::TimeDelta auth_timeout_; 216 const base::TimeDelta auth_timeout_;
217 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; 217 std::unique_ptr<base::OneShotTimer> auth_timeout_action_;
218 218
219 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); 219 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
220 }; 220 };
221 221
222 } // namespace media 222 } // namespace media
223 223
224 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ 224 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698