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 "base/android/jni_android.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "media/audio/audio_manager_base.h" | 10 #include "media/audio/audio_manager_base.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 static bool RegisterAudioManager(JNIEnv* env); | 53 static bool RegisterAudioManager(JNIEnv* env); |
54 | 54 |
55 protected: | 55 protected: |
56 virtual ~AudioManagerAndroid(); | 56 virtual ~AudioManagerAndroid(); |
57 | 57 |
58 virtual AudioParameters GetPreferredOutputStreamParameters( | 58 virtual AudioParameters GetPreferredOutputStreamParameters( |
59 const std::string& output_device_id, | 59 const std::string& output_device_id, |
60 const AudioParameters& input_params) OVERRIDE; | 60 const AudioParameters& input_params) OVERRIDE; |
61 | 61 |
62 private: | 62 private: |
63 void Init(); | |
64 void Close(); | |
63 void SetAudioMode(int mode); | 65 void SetAudioMode(int mode); |
64 void RegisterHeadsetReceiver(); | 66 void SetAudioDevice(std::string device_id); |
bulach
2013/11/29 10:58:39
nit: const & ?
henrika (OOO until Aug 14)
2013/11/29 12:20:20
I actually modify it if it contains "default". Sou
tommi (sloooow) - chröme
2013/11/29 13:11:16
we actually never pass strings by value so +1 on c
henrika (OOO until Aug 14)
2013/11/29 14:56:16
Will fix.
| |
65 void UnregisterHeadsetReceiver(); | |
66 int GetNativeOutputSampleRate(); | 67 int GetNativeOutputSampleRate(); |
67 bool IsAudioLowLatencySupported(); | 68 bool IsAudioLowLatencySupported(); |
68 int GetAudioLowLatencyOutputFrameSize(); | 69 int GetAudioLowLatencyOutputFrameSize(); |
69 int GetOptimalOutputFrameSize(int sample_rate, int channels); | 70 int GetOptimalOutputFrameSize(int sample_rate, int channels); |
70 | 71 |
71 // Allow the AudioAndroidTest to access private methods. | 72 // Allow the AudioAndroidTest to access private methods. |
72 FRIEND_TEST_ALL_PREFIXES(AudioAndroidTest, IsAudioLowLatencySupported); | 73 FRIEND_TEST_ALL_PREFIXES(AudioAndroidTest, IsAudioLowLatencySupported); |
73 | 74 |
74 // Java AudioManager instance. | 75 // Java AudioManager instance. |
75 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; | 76 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; |
76 | 77 |
77 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); | 78 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); |
78 }; | 79 }; |
79 | 80 |
80 } // namespace media | 81 } // namespace media |
81 | 82 |
82 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 83 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
OLD | NEW |