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...) Expand 10 before | Expand all | Expand 10 after 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 |
71 // An event handler that receives events from the AudioOutputController. The | 75 // An event handler that receives events from the AudioOutputController. The |
72 // following methods are called on the audio manager thread. | 76 // following methods are called on the audio manager thread. |
73 class MEDIA_EXPORT EventHandler { | 77 class MEDIA_EXPORT EventHandler { |
74 public: | 78 public: |
75 virtual void OnCreated(AudioOutputController* controller) = 0; | 79 virtual void OnCreated(AudioOutputController* controller) = 0; |
76 virtual void OnPlaying(AudioOutputController* controller) = 0; | 80 virtual void OnPlaying(AudioOutputController* controller) = 0; |
77 virtual void OnPaused(AudioOutputController* controller) = 0; | 81 virtual void OnPaused(AudioOutputController* controller) = 0; |
78 virtual void OnError(AudioOutputController* controller, int error_code) = 0; | 82 virtual void OnError(AudioOutputController* controller, int error_code) = 0; |
79 | 83 |
80 protected: | 84 protected: |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // shutdown and force it to wait for the most delayed task. | 226 // shutdown and force it to wait for the most delayed task. |
223 // Also, if we're shutting down, we do not want to poll for more data. | 227 // Also, if we're shutting down, we do not want to poll for more data. |
224 base::WeakPtrFactory<AudioOutputController> weak_this_; | 228 base::WeakPtrFactory<AudioOutputController> weak_this_; |
225 | 229 |
226 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 230 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
227 }; | 231 }; |
228 | 232 |
229 } // namespace media | 233 } // namespace media |
230 | 234 |
231 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 235 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |