| 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 GetInputStreamParameters( |
| 29 const std::string& device_id) OVERRIDE; |
| 28 | 30 |
| 29 // Implementation of AudioManagerBase. | 31 // Implementation of AudioManagerBase. |
| 30 virtual AudioOutputStream* MakeLinearOutputStream( | 32 virtual AudioOutputStream* MakeLinearOutputStream( |
| 31 const AudioParameters& params) OVERRIDE; | 33 const AudioParameters& params) OVERRIDE; |
| 32 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 34 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
| 33 const AudioParameters& params) OVERRIDE; | 35 const AudioParameters& params) OVERRIDE; |
| 34 virtual AudioInputStream* MakeLinearInputStream( | 36 virtual AudioInputStream* MakeLinearInputStream( |
| 35 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 37 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 36 virtual AudioInputStream* MakeLowLatencyInputStream( | 38 virtual AudioInputStream* MakeLowLatencyInputStream( |
| 37 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 39 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 38 virtual AudioParameters GetPreferredLowLatencyOutputStreamParameters( | |
| 39 const AudioParameters& input_params) OVERRIDE; | |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 virtual ~AudioManagerMac(); | 42 virtual ~AudioManagerMac(); |
| 43 | 43 |
| 44 virtual AudioParameters GetPreferredOutputStreamParameters( |
| 45 const AudioParameters& input_params) OVERRIDE; |
| 46 |
| 44 private: | 47 private: |
| 45 // Helper methods for constructing AudioDeviceListenerMac on the audio thread. | 48 // Helper methods for constructing AudioDeviceListenerMac on the audio thread. |
| 46 void CreateDeviceListener(); | 49 void CreateDeviceListener(); |
| 47 void DestroyDeviceListener(); | 50 void DestroyDeviceListener(); |
| 48 void DelayedDeviceChange(); | 51 void DelayedDeviceChange(); |
| 49 | 52 |
| 50 scoped_ptr<AudioDeviceListenerMac> output_device_listener_; | 53 scoped_ptr<AudioDeviceListenerMac> output_device_listener_; |
| 51 | 54 |
| 52 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); | 55 DISALLOW_COPY_AND_ASSIGN(AudioManagerMac); |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace media | 58 } // namespace media |
| 56 | 59 |
| 57 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ | 60 #endif // MEDIA_AUDIO_MAC_AUDIO_MANAGER_MAC_H_ |
| OLD | NEW |