| 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_MANAGER_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // When you are done with it, call |Stop()| and |Close()| to release it. | 105 // When you are done with it, call |Stop()| and |Close()| to release it. |
| 106 virtual AudioInputStream* MakeAudioInputStream( | 106 virtual AudioInputStream* MakeAudioInputStream( |
| 107 const AudioParameters& params, const std::string& device_id) = 0; | 107 const AudioParameters& params, const std::string& device_id) = 0; |
| 108 | 108 |
| 109 // Used to determine if something else is currently making use of audio input. | 109 // Used to determine if something else is currently making use of audio input. |
| 110 virtual bool IsRecordingInProcess() = 0; | 110 virtual bool IsRecordingInProcess() = 0; |
| 111 | 111 |
| 112 // Returns message loop used for audio IO. | 112 // Returns message loop used for audio IO. |
| 113 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; | 113 virtual scoped_refptr<base::MessageLoopProxy> GetMessageLoop() = 0; |
| 114 | 114 |
| 115 // Heavyweight tasks should use GetWorkerLoop() instead of GetMessageLoop(). |
| 116 // On most platforms they are the same, but some share the UI loop with the |
| 117 // audio IO loop. |
| 118 virtual scoped_refptr<base::MessageLoopProxy> GetWorkerLoop() = 0; |
| 119 |
| 115 // Allows clients to listen for device state changes; e.g. preferred sample | 120 // Allows clients to listen for device state changes; e.g. preferred sample |
| 116 // rate or channel layout changes. The typical response to receiving this | 121 // rate or channel layout changes. The typical response to receiving this |
| 117 // callback is to recreate the stream. | 122 // callback is to recreate the stream. |
| 118 class AudioDeviceListener { | 123 class AudioDeviceListener { |
| 119 public: | 124 public: |
| 120 virtual void OnDeviceChange() = 0; | 125 virtual void OnDeviceChange() = 0; |
| 121 }; | 126 }; |
| 122 | 127 |
| 123 virtual void AddOutputDeviceChangeListener(AudioDeviceListener* listener) = 0; | 128 virtual void AddOutputDeviceChangeListener(AudioDeviceListener* listener) = 0; |
| 124 virtual void RemoveOutputDeviceChangeListener( | 129 virtual void RemoveOutputDeviceChangeListener( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 139 protected: | 144 protected: |
| 140 AudioManager(); | 145 AudioManager(); |
| 141 | 146 |
| 142 private: | 147 private: |
| 143 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 148 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
| 144 }; | 149 }; |
| 145 | 150 |
| 146 } // namespace media | 151 } // namespace media |
| 147 | 152 |
| 148 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 153 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |