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

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: Rebase. Relocate one-time use variables. 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
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_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 // 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is 192 // If |device_id_| is empty and |session_id_| is not, |matched_device_id_| is
193 // received in OnDeviceAuthorized(). 193 // received in OnDeviceAuthorized().
194 std::string matched_device_id_; 194 std::string matched_device_id_;
195 195
196 // Our audio thread callback class. See source file for details. 196 // Our audio thread callback class. See source file for details.
197 class AudioThreadCallback; 197 class AudioThreadCallback;
198 198
199 // In order to avoid a race between OnStreamCreated and Stop(), we use this 199 // In order to avoid a race between OnStreamCreated and Stop(), we use this
200 // guard to control stopping and starting the audio thread. 200 // guard to control stopping and starting the audio thread.
201 base::Lock audio_thread_lock_; 201 base::Lock audio_thread_lock_;
202 AudioDeviceThread audio_thread_;
203 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_; 202 std::unique_ptr<AudioOutputDevice::AudioThreadCallback> audio_callback_;
203 std::unique_ptr<AudioDeviceThread> audio_thread_;
204 204
205 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop() 205 // Temporary hack to ignore OnStreamCreated() due to the user calling Stop()
206 // so we don't start the audio thread pointing to a potentially freed 206 // so we don't start the audio thread pointing to a potentially freed
207 // |callback_|. 207 // |callback_|.
208 // 208 //
209 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept 209 // TODO(scherkus): Replace this by changing AudioRendererSink to either accept
210 // the callback via Start(). See http://crbug.com/151051 for details. 210 // the callback via Start(). See http://crbug.com/151051 for details.
211 bool stopping_hack_; 211 bool stopping_hack_;
212 212
213 base::WaitableEvent did_receive_auth_; 213 base::WaitableEvent did_receive_auth_;
214 AudioParameters output_params_; 214 AudioParameters output_params_;
215 OutputDeviceStatus device_status_; 215 OutputDeviceStatus device_status_;
216 216
217 const base::TimeDelta auth_timeout_; 217 const base::TimeDelta auth_timeout_;
218 std::unique_ptr<base::OneShotTimer> auth_timeout_action_; 218 std::unique_ptr<base::OneShotTimer> auth_timeout_action_;
219 219
220 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice); 220 DISALLOW_COPY_AND_ASSIGN(AudioOutputDevice);
221 }; 221 };
222 222
223 } // namespace media 223 } // namespace media
224 224
225 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_ 225 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_DEVICE_H_
OLDNEW
« no previous file with comments | « media/audio/audio_input_device.cc ('k') | media/audio/audio_output_device.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698