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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
129 // will decide if they should return the values from |input_params| or the | 129 // will decide if they should return the values from |input_params| or the |
130 // default hardware values. If the |input_params| is invalid, it will return | 130 // default hardware values. If the |input_params| is invalid, it will return |
131 // the default hardware audio parameters. | 131 // the default hardware audio parameters. |
132 virtual AudioParameters GetPreferredOutputStreamParameters( | 132 virtual AudioParameters GetPreferredOutputStreamParameters( |
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 #if defined(OS_ANDROID) | |
140 // Java AudioManagerAndroid instance. | |
141 base::android::ScopedJavaGlobalRef<jobject> j_am_; | |
tommi (sloooow) - chröme
2013/03/21 15:31:27
full_descriptive_variable_names_please_ :)
Yaron
2013/03/21 16:51:31
Make this private. Also this object (AudioManagerB
leozwang1
2013/03/21 18:51:35
Done.
leozwang1
2013/03/21 18:51:35
scoped_ptr<media::AudioManager> audio_manager_ is
| |
142 #endif | |
143 | |
139 private: | 144 private: |
140 // Called by Shutdown(). | 145 // Called by Shutdown(). |
141 void ShutdownOnAudioThread(); | 146 void ShutdownOnAudioThread(); |
142 | 147 |
148 #if defined(OS_ANDROID) | |
143 void SetAudioMode(int mode); | 149 void SetAudioMode(int mode); |
150 void RegisterHeadsetReceiver(); | |
151 void UnRegisterHeadsetReceiver(); | |
tommi (sloooow) - chröme
2013/03/21 15:31:27
Unregister is one word I believe
leozwang1
2013/03/21 18:51:35
Done.
| |
152 #endif | |
144 | 153 |
145 // Counts the number of active input streams to find out if something else | 154 // Counts the number of active input streams to find out if something else |
146 // is currently recording in Chrome. | 155 // is currently recording in Chrome. |
147 base::AtomicRefCount num_active_input_streams_; | 156 base::AtomicRefCount num_active_input_streams_; |
148 | 157 |
149 // Max number of open output streams, modified by | 158 // Max number of open output streams, modified by |
150 // SetMaxOutputStreamsAllowed(). | 159 // SetMaxOutputStreamsAllowed(). |
151 int max_num_output_streams_; | 160 int max_num_output_streams_; |
152 | 161 |
153 // Max number of open input streams. | 162 // Max number of open input streams. |
(...skipping 16 matching lines...) Expand all Loading... | |
170 // tasks which run on the audio thread even after Shutdown() has been started | 179 // tasks which run on the audio thread even after Shutdown() has been started |
171 // and GetMessageLoop() starts returning NULL. | 180 // and GetMessageLoop() starts returning NULL. |
172 scoped_refptr<base::MessageLoopProxy> message_loop_; | 181 scoped_refptr<base::MessageLoopProxy> message_loop_; |
173 | 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 |