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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 71 // Value sent by the controller to the renderer in low-latency mode |
72 // indicating that the stream is paused. | 72 // indicating that the stream is paused. |
73 static const int kPauseMark; | 73 static const int kPauseMark; |
74 | 74 |
75 // An event handler that receives events from the AudioOutputController. The | 75 // An event handler that receives events from the AudioOutputController. The |
76 // following methods are called on the audio manager thread. | 76 // following methods are called on the audio manager thread. |
77 class MEDIA_EXPORT EventHandler { | 77 class MEDIA_EXPORT EventHandler { |
78 public: | 78 public: |
79 virtual ~EventHandler() {} | |
80 virtual void OnCreated(AudioOutputController* controller) = 0; | 79 virtual void OnCreated(AudioOutputController* controller) = 0; |
81 virtual void OnPlaying(AudioOutputController* controller) = 0; | 80 virtual void OnPlaying(AudioOutputController* controller) = 0; |
82 virtual void OnPaused(AudioOutputController* controller) = 0; | 81 virtual void OnPaused(AudioOutputController* controller) = 0; |
83 virtual void OnError(AudioOutputController* controller, int error_code) = 0; | 82 virtual void OnError(AudioOutputController* controller, int error_code) = 0; |
| 83 |
| 84 protected: |
| 85 virtual ~EventHandler() {} |
84 }; | 86 }; |
85 | 87 |
86 // A synchronous reader interface used by AudioOutputController for | 88 // A synchronous reader interface used by AudioOutputController for |
87 // synchronous reading. | 89 // synchronous reading. |
88 class SyncReader { | 90 class SyncReader { |
89 public: | 91 public: |
90 virtual ~SyncReader() {} | 92 virtual ~SyncReader() {} |
91 | 93 |
92 // Notify the synchronous reader the number of bytes in the | 94 // Notify the synchronous reader the number of bytes in the |
93 // AudioOutputController not yet played. This is used by SyncReader to | 95 // AudioOutputController not yet played. This is used by SyncReader to |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 // shutdown and force it to wait for the most delayed task. | 226 // shutdown and force it to wait for the most delayed task. |
225 // 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. |
226 base::WeakPtrFactory<AudioOutputController> weak_this_; | 228 base::WeakPtrFactory<AudioOutputController> weak_this_; |
227 | 229 |
228 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 230 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
229 }; | 231 }; |
230 | 232 |
231 } // namespace media | 233 } // namespace media |
232 | 234 |
233 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 235 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |