#ifdef HAVE_AMR
extern "C" void libmsamr_init();
#endif
+#ifdef HAVE_SILK
+extern "C" void libmssilk_init();
+#endif
#endif /*ANDROID*/
static JavaVM *jvm=0;
#endif
#ifdef HAVE_AMR
libmsamr_init();
+#endif
+#ifdef HAVE_SILK
+ libmssilk_init();
#endif
jlong nativePtr = (jlong)linphone_core_new( &ldata->vTable
,userConfig
,jobject thiz
,jlong lc
,jobject obj) {
+ jobject oldWindow = (jobject) linphone_core_get_native_video_window_id((LinphoneCore*)lc);
+ if (oldWindow != NULL) {
+ env->DeleteGlobalRef(oldWindow);
+ }
+ if (obj != NULL) {
+ obj = env->NewGlobalRef(obj);
+ }
linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
,jobject thiz
,jlong lc
,jobject obj) {
+ jobject oldWindow = (jobject) linphone_core_get_native_preview_window_id((LinphoneCore*)lc);
+ if (oldWindow != NULL) {
+ env->DeleteGlobalRef(oldWindow);
+ }
+ if (obj != NULL) {
+ obj = env->NewGlobalRef(obj);
+ }
linphone_core_set_native_preview_window_id((LinphoneCore*)lc,(unsigned long)obj);
}
extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateAllCalls(JNIEnv *env,jobject thiz,jlong pCore) {
linphone_core_terminate_all_calls((LinphoneCore *) pCore);
}
-extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,jobject thiz,jlong pCore,jint position) {
- return (jlong)ms_list_nth_data(linphone_core_get_calls((LinphoneCore *) pCore),position);
+extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getCall(JNIEnv *env,jobject thiz,jlong pCore,jint position) {
+ LinphoneCoreData *lcd=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)pCore);
+ LinphoneCall* lCall = (LinphoneCall*) ms_list_nth_data(linphone_core_get_calls((LinphoneCore *) pCore),position);
+ return lcd->getCall(env,lCall);
}
extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getCallsNb(JNIEnv *env,jobject thiz,jlong pCore) {
return ms_list_size(linphone_core_get_calls((LinphoneCore *) pCore));
}
}
-extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_findCallFromUri(JNIEnv *env,jobject thiz,jlong pCore, jstring jUri) {
+extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_findCallFromUri(JNIEnv *env,jobject thiz,jlong pCore, jstring jUri) {
const char* cUri=env->GetStringUTFChars(jUri, NULL);
- const LinphoneCall *call=linphone_core_find_call_from_uri((LinphoneCore *) pCore,cUri);
+ LinphoneCall *call= (LinphoneCall *) linphone_core_find_call_from_uri((LinphoneCore *) pCore,cUri);
env->ReleaseStringUTFChars(jUri, cUri);
- return (jlong) call;
+ LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)pCore);
+ return (jobject) lcdata->getCall(env,call);
}
return linphone_call_are_all_streams_encrypted((LinphoneCall *) ptr);
}
+extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_soundResourcesLocked(JNIEnv* env,jobject thiz,jlong ptr){
+ return linphone_core_sound_resources_locked((LinphoneCore *) ptr);
+}
+
// Needed by Galaxy S (can't switch to/from speaker while playing and still keep mic working)
// Implemented directly in msandroid.cpp (sound filters for Android).
extern "C" void msandroid_hack_speaker_state(bool speakerOn);
extern "C" void Java_org_linphone_LinphoneManager_hackSpeakerState(JNIEnv* env,jobject thiz,jboolean speakerOn){
msandroid_hack_speaker_state(speakerOn);
+}
// End Galaxy S hack functions
+
+
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getMaxCalls(JNIEnv *env,jobject thiz,jlong pCore) {
+ return (jint) linphone_core_get_max_calls((LinphoneCore *) pCore);
}