mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-14 04:03:47 +00:00
Bug 1109248: Merge webrtc.org update with our OpenSLES changes rs=jesup
This commit is contained in:
parent
2bd1c1b6a1
commit
a333fa4da0
@ -419,23 +419,6 @@ bool OpenSlesInput::CheckPlatformAEC() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void OpenSlesInput::SetupVoiceMode() {
|
||||
SLAndroidConfigurationItf configItf;
|
||||
SLresult res = (*sles_recorder_)->GetInterface(sles_recorder_, SL_IID_ANDROIDCONFIGURATION_,
|
||||
(void*)&configItf);
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, id_, "OpenSL GetInterface: %d", res);
|
||||
|
||||
if (res == SL_RESULT_SUCCESS) {
|
||||
SLuint32 voiceMode = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
|
||||
SLuint32 voiceSize = sizeof(voiceMode);
|
||||
|
||||
res = (*configItf)->SetConfiguration(configItf,
|
||||
SL_ANDROID_KEY_RECORDING_PRESET,
|
||||
&voiceMode, voiceSize);
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, id_, "OpenSL Set Voice mode res: %d", res);
|
||||
}
|
||||
}
|
||||
|
||||
void OpenSlesInput::SetupAECAndNS() {
|
||||
bool hasAec = CheckPlatformAEC();
|
||||
WEBRTC_TRACE(kTraceError, kTraceAudioDevice, id_, "Platform has AEC: %d", hasAec);
|
||||
@ -539,7 +522,7 @@ bool OpenSlesInput::CreateAudioRecorder() {
|
||||
// Set audio recorder configuration to
|
||||
// SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION which ensures that we
|
||||
// use the main microphone tuned for audio communications.
|
||||
SLint32 stream_type = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
|
||||
SLuint32 stream_type = SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION;
|
||||
OPENSL_RETURN_ON_FAILURE(
|
||||
(*recorder_config)->SetConfiguration(recorder_config,
|
||||
SL_ANDROID_KEY_RECORDING_PRESET,
|
||||
@ -547,10 +530,6 @@ bool OpenSlesInput::CreateAudioRecorder() {
|
||||
sizeof(SLint32)),
|
||||
false);
|
||||
|
||||
#if defined(WEBRTC_GONK) && defined(WEBRTC_HARDWARE_AEC_NS)
|
||||
SetupVoiceMode();
|
||||
#endif
|
||||
|
||||
// Realize the recorder in synchronous mode.
|
||||
OPENSL_RETURN_ON_FAILURE((*sles_recorder_)->Realize(sles_recorder_,
|
||||
SL_BOOLEAN_FALSE),
|
||||
|
@ -15,6 +15,9 @@
|
||||
#include <SLES/OpenSLES_Android.h>
|
||||
#include <SLES/OpenSLES_AndroidConfiguration.h>
|
||||
|
||||
// Not defined in the android version we use to build with
|
||||
#define SL_ANDROID_RECORDING_PRESET_VOICE_COMMUNICATION ((SLuint32) 0x00000004)
|
||||
|
||||
#if !defined(WEBRTC_GONK)
|
||||
#include "webrtc/modules/audio_device/android/audio_manager_jni.h"
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user