| 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_WIN_AUDIO_MANAGER_WIN_H_ | 5 #ifndef MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ |
| 6 #define MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ | 6 #define MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "media/audio/audio_manager_base.h" | 10 #include "media/audio/audio_manager_base.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 protected: | 50 protected: |
| 51 virtual ~AudioManagerWin(); | 51 virtual ~AudioManagerWin(); |
| 52 | 52 |
| 53 virtual AudioParameters GetPreferredOutputStreamParameters( | 53 virtual AudioParameters GetPreferredOutputStreamParameters( |
| 54 const std::string& output_device_id, | 54 const std::string& output_device_id, |
| 55 const AudioParameters& input_params) OVERRIDE; | 55 const AudioParameters& input_params) OVERRIDE; |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 enum EnumerationType { | 58 enum EnumerationType { |
| 59 kUninitializedEnumeration = 0, | |
| 60 kMMDeviceEnumeration, | 59 kMMDeviceEnumeration, |
| 61 kWaveEnumeration, | 60 kWaveEnumeration, |
| 62 }; | 61 }; |
| 63 | 62 |
| 64 // Allow unit test to modify the utilized enumeration API. | 63 // Allow unit test to modify the utilized enumeration API. |
| 65 friend class AudioManagerTest; | 64 friend class AudioManagerTest; |
| 66 | 65 |
| 67 EnumerationType enumeration_type_; | 66 EnumerationType enumeration_type_; |
| 68 EnumerationType enumeration_type() { return enumeration_type_; } | 67 EnumerationType enumeration_type() { return enumeration_type_; } |
| 69 void SetEnumerationType(EnumerationType type) { | 68 void SetEnumerationType(EnumerationType type) { |
| 70 enumeration_type_ = type; | 69 enumeration_type_ = type; |
| 71 } | 70 } |
| 72 | 71 |
| 72 inline bool core_audio_supported() const { |
| 73 return enumeration_type_ == kMMDeviceEnumeration; |
| 74 } |
| 75 |
| 73 // Returns a PCMWaveInAudioInputStream instance or NULL on failure. | 76 // Returns a PCMWaveInAudioInputStream instance or NULL on failure. |
| 74 // This method converts MMDevice-style device ID to WaveIn-style device ID if | 77 // This method converts MMDevice-style device ID to WaveIn-style device ID if |
| 75 // necessary. | 78 // necessary. |
| 76 // (Please see device_enumeration_win.h for more info about the two kinds of | 79 // (Please see device_enumeration_win.h for more info about the two kinds of |
| 77 // device IDs.) | 80 // device IDs.) |
| 78 AudioInputStream* CreatePCMWaveInAudioInputStream( | 81 AudioInputStream* CreatePCMWaveInAudioInputStream( |
| 79 const AudioParameters& params, | 82 const AudioParameters& params, |
| 80 const std::string& device_id); | 83 const std::string& device_id); |
| 81 | 84 |
| 82 // Helper methods for performing expensive initialization tasks on the audio | 85 // Helper methods for performing expensive initialization tasks on the audio |
| 83 // thread instead of on the UI thread which AudioManager is constructed on. | 86 // thread instead of on the UI thread which AudioManager is constructed on. |
| 84 void InitializeOnAudioThread(); | 87 void InitializeOnAudioThread(); |
| 85 void ShutdownOnAudioThread(); | 88 void ShutdownOnAudioThread(); |
| 86 | 89 |
| 87 void GetAudioDeviceNamesImpl(bool input, AudioDeviceNames* device_names); | 90 void GetAudioDeviceNamesImpl(bool input, AudioDeviceNames* device_names); |
| 88 | 91 |
| 89 // Listen for output device changes. | 92 // Listen for output device changes. |
| 90 scoped_ptr<AudioDeviceListenerWin> output_device_listener_; | 93 scoped_ptr<AudioDeviceListenerWin> output_device_listener_; |
| 91 | 94 |
| 92 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin); | 95 DISALLOW_COPY_AND_ASSIGN(AudioManagerWin); |
| 93 }; | 96 }; |
| 94 | 97 |
| 95 } // namespace media | 98 } // namespace media |
| 96 | 99 |
| 97 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ | 100 #endif // MEDIA_AUDIO_WIN_AUDIO_MANAGER_WIN_H_ |
| OLD | NEW |