Chromium Code Reviews| 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_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 5 #ifndef MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
| 6 #define MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 6 #define MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
| 7 | 7 |
| 8 #include "base/android/jni_android.h" | |
| 8 #include "media/audio/audio_manager_base.h" | 9 #include "media/audio/audio_manager_base.h" |
| 9 | 10 |
| 10 namespace media { | 11 namespace media { |
| 11 | 12 |
| 12 // Android implemention of AudioManager. | 13 // Android implemention of AudioManager. |
| 13 class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase { | 14 class MEDIA_EXPORT AudioManagerAndroid : public AudioManagerBase { |
| 14 public: | 15 public: |
| 16 static const int kAudioModeNormal = 0x00000000; | |
| 17 static const int kAudioModeRingtone = 0x00000001; | |
|
qinmin
2013/03/11 23:09:56
be specific, i don't think it is proper for chrome
leozwang1
2013/03/12 22:23:00
Done.
| |
| 18 static const int kAudioModeInCall = 0x00000002; | |
| 19 static const int kAudioModeInCommunication = 0x00000003; | |
| 20 | |
| 15 AudioManagerAndroid(); | 21 AudioManagerAndroid(); |
| 16 | 22 |
| 17 // Implementation of AudioManager. | 23 // Implementation of AudioManager. |
| 18 virtual bool HasAudioOutputDevices() OVERRIDE; | 24 virtual bool HasAudioOutputDevices() OVERRIDE; |
| 19 virtual bool HasAudioInputDevices() OVERRIDE; | 25 virtual bool HasAudioInputDevices() OVERRIDE; |
| 20 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) | 26 virtual void GetAudioInputDeviceNames(media::AudioDeviceNames* device_names) |
| 21 OVERRIDE; | 27 OVERRIDE; |
| 22 virtual AudioParameters GetInputStreamParameters( | 28 virtual AudioParameters GetInputStreamParameters( |
| 23 const std::string& device_id) OVERRIDE; | 29 const std::string& device_id) OVERRIDE; |
| 24 | 30 |
| 25 // Implementation of AudioManagerBase. | 31 // Implementation of AudioManagerBase. |
| 26 virtual AudioOutputStream* MakeLinearOutputStream( | 32 virtual AudioOutputStream* MakeLinearOutputStream( |
| 27 const AudioParameters& params) OVERRIDE; | 33 const AudioParameters& params) OVERRIDE; |
| 28 virtual AudioOutputStream* MakeLowLatencyOutputStream( | 34 virtual AudioOutputStream* MakeLowLatencyOutputStream( |
| 29 const AudioParameters& params) OVERRIDE; | 35 const AudioParameters& params) OVERRIDE; |
| 30 virtual AudioInputStream* MakeLinearInputStream( | 36 virtual AudioInputStream* MakeLinearInputStream( |
| 31 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 37 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 32 virtual AudioInputStream* MakeLowLatencyInputStream( | 38 virtual AudioInputStream* MakeLowLatencyInputStream( |
| 33 const AudioParameters& params, const std::string& device_id) OVERRIDE; | 39 const AudioParameters& params, const std::string& device_id) OVERRIDE; |
| 34 | 40 |
| 41 static bool RegisterAudioManager(JNIEnv* env); | |
| 42 | |
| 35 protected: | 43 protected: |
| 36 virtual ~AudioManagerAndroid(); | 44 virtual ~AudioManagerAndroid(); |
| 37 | 45 |
| 38 virtual AudioParameters GetPreferredOutputStreamParameters( | 46 virtual AudioParameters GetPreferredOutputStreamParameters( |
| 39 const AudioParameters& input_params) OVERRIDE; | 47 const AudioParameters& input_params) OVERRIDE; |
| 48 void SetAudioMode(int mode); | |
| 40 | 49 |
| 41 private: | 50 private: |
| 42 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); | 51 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); |
| 43 }; | 52 }; |
| 44 | 53 |
| 45 } // namespace media | 54 } // namespace media |
| 46 | 55 |
| 47 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 56 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
| OLD | NEW |