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

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

Issue 10054011: Send kStopMark from AudioOutputController to stop AudioThread in renderer (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 8 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/media/audio_device.cc ('k') | 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) 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 #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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 namespace media { 73 namespace media {
74 74
75 class MEDIA_EXPORT AudioOutputController 75 class MEDIA_EXPORT AudioOutputController
76 : public base::RefCountedThreadSafe<AudioOutputController>, 76 : public base::RefCountedThreadSafe<AudioOutputController>,
77 public AudioOutputStream::AudioSourceCallback { 77 public AudioOutputStream::AudioSourceCallback {
78 public: 78 public:
79 // Value sent by the controller to the renderer in low-latency mode 79 // Value sent by the controller to the renderer in low-latency mode
80 // indicating that the stream is paused. 80 // indicating that the stream is paused.
81 static const int kPauseMark; 81 static const int kPauseMark;
82 82
83 // M18-specific hack for crbug.com/121141: value sent to the renderer in
84 // low-latency mode telling the renderer to close the socket.
85 static const int kStopMark;
86
83 // An event handler that receives events from the AudioOutputController. The 87 // An event handler that receives events from the AudioOutputController. The
84 // following methods are called on the audio controller thread. 88 // following methods are called on the audio controller thread.
85 class MEDIA_EXPORT EventHandler { 89 class MEDIA_EXPORT EventHandler {
86 public: 90 public:
87 virtual ~EventHandler() {} 91 virtual ~EventHandler() {}
88 virtual void OnCreated(AudioOutputController* controller) = 0; 92 virtual void OnCreated(AudioOutputController* controller) = 0;
89 virtual void OnPlaying(AudioOutputController* controller) = 0; 93 virtual void OnPlaying(AudioOutputController* controller) = 0;
90 virtual void OnPaused(AudioOutputController* controller) = 0; 94 virtual void OnPaused(AudioOutputController* controller) = 0;
91 virtual void OnError(AudioOutputController* controller, int error_code) = 0; 95 virtual void OnError(AudioOutputController* controller, int error_code) = 0;
92 96
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 // shutdown and force it to wait for the most delayed task. 269 // shutdown and force it to wait for the most delayed task.
266 // Also, if we're shutting down, we do not want to poll for more data. 270 // Also, if we're shutting down, we do not want to poll for more data.
267 base::WeakPtrFactory<AudioOutputController> weak_this_; 271 base::WeakPtrFactory<AudioOutputController> weak_this_;
268 272
269 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); 273 DISALLOW_COPY_AND_ASSIGN(AudioOutputController);
270 }; 274 };
271 275
272 } // namespace media 276 } // namespace media
273 277
274 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ 278 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/audio_device.cc ('k') | media/audio/audio_output_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698