| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 void NotifyAllOutputDeviceChangeListeners(); | 139 void NotifyAllOutputDeviceChangeListeners(); |
| 140 | 140 |
| 141 // Map of cached AudioOutputDispatcher instances. Must only be touched | 141 // Map of cached AudioOutputDispatcher instances. Must only be touched |
| 142 // from the audio thread (no locking). | 142 // from the audio thread (no locking). |
| 143 AudioOutputDispatchersMap output_dispatchers_; | 143 AudioOutputDispatchersMap output_dispatchers_; |
| 144 | 144 |
| 145 private: | 145 private: |
| 146 // Called by Shutdown(). | 146 // Called by Shutdown(). |
| 147 void ShutdownOnAudioThread(); | 147 void ShutdownOnAudioThread(); |
| 148 | 148 |
| 149 #if defined(OS_ANDROID) | |
| 150 void SetAudioMode(int mode); | 149 void SetAudioMode(int mode); |
| 151 void RegisterHeadsetReceiver(); | |
| 152 void UnregisterHeadsetReceiver(); | |
| 153 #endif | |
| 154 | 150 |
| 155 // Counts the number of active input streams to find out if something else | 151 // Counts the number of active input streams to find out if something else |
| 156 // is currently recording in Chrome. | 152 // is currently recording in Chrome. |
| 157 base::AtomicRefCount num_active_input_streams_; | 153 base::AtomicRefCount num_active_input_streams_; |
| 158 | 154 |
| 159 // Max number of open output streams, modified by | 155 // Max number of open output streams, modified by |
| 160 // SetMaxOutputStreamsAllowed(). | 156 // SetMaxOutputStreamsAllowed(). |
| 161 int max_num_output_streams_; | 157 int max_num_output_streams_; |
| 162 | 158 |
| 163 // Max number of open input streams. | 159 // Max number of open input streams. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 179 // The message loop of the audio thread this object runs on. Used for internal | 175 // The message loop of the audio thread this object runs on. Used for internal |
| 180 // tasks which run on the audio thread even after Shutdown() has been started | 176 // tasks which run on the audio thread even after Shutdown() has been started |
| 181 // and GetMessageLoop() starts returning NULL. | 177 // and GetMessageLoop() starts returning NULL. |
| 182 scoped_refptr<base::MessageLoopProxy> message_loop_; | 178 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 183 | 179 |
| 184 // Currently active VirtualAudioInputStream. When this is set, we will | 180 // Currently active VirtualAudioInputStream. When this is set, we will |
| 185 // create all audio output streams as virtual streams so as to redirect audio | 181 // create all audio output streams as virtual streams so as to redirect audio |
| 186 // data to this virtual input stream. | 182 // data to this virtual input stream. |
| 187 VirtualAudioInputStream* virtual_audio_input_stream_; | 183 VirtualAudioInputStream* virtual_audio_input_stream_; |
| 188 | 184 |
| 189 #if defined(OS_ANDROID) | |
| 190 // Java AudioManager instance. | |
| 191 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; | |
| 192 #endif | |
| 193 | |
| 194 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 185 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
| 195 }; | 186 }; |
| 196 | 187 |
| 197 } // namespace media | 188 } // namespace media |
| 198 | 189 |
| 199 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 190 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| OLD | NEW |