Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 147 const AudioParameters& input_params) = 0; | 147 const AudioParameters& input_params) = 0; |
| 148 | 148 |
| 149 // Returns the ID of the default audio output device. | 149 // Returns the ID of the default audio output device. |
| 150 // Implementations that don't yet support this should return an empty string. | 150 // Implementations that don't yet support this should return an empty string. |
| 151 virtual std::string GetDefaultOutputDeviceID(); | 151 virtual std::string GetDefaultOutputDeviceID(); |
| 152 | 152 |
| 153 // Get number of input or output streams. | 153 // Get number of input or output streams. |
| 154 int input_stream_count() { return num_input_streams_; } | 154 int input_stream_count() { return num_input_streams_; } |
| 155 int output_stream_count() { return num_output_streams_; } | 155 int output_stream_count() { return num_output_streams_; } |
| 156 | 156 |
| 157 protected: | |
| 158 // The message loop of the audio thread this object runs on. Used for internal | |
| 159 // tasks which run on the audio thread even after Shutdown() has been started | |
| 160 // and GetMessageLoop() starts returning NULL. | |
| 161 scoped_refptr<base::MessageLoopProxy> message_loop_; | |
|
tommi (sloooow) - chröme
2013/12/02 18:36:00
I don't think we need this change so it would be g
wjia(left Chromium)
2013/12/02 21:49:49
Done.
| |
| 162 | |
| 157 private: | 163 private: |
| 158 struct DispatcherParams; | 164 struct DispatcherParams; |
| 159 typedef ScopedVector<DispatcherParams> AudioOutputDispatchers; | 165 typedef ScopedVector<DispatcherParams> AudioOutputDispatchers; |
| 160 | 166 |
| 161 class CompareByParams; | 167 class CompareByParams; |
| 162 | 168 |
| 163 // Called by Shutdown(). | 169 // Called by Shutdown(). |
| 164 void ShutdownOnAudioThread(); | 170 void ShutdownOnAudioThread(); |
| 165 | 171 |
| 166 // Max number of open output streams, modified by | 172 // Max number of open output streams, modified by |
| 167 // SetMaxOutputStreamsAllowed(). | 173 // SetMaxOutputStreamsAllowed(). |
| 168 int max_num_output_streams_; | 174 int max_num_output_streams_; |
| 169 | 175 |
| 170 // Max number of open input streams. | 176 // Max number of open input streams. |
| 171 int max_num_input_streams_; | 177 int max_num_input_streams_; |
| 172 | 178 |
| 173 // Number of currently open output streams. | 179 // Number of currently open output streams. |
| 174 int num_output_streams_; | 180 int num_output_streams_; |
| 175 | 181 |
| 176 // Number of currently open input streams. | 182 // Number of currently open input streams. |
| 177 int num_input_streams_; | 183 int num_input_streams_; |
| 178 | 184 |
| 179 // Track output state change listeners. | 185 // Track output state change listeners. |
| 180 ObserverList<AudioDeviceListener> output_listeners_; | 186 ObserverList<AudioDeviceListener> output_listeners_; |
| 181 | 187 |
| 182 // Thread used to interact with audio streams created by this audio manager. | 188 // Thread used to interact with audio streams created by this audio manager. |
| 183 base::Thread audio_thread_; | 189 base::Thread audio_thread_; |
| 184 | 190 |
| 185 // The message loop of the audio thread this object runs on. Used for internal | |
| 186 // tasks which run on the audio thread even after Shutdown() has been started | |
| 187 // and GetMessageLoop() starts returning NULL. | |
| 188 scoped_refptr<base::MessageLoopProxy> message_loop_; | |
| 189 | |
| 190 // Map of cached AudioOutputDispatcher instances. Must only be touched | 191 // Map of cached AudioOutputDispatcher instances. Must only be touched |
| 191 // from the audio thread (no locking). | 192 // from the audio thread (no locking). |
| 192 AudioOutputDispatchers output_dispatchers_; | 193 AudioOutputDispatchers output_dispatchers_; |
| 193 | 194 |
| 194 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 195 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
| 195 }; | 196 }; |
| 196 | 197 |
| 197 } // namespace media | 198 } // namespace media |
| 198 | 199 |
| 199 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 200 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| OLD | NEW |