OLD | NEW |
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/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 50 matching lines...) Loading... |
61 // thread. | 61 // thread. |
62 // | 62 // |
63 #include "media/base/media_export.h" | 63 #include "media/base/media_export.h" |
64 | 64 |
65 namespace media { | 65 namespace media { |
66 | 66 |
67 class MEDIA_EXPORT AudioOutputController | 67 class MEDIA_EXPORT AudioOutputController |
68 : public base::RefCountedThreadSafe<AudioOutputController>, | 68 : public base::RefCountedThreadSafe<AudioOutputController>, |
69 public AudioOutputStream::AudioSourceCallback { | 69 public AudioOutputStream::AudioSourceCallback { |
70 public: | 70 public: |
71 // Value sent by the controller to the renderer in low-latency mode | |
72 // indicating that the stream is paused. | |
73 static const int kPauseMark; | |
74 | |
75 // An event handler that receives events from the AudioOutputController. The | 71 // An event handler that receives events from the AudioOutputController. The |
76 // following methods are called on the audio manager thread. | 72 // following methods are called on the audio manager thread. |
77 class MEDIA_EXPORT EventHandler { | 73 class MEDIA_EXPORT EventHandler { |
78 public: | 74 public: |
79 virtual void OnCreated(AudioOutputController* controller) = 0; | 75 virtual void OnCreated(AudioOutputController* controller) = 0; |
80 virtual void OnPlaying(AudioOutputController* controller) = 0; | 76 virtual void OnPlaying(AudioOutputController* controller) = 0; |
81 virtual void OnPaused(AudioOutputController* controller) = 0; | 77 virtual void OnPaused(AudioOutputController* controller) = 0; |
82 virtual void OnError(AudioOutputController* controller, int error_code) = 0; | 78 virtual void OnError(AudioOutputController* controller, int error_code) = 0; |
83 | 79 |
84 protected: | 80 protected: |
(...skipping 141 matching lines...) Loading... |
226 // shutdown and force it to wait for the most delayed task. | 222 // shutdown and force it to wait for the most delayed task. |
227 // Also, if we're shutting down, we do not want to poll for more data. | 223 // Also, if we're shutting down, we do not want to poll for more data. |
228 base::WeakPtrFactory<AudioOutputController> weak_this_; | 224 base::WeakPtrFactory<AudioOutputController> weak_this_; |
229 | 225 |
230 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 226 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
231 }; | 227 }; |
232 | 228 |
233 } // namespace media | 229 } // namespace media |
234 | 230 |
235 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 231 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |