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 10 matching lines...) Expand all Loading... |
21 #endif | 21 #endif |
22 | 22 |
23 namespace base { | 23 namespace base { |
24 class Thread; | 24 class Thread; |
25 } | 25 } |
26 | 26 |
27 namespace media { | 27 namespace media { |
28 | 28 |
29 class AudioOutputDispatcher; | 29 class AudioOutputDispatcher; |
30 class VirtualAudioInputStream; | 30 class VirtualAudioInputStream; |
| 31 class VirtualAudioOutputStream; |
31 | 32 |
32 // AudioManagerBase provides AudioManager functions common for all platforms. | 33 // AudioManagerBase provides AudioManager functions common for all platforms. |
33 class MEDIA_EXPORT AudioManagerBase : public AudioManager { | 34 class MEDIA_EXPORT AudioManagerBase : public AudioManager { |
34 public: | 35 public: |
35 // Name of the generic "default" device. | 36 // Name of the generic "default" device. |
36 static const char kDefaultDeviceName[]; | 37 static const char kDefaultDeviceName[]; |
37 // Unique Id of the generic "default" device. | 38 // Unique Id of the generic "default" device. |
38 static const char kDefaultDeviceId[]; | 39 static const char kDefaultDeviceId[]; |
39 | 40 |
40 virtual ~AudioManagerBase(); | 41 virtual ~AudioManagerBase(); |
(...skipping 16 matching lines...) Expand all Loading... |
57 | 58 |
58 virtual AudioOutputStream* MakeAudioOutputStreamProxy( | 59 virtual AudioOutputStream* MakeAudioOutputStreamProxy( |
59 const AudioParameters& params) OVERRIDE; | 60 const AudioParameters& params) OVERRIDE; |
60 | 61 |
61 virtual bool IsRecordingInProcess() OVERRIDE; | 62 virtual bool IsRecordingInProcess() OVERRIDE; |
62 | 63 |
63 // Called internally by the audio stream when it has been closed. | 64 // Called internally by the audio stream when it has been closed. |
64 virtual void ReleaseOutputStream(AudioOutputStream* stream); | 65 virtual void ReleaseOutputStream(AudioOutputStream* stream); |
65 virtual void ReleaseInputStream(AudioInputStream* stream); | 66 virtual void ReleaseInputStream(AudioInputStream* stream); |
66 | 67 |
| 68 // Called internally by the browser-wide VirtualAudioInputStream after it has |
| 69 // been closed. Notifies all AudioDeviceListeners to re-create output |
| 70 // streams and then deletes |stream|. |
| 71 virtual void ReleaseVirtualInputStream(VirtualAudioInputStream* stream); |
| 72 virtual void ReleaseVirtualOutputStream(VirtualAudioOutputStream* stream); |
| 73 |
67 void IncreaseActiveInputStreamCount(); | 74 void IncreaseActiveInputStreamCount(); |
68 void DecreaseActiveInputStreamCount(); | 75 void DecreaseActiveInputStreamCount(); |
69 | 76 |
70 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy | 77 // Creates the output stream for the |AUDIO_PCM_LINEAR| format. The legacy |
71 // name is also from |AUDIO_PCM_LINEAR|. | 78 // name is also from |AUDIO_PCM_LINEAR|. |
72 virtual AudioOutputStream* MakeLinearOutputStream( | 79 virtual AudioOutputStream* MakeLinearOutputStream( |
73 const AudioParameters& params) = 0; | 80 const AudioParameters& params) = 0; |
74 | 81 |
75 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. | 82 // Creates the output stream for the |AUDIO_PCM_LOW_LATENCY| format. |
76 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 83 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // create all audio output streams as virtual streams so as to redirect audio | 171 // create all audio output streams as virtual streams so as to redirect audio |
165 // data to this virtual input stream. | 172 // data to this virtual input stream. |
166 VirtualAudioInputStream* virtual_audio_input_stream_; | 173 VirtualAudioInputStream* virtual_audio_input_stream_; |
167 | 174 |
168 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 175 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
169 }; | 176 }; |
170 | 177 |
171 } // namespace media | 178 } // namespace media |
172 | 179 |
173 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 180 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |