| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 const AudioParameters& input_params) = 0; | 133 const AudioParameters& input_params) = 0; |
| 134 | 134 |
| 135 // Map of cached AudioOutputDispatcher instances. Must only be touched | 135 // Map of cached AudioOutputDispatcher instances. Must only be touched |
| 136 // from the audio thread (no locking). | 136 // from the audio thread (no locking). |
| 137 AudioOutputDispatchersMap output_dispatchers_; | 137 AudioOutputDispatchersMap output_dispatchers_; |
| 138 | 138 |
| 139 private: | 139 private: |
| 140 // Called by Shutdown(). | 140 // Called by Shutdown(). |
| 141 void ShutdownOnAudioThread(); | 141 void ShutdownOnAudioThread(); |
| 142 | 142 |
| 143 #if defined(OS_ANDROID) |
| 143 void SetAudioMode(int mode); | 144 void SetAudioMode(int mode); |
| 145 void RegisterHeadsetReceiver(); |
| 146 void UnregisterHeadsetReceiver(); |
| 147 #endif |
| 144 | 148 |
| 145 // Counts the number of active input streams to find out if something else | 149 // Counts the number of active input streams to find out if something else |
| 146 // is currently recording in Chrome. | 150 // is currently recording in Chrome. |
| 147 base::AtomicRefCount num_active_input_streams_; | 151 base::AtomicRefCount num_active_input_streams_; |
| 148 | 152 |
| 149 // Max number of open output streams, modified by | 153 // Max number of open output streams, modified by |
| 150 // SetMaxOutputStreamsAllowed(). | 154 // SetMaxOutputStreamsAllowed(). |
| 151 int max_num_output_streams_; | 155 int max_num_output_streams_; |
| 152 | 156 |
| 153 // Max number of open input streams. | 157 // Max number of open input streams. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 164 | 168 |
| 165 // Thread used to interact with audio streams created by this audio manager. | 169 // Thread used to interact with audio streams created by this audio manager. |
| 166 scoped_ptr<base::Thread> audio_thread_; | 170 scoped_ptr<base::Thread> audio_thread_; |
| 167 mutable base::Lock audio_thread_lock_; | 171 mutable base::Lock audio_thread_lock_; |
| 168 | 172 |
| 169 // The message loop of the audio thread this object runs on. Used for internal | 173 // The message loop of the audio thread this object runs on. Used for internal |
| 170 // tasks which run on the audio thread even after Shutdown() has been started | 174 // tasks which run on the audio thread even after Shutdown() has been started |
| 171 // and GetMessageLoop() starts returning NULL. | 175 // and GetMessageLoop() starts returning NULL. |
| 172 scoped_refptr<base::MessageLoopProxy> message_loop_; | 176 scoped_refptr<base::MessageLoopProxy> message_loop_; |
| 173 | 177 |
| 178 #if defined(OS_ANDROID) |
| 179 // Java AudioManager instance. |
| 180 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; |
| 181 #endif |
| 182 |
| 174 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 183 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
| 175 }; | 184 }; |
| 176 | 185 |
| 177 } // namespace media | 186 } // namespace media |
| 178 | 187 |
| 179 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 188 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| OLD | NEW |