OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return audio_manager_->CallBooleanMethod(is_communication_mode_enabled_); | 59 return audio_manager_->CallBooleanMethod(is_communication_mode_enabled_); |
60 } | 60 } |
61 | 61 |
62 bool AudioManager::JavaAudioManager::IsDeviceBlacklistedForOpenSLESUsage() { | 62 bool AudioManager::JavaAudioManager::IsDeviceBlacklistedForOpenSLESUsage() { |
63 return audio_manager_->CallBooleanMethod( | 63 return audio_manager_->CallBooleanMethod( |
64 is_device_blacklisted_for_open_sles_usage_); | 64 is_device_blacklisted_for_open_sles_usage_); |
65 } | 65 } |
66 | 66 |
67 // AudioManager implementation | 67 // AudioManager implementation |
68 AudioManager::AudioManager() | 68 AudioManager::AudioManager() |
69 : j_environment_(rtc::ScopedToUnique(JVM::GetInstance()->environment())), | 69 : j_environment_(JVM::GetInstance()->environment()), |
70 audio_layer_(AudioDeviceModule::kPlatformDefaultAudio), | 70 audio_layer_(AudioDeviceModule::kPlatformDefaultAudio), |
71 initialized_(false), | 71 initialized_(false), |
72 hardware_aec_(false), | 72 hardware_aec_(false), |
73 hardware_agc_(false), | 73 hardware_agc_(false), |
74 hardware_ns_(false), | 74 hardware_ns_(false), |
75 low_latency_playout_(false), | 75 low_latency_playout_(false), |
76 delay_estimate_in_milliseconds_(0) { | 76 delay_estimate_in_milliseconds_(0) { |
77 ALOGD("ctor%s", GetThreadInfo().c_str()); | 77 ALOGD("ctor%s", GetThreadInfo().c_str()); |
78 RTC_CHECK(j_environment_); | 78 RTC_CHECK(j_environment_); |
79 JNINativeMethod native_methods[] = { | 79 JNINativeMethod native_methods[] = { |
80 {"nativeCacheAudioParameters", | 80 {"nativeCacheAudioParameters", |
81 "(IIZZZZIIJ)V", | 81 "(IIZZZZIIJ)V", |
82 reinterpret_cast<void*>(&webrtc::AudioManager::CacheAudioParameters)}}; | 82 reinterpret_cast<void*>(&webrtc::AudioManager::CacheAudioParameters)}}; |
83 j_native_registration_ = rtc::ScopedToUnique(j_environment_->RegisterNatives( | 83 j_native_registration_ = j_environment_->RegisterNatives( |
84 "org/webrtc/voiceengine/WebRtcAudioManager", | 84 "org/webrtc/voiceengine/WebRtcAudioManager", native_methods, |
85 native_methods, arraysize(native_methods))); | 85 arraysize(native_methods)); |
86 j_audio_manager_.reset(new JavaAudioManager( | 86 j_audio_manager_.reset(new JavaAudioManager( |
87 j_native_registration_.get(), | 87 j_native_registration_.get(), |
88 rtc::ScopedToUnique(j_native_registration_->NewObject( | 88 j_native_registration_->NewObject( |
89 "<init>", "(Landroid/content/Context;J)V", | 89 "<init>", "(Landroid/content/Context;J)V", |
90 JVM::GetInstance()->context(), PointerTojlong(this))))); | 90 JVM::GetInstance()->context(), PointerTojlong(this)))); |
91 } | 91 } |
92 | 92 |
93 AudioManager::~AudioManager() { | 93 AudioManager::~AudioManager() { |
94 ALOGD("~dtor%s", GetThreadInfo().c_str()); | 94 ALOGD("~dtor%s", GetThreadInfo().c_str()); |
95 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 95 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
96 Close(); | 96 Close(); |
97 } | 97 } |
98 | 98 |
99 void AudioManager::SetActiveAudioLayer( | 99 void AudioManager::SetActiveAudioLayer( |
100 AudioDeviceModule::AudioLayer audio_layer) { | 100 AudioDeviceModule::AudioLayer audio_layer) { |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 return playout_parameters_; | 225 return playout_parameters_; |
226 } | 226 } |
227 | 227 |
228 const AudioParameters& AudioManager::GetRecordAudioParameters() { | 228 const AudioParameters& AudioManager::GetRecordAudioParameters() { |
229 RTC_CHECK(record_parameters_.is_valid()); | 229 RTC_CHECK(record_parameters_.is_valid()); |
230 RTC_DCHECK(thread_checker_.CalledOnValidThread()); | 230 RTC_DCHECK(thread_checker_.CalledOnValidThread()); |
231 return record_parameters_; | 231 return record_parameters_; |
232 } | 232 } |
233 | 233 |
234 } // namespace webrtc | 234 } // namespace webrtc |
OLD | NEW |