OLD | NEW |
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/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Internal state of the source. | 56 // Internal state of the source. |
57 enum State { | 57 enum State { |
58 kEmpty, | 58 kEmpty, |
59 kCreated, | 59 kCreated, |
60 kPlaying, | 60 kPlaying, |
61 kPaused, | 61 kPaused, |
62 kClosed, | 62 kClosed, |
63 kError, | 63 kError, |
64 }; | 64 }; |
65 | 65 |
| 66 // Value sent by the controller to the renderer in low-latency mode |
| 67 // indicating that the stream is paused. |
| 68 static const int kPauseMark; |
| 69 |
66 // An event handler that receives events from the AudioOutputController. The | 70 // An event handler that receives events from the AudioOutputController. The |
67 // following methods are called on the audio controller thread. | 71 // following methods are called on the audio controller thread. |
68 class EventHandler { | 72 class EventHandler { |
69 public: | 73 public: |
70 virtual ~EventHandler() {} | 74 virtual ~EventHandler() {} |
71 virtual void OnCreated(AudioOutputController* controller) = 0; | 75 virtual void OnCreated(AudioOutputController* controller) = 0; |
72 virtual void OnPlaying(AudioOutputController* controller) = 0; | 76 virtual void OnPlaying(AudioOutputController* controller) = 0; |
73 virtual void OnPaused(AudioOutputController* controller) = 0; | 77 virtual void OnPaused(AudioOutputController* controller) = 0; |
74 virtual void OnError(AudioOutputController* controller, int error_code) = 0; | 78 virtual void OnError(AudioOutputController* controller, int error_code) = 0; |
75 | 79 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 202 |
199 // The message loop of audio thread that this object runs on. | 203 // The message loop of audio thread that this object runs on. |
200 MessageLoop* message_loop_; | 204 MessageLoop* message_loop_; |
201 | 205 |
202 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 206 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
203 }; | 207 }; |
204 | 208 |
205 } // namespace media | 209 } // namespace media |
206 | 210 |
207 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 211 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |