| 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 <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 void SetAudioMode(int mode); | 72 void SetAudioMode(int mode); |
| 73 void SetAudioDevice(const std::string& device_id); | 73 void SetAudioDevice(const std::string& device_id); |
| 74 int GetNativeOutputSampleRate(); | 74 int GetNativeOutputSampleRate(); |
| 75 bool IsAudioLowLatencySupported(); | 75 bool IsAudioLowLatencySupported(); |
| 76 int GetAudioLowLatencyOutputFrameSize(); | 76 int GetAudioLowLatencyOutputFrameSize(); |
| 77 int GetOptimalOutputFrameSize(int sample_rate, int channels); | 77 int GetOptimalOutputFrameSize(int sample_rate, int channels); |
| 78 | 78 |
| 79 void DoSetMuteOnAudioThread(bool muted); | 79 void DoSetMuteOnAudioThread(bool muted); |
| 80 | 80 |
| 81 // Allow the AudioAndroidTest to access private methods. | 81 // Allow the AudioAndroidTest to access private methods. |
| 82 FRIEND_TEST_ALL_PREFIXES(AudioAndroidOutputTest, IsAudioLowLatencySupported); | 82 FRIEND_TEST_ALL_PREFIXES(AudioAndroidTest, IsAudioLowLatencySupported); |
| 83 | 83 |
| 84 // Java AudioManager instance. | 84 // Java AudioManager instance. |
| 85 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; | 85 base::android::ScopedJavaGlobalRef<jobject> j_audio_manager_; |
| 86 | 86 |
| 87 typedef std::set<OpenSLESOutputStream*> OutputStreams; | 87 typedef std::set<OpenSLESOutputStream*> OutputStreams; |
| 88 OutputStreams streams_; | 88 OutputStreams streams_; |
| 89 // TODO(wjia): remove this lock once unit test modules are fixed to call | 89 // TODO(wjia): remove this lock once unit test modules are fixed to call |
| 90 // AudioManager::MakeAudioOutputStream on the audio thread. For now, this | 90 // AudioManager::MakeAudioOutputStream on the audio thread. For now, this |
| 91 // lock is used to guard access to |streams_|. | 91 // lock is used to guard access to |streams_|. |
| 92 base::Lock streams_lock_; | 92 base::Lock streams_lock_; |
| 93 | 93 |
| 94 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); | 94 DISALLOW_COPY_AND_ASSIGN(AudioManagerAndroid); |
| 95 }; | 95 }; |
| 96 | 96 |
| 97 } // namespace media | 97 } // namespace media |
| 98 | 98 |
| 99 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ | 99 #endif // MEDIA_AUDIO_ANDROID_AUDIO_MANAGER_ANDROID_H_ |
| OLD | NEW |