mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-29 17:29:20 +00:00
Merge branch 'master' of git://git.sv.gnu.org/linphone
This commit is contained in:
commit
615dd1cb39
2 changed files with 39 additions and 24 deletions
|
|
@ -53,6 +53,10 @@ static void linphone_android_log_handler(OrtpLogLevel lev, const char *fmt, va_l
|
|||
}
|
||||
__android_log_vprint(prio, LOG_DOMAIN, fmt, args);
|
||||
}
|
||||
|
||||
int dumbMethodForAllowingUsageOfCpuFeaturesFromStaticLibMediastream() {
|
||||
return (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM && (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0);
|
||||
}
|
||||
#endif /*ANDROID*/
|
||||
|
||||
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *ajvm, void *reserved)
|
||||
|
|
@ -264,6 +268,24 @@ public:
|
|||
,env->CallStaticObjectMethod(lcData->registrationStateClass,lcData->registrationStateFromIntId,(jint)state),
|
||||
message ? env->NewStringUTF(message) : NULL);
|
||||
}
|
||||
jobject getCall(JNIEnv *env , LinphoneCall *call){
|
||||
jobject jobj=0;
|
||||
|
||||
if (call!=NULL){
|
||||
void *up=linphone_call_get_user_pointer(call);
|
||||
|
||||
if (up==NULL){
|
||||
jobj=env->NewObject(callClass,callCtrId,(jlong)call);
|
||||
linphone_call_set_user_pointer(call,(void*)jobj);
|
||||
//env->NewGlobalRef(jobj);
|
||||
linphone_call_ref(call);
|
||||
}else{
|
||||
jobj=(jobject)up;
|
||||
}
|
||||
}
|
||||
return jobj;
|
||||
}
|
||||
|
||||
static void callStateChange(LinphoneCore *lc, LinphoneCall* call,LinphoneCallState state,const char* message) {
|
||||
JNIEnv *env = 0;
|
||||
jint result = jvm->AttachCurrentThread(&env,NULL);
|
||||
|
|
@ -275,7 +297,7 @@ public:
|
|||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->callStateId
|
||||
,lcData->core
|
||||
,env->NewObject(lcData->callClass,lcData->callCtrId,(jlong)call)
|
||||
,lcData->getCall(env,call)
|
||||
,env->CallStaticObjectMethod(lcData->callStateClass,lcData->callStateFromIntId,(jint)state),
|
||||
message ? env->NewStringUTF(message) : NULL);
|
||||
}
|
||||
|
|
@ -290,7 +312,7 @@ public:
|
|||
env->CallVoidMethod(lcData->listener
|
||||
,lcData->callEncryptionChangedId
|
||||
,lcData->core
|
||||
,env->NewObject(lcData->callClass,lcData->callCtrId,(jlong)call)
|
||||
,lcData->getCall(env,call)
|
||||
,encrypted
|
||||
,authentication_token ? env->NewStringUTF(authentication_token) : NULL);
|
||||
}
|
||||
|
|
@ -640,11 +662,13 @@ extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isEchoCancellationEn
|
|||
return linphone_core_echo_cancellation_enabled((LinphoneCore*)lc);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCurrentCall(JNIEnv* env
|
||||
extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCurrentCall(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong lc
|
||||
) {
|
||||
return (jlong)linphone_core_get_current_call((LinphoneCore*)lc);
|
||||
LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)lc);
|
||||
|
||||
return lcdata->getCall(env,linphone_core_get_current_call((LinphoneCore*)lc));
|
||||
}
|
||||
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addFriend(JNIEnv* env
|
||||
,jobject thiz
|
||||
|
|
@ -1003,16 +1027,18 @@ extern "C" jint Java_org_linphone_core_PayloadTypeImpl_getRate(JNIEnv* env,jobj
|
|||
}
|
||||
|
||||
//LinphoneCall
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_ref(JNIEnv* env
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_finalize(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
linphone_call_ref((LinphoneCall*)ptr);
|
||||
}
|
||||
|
||||
extern "C" void Java_org_linphone_core_LinphoneCallImpl_unref(JNIEnv* env
|
||||
,jobject thiz
|
||||
,jlong ptr) {
|
||||
linphone_call_unref((LinphoneCall*)ptr);
|
||||
LinphoneCall *call=(LinphoneCall*)ptr;
|
||||
jobject jobj=(jobject)linphone_call_get_user_pointer(call);
|
||||
if (jobj==thiz){
|
||||
//env->DeleteGlobalRef(jobj);
|
||||
}else{
|
||||
ms_error("Call being destroyed is inconsistent: thiz=%lu, jobj=%lu",(unsigned long)thiz,(unsigned long)jobj);
|
||||
}
|
||||
linphone_call_set_user_pointer(call,NULL);
|
||||
linphone_call_unref(call);
|
||||
}
|
||||
|
||||
extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCallLog( JNIEnv* env
|
||||
|
|
@ -1329,17 +1355,6 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_adjustSoftwareVolume(JNI
|
|||
linphone_core_set_playback_gain_db((LinphoneCore *) ptr, db);
|
||||
}
|
||||
|
||||
extern "C" jboolean Java_org_linphone_core_Version_nativeHasNeon(JNIEnv *env){
|
||||
if (android_getCpuFamily() == ANDROID_CPU_FAMILY_ARM && (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
extern "C" jboolean Java_org_linphone_core_Version_nativeHasZrtp(JNIEnv *env){
|
||||
return ortp_zrtp_available();
|
||||
}
|
||||
|
||||
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_pauseCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) {
|
||||
return linphone_core_pause_call((LinphoneCore *) pCore, (LinphoneCall *) pCall);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit e0da8a8bab6d98d77d16d4eb3c8252ac08a39fd0
|
||||
Subproject commit 3ebe0396cbdb8cd49c0bbf262a87a9160bd13e64
|
||||
Loading…
Add table
Reference in a new issue