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/atomic_ref_count.h" | 8 #include "base/atomic_ref_count.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 NON_EXPORTED_BASE(public AudioManager::AudioDeviceListener) { | 64 NON_EXPORTED_BASE(public AudioManager::AudioDeviceListener) { |
65 public: | 65 public: |
66 // An event handler that receives events from the AudioOutputController. The | 66 // An event handler that receives events from the AudioOutputController. The |
67 // following methods are called on the audio manager thread. | 67 // following methods are called on the audio manager thread. |
68 class MEDIA_EXPORT EventHandler { | 68 class MEDIA_EXPORT EventHandler { |
69 public: | 69 public: |
70 virtual void OnCreated(AudioOutputController* controller) = 0; | 70 virtual void OnCreated(AudioOutputController* controller) = 0; |
71 virtual void OnPlaying(AudioOutputController* controller) = 0; | 71 virtual void OnPlaying(AudioOutputController* controller) = 0; |
72 virtual void OnPaused(AudioOutputController* controller) = 0; | 72 virtual void OnPaused(AudioOutputController* controller) = 0; |
73 virtual void OnError(AudioOutputController* controller, int error_code) = 0; | 73 virtual void OnError(AudioOutputController* controller, int error_code) = 0; |
| 74 virtual void OnDeviceChange(AudioOutputController* controller, |
| 75 int new_buffer_size, int new_sample_rate) = 0; |
74 | 76 |
75 protected: | 77 protected: |
76 virtual ~EventHandler() {} | 78 virtual ~EventHandler() {} |
77 }; | 79 }; |
78 | 80 |
79 // A synchronous reader interface used by AudioOutputController for | 81 // A synchronous reader interface used by AudioOutputController for |
80 // synchronous reading. | 82 // synchronous reading. |
81 // TODO(crogers): find a better name for this class and the Read() method | 83 // TODO(crogers): find a better name for this class and the Read() method |
82 // now that it can handle synchronized I/O. | 84 // now that it can handle synchronized I/O. |
83 class SyncReader { | 85 class SyncReader { |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // Used to auto-cancel the delayed tasks that are created to poll for data | 242 // Used to auto-cancel the delayed tasks that are created to poll for data |
241 // (when starting-up a stream). | 243 // (when starting-up a stream). |
242 base::WeakPtrFactory<AudioOutputController> weak_this_; | 244 base::WeakPtrFactory<AudioOutputController> weak_this_; |
243 | 245 |
244 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); | 246 DISALLOW_COPY_AND_ASSIGN(AudioOutputController); |
245 }; | 247 }; |
246 | 248 |
247 } // namespace media | 249 } // namespace media |
248 | 250 |
249 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ | 251 #endif // MEDIA_AUDIO_AUDIO_OUTPUT_CONTROLLER_H_ |
OLD | NEW |