| 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_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ | 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 | 180 |
| 181 // Disable output debug recording. | 181 // Disable output debug recording. |
| 182 virtual void DisableOutputDebugRecording() = 0; | 182 virtual void DisableOutputDebugRecording() = 0; |
| 183 | 183 |
| 184 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). | 184 // Gets the name of the audio manager (e.g., Windows, Mac, PulseAudio). |
| 185 virtual const char* GetName() = 0; | 185 virtual const char* GetName() = 0; |
| 186 | 186 |
| 187 // Limits the number of streams that can be created for testing purposes. | 187 // Limits the number of streams that can be created for testing purposes. |
| 188 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); | 188 virtual void SetMaxStreamCountForTesting(int max_input, int max_output); |
| 189 | 189 |
| 190 // Get the minimum and maximum audio buffer sizes. The definitions exist in |
| 191 // the specific AudioManager implementations. |
| 192 static int GetMinimumAudioBufferSize(int sample_rate); |
| 193 static int GetMaximumAudioBufferSize(int sample_rate); |
| 194 |
| 190 protected: | 195 protected: |
| 191 FRIEND_TEST_ALL_PREFIXES(AudioManagerTest, AudioDebugRecording); | 196 FRIEND_TEST_ALL_PREFIXES(AudioManagerTest, AudioDebugRecording); |
| 192 friend class AudioDeviceInfoAccessorForTests; | 197 friend class AudioDeviceInfoAccessorForTests; |
| 193 | 198 |
| 194 explicit AudioManager(std::unique_ptr<AudioThread> audio_thread); | 199 explicit AudioManager(std::unique_ptr<AudioThread> audio_thread); |
| 195 | 200 |
| 196 virtual void ShutdownOnAudioThread() = 0; | 201 virtual void ShutdownOnAudioThread() = 0; |
| 197 | 202 |
| 198 // Initializes output debug recording. Can be called on any thread; will post | 203 // Initializes output debug recording. Can be called on any thread; will post |
| 199 // to the audio thread if not called on it. | 204 // to the audio thread if not called on it. |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 std::unique_ptr<AudioThread> audio_thread_; | 274 std::unique_ptr<AudioThread> audio_thread_; |
| 270 bool shutdown_ = false; // True after |this| has been shutdown. | 275 bool shutdown_ = false; // True after |this| has been shutdown. |
| 271 | 276 |
| 272 THREAD_CHECKER(thread_checker_); | 277 THREAD_CHECKER(thread_checker_); |
| 273 DISALLOW_COPY_AND_ASSIGN(AudioManager); | 278 DISALLOW_COPY_AND_ASSIGN(AudioManager); |
| 274 }; | 279 }; |
| 275 | 280 |
| 276 } // namespace media | 281 } // namespace media |
| 277 | 282 |
| 278 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ | 283 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ |
| OLD | NEW |