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_BASE_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy | 77 // Creates the input stream for the |AUDIO_PCM_LINEAR| format. The legacy |
78 // name is also from |AUDIO_PCM_LINEAR|. | 78 // name is also from |AUDIO_PCM_LINEAR|. |
79 virtual AudioInputStream* MakeLinearInputStream( | 79 virtual AudioInputStream* MakeLinearInputStream( |
80 const AudioParameters& params, const std::string& device_id) = 0; | 80 const AudioParameters& params, const std::string& device_id) = 0; |
81 | 81 |
82 // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. | 82 // Creates the input stream for the |AUDIO_PCM_LOW_LATENCY| format. |
83 virtual AudioInputStream* MakeLowLatencyInputStream( | 83 virtual AudioInputStream* MakeLowLatencyInputStream( |
84 const AudioParameters& params, const std::string& device_id) = 0; | 84 const AudioParameters& params, const std::string& device_id) = 0; |
85 | 85 |
86 // Returns the preferred hardware audio output parameters for opening output | |
87 // streams in the |AUDIO_PCM_LOW_LATENCY| format. | |
88 // TODO(dalecurtis): Retrieve the |channel_layout| value from hardware instead | |
89 // of accepting the value. | |
90 // TODO(dalecurtis): Each AudioManager should implement their own version, see | |
91 // http://crbug.com/137326 | |
92 virtual AudioParameters GetPreferredLowLatencyOutputStreamParameters( | |
93 const AudioParameters& input_params); | |
94 | |
95 // Listeners will be notified on the AudioManager::GetMessageLoop() loop. | 86 // Listeners will be notified on the AudioManager::GetMessageLoop() loop. |
96 virtual void AddOutputDeviceChangeListener( | 87 virtual void AddOutputDeviceChangeListener( |
97 AudioDeviceListener* listener) OVERRIDE; | 88 AudioDeviceListener* listener) OVERRIDE; |
98 virtual void RemoveOutputDeviceChangeListener( | 89 virtual void RemoveOutputDeviceChangeListener( |
99 AudioDeviceListener* listener) OVERRIDE; | 90 AudioDeviceListener* listener) OVERRIDE; |
100 | 91 |
101 protected: | 92 protected: |
102 AudioManagerBase(); | 93 AudioManagerBase(); |
103 | 94 |
104 // TODO(dalecurtis): This must change to map both input and output parameters | 95 // TODO(dalecurtis): This must change to map both input and output parameters |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // tasks which run on the audio thread even after Shutdown() has been started | 148 // tasks which run on the audio thread even after Shutdown() has been started |
158 // and GetMessageLoop() starts returning NULL. | 149 // and GetMessageLoop() starts returning NULL. |
159 scoped_refptr<base::MessageLoopProxy> message_loop_; | 150 scoped_refptr<base::MessageLoopProxy> message_loop_; |
160 | 151 |
161 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 152 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
162 }; | 153 }; |
163 | 154 |
164 } // namespace media | 155 } // namespace media |
165 | 156 |
166 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 157 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |