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; | |
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; |
40 static bool RegisterAudioManager(JNIEnv* env); | |
tommi (sloooow) - chröme
2013/03/11 09:57:18
Add whitespace to separate this method from the vi
leozwang1
2013/03/11 15:12:24
Done.
Yes, it must be public which is called by me
| |
34 | 41 |
35 protected: | 42 protected: |
36 virtual ~AudioManagerAndroid(); | 43 virtual ~AudioManagerAndroid(); |
37 | 44 |
38 virtual AudioParameters GetPreferredOutputStreamParameters( | 45 virtual AudioParameters GetPreferredOutputStreamParameters( |
tommi (sloooow) - chröme
2013/03/11 09:57:18
why is this method here and not with the other met
leozwang1
2013/03/11 15:12:24
Tommi, can you please explain more? where shall I
no longer working on chromium
2013/03/11 16:07:54
You meant GetPreferredOutputStreamParameters and G
| |
39 const AudioParameters& input_params) OVERRIDE; | 46 const AudioParameters& input_params) OVERRIDE; |
47 void SetAudioMode(int mode); | |
40 | 48 |
41 private: | 49 private: |
42 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); | 50 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); |
43 }; | 51 }; |
44 | 52 |
45 } // namespace media | 53 } // namespace media |
46 | 54 |
47 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 55 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
OLD | NEW |