| 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_MAC_AUDIO_MANAGER_MAC_H_ | 5 #ifndef MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| 6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ | 6 #define MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| 11 #include "media/audio/audio_manager_base.h" | 11 #include "media/audio/audio_manager_base.h" |
| 12 #include "media/audio/mac/audio_device_listener_mac.h" | 12 #include "media/audio/mac/audio_device_listener_mac.h" |
| 13 | 13 |
| 14 namespace media { | 14 namespace media { |
| 15 | 15 |
| 16 // Mac OS X implementation of the AudioManager singleton. This class is internal | 16 // Mac OS X implementation of the AudioManager singleton. This class is internal |
| 17 // to the audio output and only internal users can call methods not exposed by | 17 // to the audio output and only internal users can call methods not exposed by |
| 18 // the AudioManager class. | 18 // the AudioManager class. |
| 19 class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { | 19 class MEDIA_EXPORT AudioManagerMac : public AudioManagerBase { |
| 20 public: | 20 public: |
| 21 AudioManagerMac(); | 21 AudioManagerMac(); |
| 22 | 22 |
| 23 // Implementation of AudioManager. | 23 // Implementation of AudioManager. |
| 24 virtual bool HasAudioOutputDevices() OVERRIDE; | 24 virtual bool HasAudioOutputDevices() OVERRIDE; |
| 25 virtual bool HasAudioInputDevices() OVERRIDE; | 25 virtual bool HasAudioInputDevices() OVERRIDE; |
| 26 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) | 26 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) |
| 27 OVERRIDE; | 27 OVERRIDE; |
| 28 virtual AudioParameters GetDefaultOutputStreamParameters( |
| 29 const AudioParameters& input_params) OVERRIDE; |
| 30 virtual AudioParameters GetInputStreamParameters( |
| 31 const std::string& device_id) OVERRIDE; |
| 28 | 32 |
| 29 // Implementation of AudioManagerBase. | 33 // Implementation of AudioManagerBase. |
| 30 virtual AudioOutputStream* MakeLinearOutputStream( | 34 virtual AudioOutputStream* MakeLinearOutputStream( |
| 31 const AudioParameters& params) OVERRIDE; | 35 const AudioParameters& params) OVERRIDE; |
| 32 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 36 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
| 33 const AudioParameters& params) OVERRIDE; | 37 const AudioParameters& params) OVERRIDE; |
| 34 virtual AudioInputStream* MakeLinearInputStream( | 38 virtual AudioInputStream* MakeLinearInputStream( |
| 35 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 39 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 36 virtual AudioInputStream* MakeLowLatencyInputStream( | 40 virtual AudioInputStream* MakeLowLatencyInputStream( |
| 37 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 41 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 38 virtual AudioParameters GetPreferredLowLatencyOutputStreamParameters( | |
| 39 const AudioParameters& input_params) OVERRIDE; | |
| 40 | 42 |
| 41 protected: | 43 protected: |
| 42 virtual ~AudioManagerMac(); | 44 virtual ~AudioManagerMac(); |
| 43 | 45 |
| 44 private: | 46 private: |
| 45 // Helper methods for constructing AudioDeviceListenerMac on the audio thread. | 47 // Helper methods for constructing AudioDeviceListenerMac on the audio thread. |
| 46 void CreateDeviceListener(); | 48 void CreateDeviceListener(); |
| 47 void DestroyDeviceListener(); | 49 void DestroyDeviceListener(); |
| 48 void DelayedDeviceChange(); | 50 void DelayedDeviceChange(); |
| 49 | 51 |
| 50 scoped_ptr<AudioDeviceListenerMac> output_device_listener_; | 52 scoped_ptr<AudioDeviceListenerMac> output_device_listener_; |
| 51 | 53 |
| 52 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); | 54 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 } // namespace media | 57 } // namespace media |
| 56 | 58 |
| 57 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ | 59 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| OLD | NEW |