OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
| 9 |
8 #include "base/thread.h" | 10 #include "base/thread.h" |
9 #include "media/audio/audio_manager.h" | 11 #include "media/audio/audio_manager.h" |
10 | 12 |
| 13 class AudioOutputDispatcher; |
| 14 |
11 // AudioManagerBase provides AudioManager functions common for all platforms. | 15 // AudioManagerBase provides AudioManager functions common for all platforms. |
12 class AudioManagerBase : public AudioManager { | 16 class AudioManagerBase : public AudioManager { |
13 public: | 17 public: |
14 AudioManagerBase(); | 18 AudioManagerBase(); |
15 | 19 |
16 virtual void Init(); | 20 virtual void Init(); |
17 | 21 |
18 virtual MessageLoop* GetMessageLoop(); | 22 virtual MessageLoop* GetMessageLoop(); |
19 | 23 |
20 virtual string16 GetAudioInputDeviceModel(); | 24 virtual string16 GetAudioInputDeviceModel(); |
21 | 25 |
| 26 virtual AudioOutputStream* MakeAudioOutputStreamProxy( |
| 27 const AudioParameters& params); |
| 28 |
22 protected: | 29 protected: |
23 virtual ~AudioManagerBase() {} | 30 virtual ~AudioManagerBase(); |
| 31 |
| 32 typedef std::map<AudioParameters, scoped_refptr<AudioOutputDispatcher>, |
| 33 AudioParameters::Compare> |
| 34 AudioOutputDispatchersMap; |
24 | 35 |
25 bool initialized() { return initialized_; } | 36 bool initialized() { return initialized_; } |
26 | 37 |
27 // Thread used to interact with AudioOutputStreams created by this | 38 // Thread used to interact with AudioOutputStreams created by this |
28 // audio manger. | 39 // audio manger. |
29 base::Thread audio_thread_; | 40 base::Thread audio_thread_; |
30 | 41 |
31 bool initialized_; | 42 bool initialized_; |
32 | 43 |
| 44 AudioOutputDispatchersMap output_dispatchers_; |
| 45 |
33 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 46 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
34 }; | 47 }; |
35 | 48 |
36 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 49 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
OLD | NEW |