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

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

Issue 8385001: Stop audio streams in all codepaths that need it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: enal CR response. Created 9 years, 2 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 | « no previous file | media/audio/audio_output_controller.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) 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 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 void DoClose(const base::Closure& closed_task); 186 void DoClose(const base::Closure& closed_task);
187 void DoSetVolume(double volume); 187 void DoSetVolume(double volume);
188 void DoReportError(int code); 188 void DoReportError(int code);
189 189
190 // Helper method to submit a OnMoreData() call to the event handler. 190 // Helper method to submit a OnMoreData() call to the event handler.
191 void SubmitOnMoreData_Locked(); 191 void SubmitOnMoreData_Locked();
192 192
193 // Helper method that starts physical stream. 193 // Helper method that starts physical stream.
194 void StartStream(); 194 void StartStream();
195 195
196 // Helper method that stops, closes, and NULLs |*stream_|.
197 void StopCloseAndClearStream();
198
196 // |handler_| may be called only if |state_| is not kClosed. 199 // |handler_| may be called only if |state_| is not kClosed.
197 EventHandler* handler_; 200 EventHandler* handler_;
198 AudioOutputStream* stream_; 201 AudioOutputStream* stream_;
199 202
200 // The current volume of the audio stream. 203 // The current volume of the audio stream.
201 double volume_; 204 double volume_;
202 205
203 // |state_| is written on the audio controller thread and is read on the 206 // |state_| is written on the audio controller thread and is read on the
204 // hardware audio thread. These operations need to be locked. But lock 207 // hardware audio thread. These operations need to be locked. But lock
205 // is not required for reading on the audio controller thread. 208 // is not required for reading on the audio controller thread.
(...skipping 17 matching lines...) Expand all
223 // When starting stream we wait for data to become available. 226 // When starting stream we wait for data to become available.
224 // Number of times left. 227 // Number of times left.
225 int number_polling_attempts_left_; 228 int number_polling_attempts_left_;
226 229
227 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); 230 DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
228 }; 231 };
229 232
230 } // namespace media 233 } // namespace media
231 234
232 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 235 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698