mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
Fixed needsEchoCalibration JNI method
This commit is contained in:
parent
472befa723
commit
8a99057d8d
1 changed files with 2 additions and 11 deletions
|
|
@ -2388,25 +2388,16 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNI
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lcptr) {
|
extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lcptr) {
|
||||||
MSSndCard *sndcard;
|
|
||||||
LinphoneCore *lc = (LinphoneCore*) lcptr;
|
LinphoneCore *lc = (LinphoneCore*) lcptr;
|
||||||
MSFactory * factory = linphone_core_get_ms_factory(lc);
|
MSFactory * factory = linphone_core_get_ms_factory(lc);
|
||||||
MSSndCardManager *m = ms_factory_get_snd_card_manager(factory);
|
|
||||||
const char *card = linphone_core_get_capture_device((LinphoneCore*)lc);
|
|
||||||
sndcard = ms_snd_card_manager_get_card(m, card);
|
|
||||||
if (sndcard == NULL) {
|
|
||||||
ms_error("Could not get soundcard %s", card);
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
MSDevicesInfo *devices = ms_factory_get_devices_info(factory);
|
MSDevicesInfo *devices = ms_factory_get_devices_info(factory);
|
||||||
SoundDeviceDescription *sound_description = ms_devices_info_get_sound_device_description(devices);
|
SoundDeviceDescription *sound_description = ms_devices_info_get_sound_device_description(devices);
|
||||||
if(sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){
|
if(sound_description != NULL && sound_description == &genericSoundDeviceDescriptor){
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) return FALSE;
|
if (sound_description->flags & DEVICE_HAS_BUILTIN_AEC) return FALSE;
|
||||||
if (ms_snd_card_get_minimal_latency(sndcard) != 0) return FALSE;
|
if (sound_description->delay != 0) return FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue