aboutsummaryrefslogtreecommitdiff
path: root/webrtc/modules/audio_device/android/audio_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/modules/audio_device/android/audio_manager.cc')
-rw-r--r--webrtc/modules/audio_device/android/audio_manager.cc31
1 files changed, 14 insertions, 17 deletions
diff --git a/webrtc/modules/audio_device/android/audio_manager.cc b/webrtc/modules/audio_device/android/audio_manager.cc
index 169a1929ce..1d08a6adc0 100644
--- a/webrtc/modules/audio_device/android/audio_manager.cc
+++ b/webrtc/modules/audio_device/android/audio_manager.cc
@@ -10,13 +10,15 @@
#include "webrtc/modules/audio_device/android/audio_manager.h"
+#include <utility>
+
#include <android/log.h>
#include "webrtc/base/arraysize.h"
#include "webrtc/base/checks.h"
#include "webrtc/base/scoped_ptr.h"
#include "webrtc/modules/audio_device/android/audio_common.h"
-#include "webrtc/modules/utility/interface/helpers_android.h"
+#include "webrtc/modules/utility/include/helpers_android.h"
#define TAG "AudioManager"
#define ALOGV(...) __android_log_print(ANDROID_LOG_VERBOSE, TAG, __VA_ARGS__)
@@ -29,15 +31,16 @@ namespace webrtc {
// AudioManager::JavaAudioManager implementation
AudioManager::JavaAudioManager::JavaAudioManager(
- NativeRegistration* native_reg, rtc::scoped_ptr<GlobalRef> audio_manager)
- : audio_manager_(audio_manager.Pass()),
+ NativeRegistration* native_reg,
+ rtc::scoped_ptr<GlobalRef> audio_manager)
+ : audio_manager_(std::move(audio_manager)),
init_(native_reg->GetMethodId("init", "()Z")),
dispose_(native_reg->GetMethodId("dispose", "()V")),
is_communication_mode_enabled_(
native_reg->GetMethodId("isCommunicationModeEnabled", "()Z")),
is_device_blacklisted_for_open_sles_usage_(
- native_reg->GetMethodId(
- "isDeviceBlacklistedForOpenSLESUsage", "()Z")) {
+ native_reg->GetMethodId("isDeviceBlacklistedForOpenSLESUsage",
+ "()Z")) {
ALOGD("JavaAudioManager::ctor%s", GetThreadInfo().c_str());
}
@@ -71,13 +74,12 @@ AudioManager::AudioManager()
hardware_agc_(false),
hardware_ns_(false),
low_latency_playout_(false),
- delay_estimate_in_milliseconds_(0),
- output_stream_type_(0) {
+ delay_estimate_in_milliseconds_(0) {
ALOGD("ctor%s", GetThreadInfo().c_str());
RTC_CHECK(j_environment_);
JNINativeMethod native_methods[] = {
{"nativeCacheAudioParameters",
- "(IIZZZZIIIJ)V",
+ "(IIZZZZIIJ)V",
reinterpret_cast<void*>(&webrtc::AudioManager::CacheAudioParameters)}};
j_native_registration_ = j_environment_->RegisterNatives(
"org/webrtc/voiceengine/WebRtcAudioManager",
@@ -180,14 +182,12 @@ void JNICALL AudioManager::CacheAudioParameters(JNIEnv* env,
jboolean low_latency_output,
jint output_buffer_size,
jint input_buffer_size,
- jint output_stream_type,
jlong native_audio_manager) {
webrtc::AudioManager* this_object =
reinterpret_cast<webrtc::AudioManager*>(native_audio_manager);
this_object->OnCacheAudioParameters(
env, sample_rate, channels, hardware_aec, hardware_agc, hardware_ns,
- low_latency_output, output_buffer_size, input_buffer_size,
- output_stream_type);
+ low_latency_output, output_buffer_size, input_buffer_size);
}
void AudioManager::OnCacheAudioParameters(JNIEnv* env,
@@ -198,8 +198,7 @@ void AudioManager::OnCacheAudioParameters(JNIEnv* env,
jboolean hardware_ns,
jboolean low_latency_output,
jint output_buffer_size,
- jint input_buffer_size,
- jint output_stream_type) {
+ jint input_buffer_size) {
ALOGD("OnCacheAudioParameters%s", GetThreadInfo().c_str());
ALOGD("hardware_aec: %d", hardware_aec);
ALOGD("hardware_agc: %d", hardware_agc);
@@ -209,17 +208,15 @@ void AudioManager::OnCacheAudioParameters(JNIEnv* env,
ALOGD("channels: %d", channels);
ALOGD("output_buffer_size: %d", output_buffer_size);
ALOGD("input_buffer_size: %d", input_buffer_size);
- ALOGD("output_stream_type: %d", output_stream_type);
RTC_DCHECK(thread_checker_.CalledOnValidThread());
hardware_aec_ = hardware_aec;
hardware_agc_ = hardware_agc;
hardware_ns_ = hardware_ns;
low_latency_playout_ = low_latency_output;
- output_stream_type_ = output_stream_type;
// TODO(henrika): add support for stereo output.
- playout_parameters_.reset(sample_rate, channels,
+ playout_parameters_.reset(sample_rate, static_cast<size_t>(channels),
static_cast<size_t>(output_buffer_size));
- record_parameters_.reset(sample_rate, channels,
+ record_parameters_.reset(sample_rate, static_cast<size_t>(channels),
static_cast<size_t>(input_buffer_size));
}