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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 17 matching lines...) Expand all Loading... |
28 namespace media { | 28 namespace media { |
29 | 29 |
30 class AudioOutputDispatcher; | 30 class AudioOutputDispatcher; |
31 | 31 |
32 // AudioManagerBase provides AudioManager functions common for all platforms. | 32 // AudioManagerBase provides AudioManager functions common for all platforms. |
33 class MEDIA_EXPORT AudioManagerBase : public AudioManager { | 33 class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
34 public: | 34 public: |
35 ~AudioManagerBase() override; | 35 ~AudioManagerBase() override; |
36 | 36 |
37 // AudioManager: | 37 // AudioManager: |
| 38 void Shutdown() override; |
38 base::string16 GetAudioInputDeviceModel() override; | 39 base::string16 GetAudioInputDeviceModel() override; |
39 void ShowAudioInputSettings() override; | 40 void ShowAudioInputSettings() override; |
40 | 41 |
41 void GetAudioInputDeviceDescriptions( | 42 void GetAudioInputDeviceDescriptions( |
42 AudioDeviceDescriptions* device_descriptions) final; | 43 AudioDeviceDescriptions* device_descriptions) final; |
43 void GetAudioOutputDeviceDescriptions( | 44 void GetAudioOutputDeviceDescriptions( |
44 AudioDeviceDescriptions* device_descriptions) final; | 45 AudioDeviceDescriptions* device_descriptions) final; |
45 | 46 |
46 AudioOutputStream* MakeAudioOutputStream( | 47 AudioOutputStream* MakeAudioOutputStream( |
47 const AudioParameters& params, | 48 const AudioParameters& params, |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 return static_cast<int>(input_streams_.size()); | 110 return static_cast<int>(input_streams_.size()); |
110 } | 111 } |
111 int output_stream_count() const { return num_output_streams_; } | 112 int output_stream_count() const { return num_output_streams_; } |
112 | 113 |
113 protected: | 114 protected: |
114 AudioManagerBase( | 115 AudioManagerBase( |
115 scoped_refptr<base::SingleThreadTaskRunner> task_runner, | 116 scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
116 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, | 117 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner, |
117 AudioLogFactory* audio_log_factory); | 118 AudioLogFactory* audio_log_factory); |
118 | 119 |
119 // Releases all the audio output dispatchers. | |
120 // All audio streams should be closed before Shutdown() is called. | |
121 // This must be called in the destructor of every AudioManagerBase | |
122 // implementation. | |
123 void Shutdown(); | |
124 | |
125 void SetMaxOutputStreamsAllowed(int max) { max_num_output_streams_ = max; } | 120 void SetMaxOutputStreamsAllowed(int max) { max_num_output_streams_ = max; } |
126 | 121 |
127 // Called by each platform specific AudioManager to notify output state change | 122 // Called by each platform specific AudioManager to notify output state change |
128 // listeners that a state change has occurred. Must be called from the audio | 123 // listeners that a state change has occurred. Must be called from the audio |
129 // thread. | 124 // thread. |
130 void NotifyAllOutputDeviceChangeListeners(); | 125 void NotifyAllOutputDeviceChangeListeners(); |
131 | 126 |
132 // Returns user buffer size as specified on the command line or 0 if no buffer | 127 // Returns user buffer size as specified on the command line or 0 if no buffer |
133 // size has been specified. | 128 // size has been specified. |
134 static int GetUserBufferSize(); | 129 static int GetUserBufferSize(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 200 |
206 // Debug recording manager. | 201 // Debug recording manager. |
207 std::unique_ptr<AudioDebugRecordingManager> debug_recording_manager_; | 202 std::unique_ptr<AudioDebugRecordingManager> debug_recording_manager_; |
208 | 203 |
209 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 204 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
210 }; | 205 }; |
211 | 206 |
212 } // namespace media | 207 } // namespace media |
213 | 208 |
214 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 209 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |