]> sjero.net Git - linphone/blobdiff - coreapi/linphonecore_jni.cc
improve echo calibration
[linphone] / coreapi / linphonecore_jni.cc
index 64897b2189a89b53e03c06fa28b5d6e7173339a8..9c8697f6aad5f3082ff550eb24fe97e4be89d758 100644 (file)
@@ -650,6 +650,13 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateCall(     JNIEnv*
        linphone_core_terminate_call((LinphoneCore*)lc,(LinphoneCall*)call);
 }
 
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_declineCall(   JNIEnv*  env
+               ,jobject  thiz
+               ,jlong lc
+               ,jlong call, jint reason) {
+       linphone_core_decline_call((LinphoneCore*)lc,(LinphoneCall*)call,(LinphoneReason)reason);
+}
+
 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getRemoteAddress(     JNIEnv*  env
                ,jobject  thiz
                ,jlong lc) {
@@ -993,6 +1000,18 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startEchoCalibration(JNI
 
 }
 
+extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_needsEchoCalibration(JNIEnv *env, jobject thiz, jlong lc){
+       MSSndCard *sndcard;
+       MSSndCardManager *m=ms_snd_card_manager_get();
+       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.");
+               return TRUE;
+       }
+       return (ms_snd_card_get_capabilities(sndcard) & MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER) || (ms_snd_card_get_minimal_latency(sndcard)>0);
+}
+
 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMediaEncryption(JNIEnv*  env
                                                                                                                                                        ,jobject  thiz
                                                                                                                                                        ,jlong lc