Chromium Code Reviews| 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 |
| 24 virtual AudioOutputStream* MakeAudioOutputStreamProxy( | |
|
scherkus (not reviewing)
2010/11/22 06:43:15
making sure are we using audio proxies on all plat
Sergey Ulanov
2010/11/23 19:51:46
It works on all platforms, not only linux.
| |
| 25 AudioParameters params); | |
|
scherkus (not reviewing)
2010/11/22 06:43:15
ditto here
Sergey Ulanov
2010/11/23 19:51:46
Done.
| |
| 26 | |
| 20 protected: | 27 protected: |
| 21 virtual ~AudioManagerBase() {} | 28 virtual ~AudioManagerBase(); |
| 29 | |
| 30 class CompareAudioParams { | |
|
scherkus (not reviewing)
2010/11/22 06:43:15
does it makes sense to declare this on AudioParame
Sergey Ulanov
2010/11/23 19:51:46
Done
| |
| 31 public: | |
| 32 bool operator()(const AudioParameters& a, const AudioParameters& b) const; | |
| 33 }; | |
| 34 typedef std::map<AudioParameters, scoped_refptr<AudioOutputDispatcher>, | |
| 35 CompareAudioParams> | |
| 36 AudioOutputDispatchersMap; | |
| 22 | 37 |
| 23 bool initialized() { return initialized_; } | 38 bool initialized() { return initialized_; } |
| 24 | 39 |
| 25 // Thread used to interact with AudioOutputStreams created by this | 40 // Thread used to interact with AudioOutputStreams created by this |
| 26 // audio manger. | 41 // audio manger. |
| 27 base::Thread audio_thread_; | 42 base::Thread audio_thread_; |
| 28 | 43 |
| 29 bool initialized_; | 44 bool initialized_; |
| 30 | 45 |
| 46 AudioOutputDispatchersMap output_dispatchers_; | |
| 47 | |
| 31 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); | 48 DISALLOW_COPY_AND_ASSIGN(AudioManagerBase); |
| 32 }; | 49 }; |
| 33 | 50 |
| 34 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ | 51 #endif // MEDIA_AUDIO_AUDIO_MANAGER_BASE_H_ |
| OLD | NEW |