From: Guillaume Beraudo Date: Wed, 14 Sep 2011 08:27:11 +0000 (+0200) Subject: Conferencing JNI + Android support. X-Git-Url: http://sjero.net/git/?p=linphone;a=commitdiff_plain;h=b07b784570695a7177c92c89b8fa25cd36da088b Conferencing JNI + Android support. Conflicts: coreapi/conference.c coreapi/linphonecore.h --- diff --git a/build/android/Android.mk b/build/android/Android.mk index 1c7a611b..3946dca8 100755 --- a/build/android/Android.mk +++ b/build/android/Android.mk @@ -47,6 +47,7 @@ LOCAL_SRC_FILES := \ offeranswer.c \ callbacks.c \ linphonecall.c \ + conference.c \ ec-calibrator.c ifndef MY_LOG_DOMAIN diff --git a/coreapi/conference.c b/coreapi/conference.c index c1058233..695fc612 100644 --- a/coreapi/conference.c +++ b/coreapi/conference.c @@ -157,3 +157,6 @@ int linphone_core_enter_conference(LinphoneCore *lc){ return 0; } +int linphone_core_add_all_to_conference(LinphoneCore *lc) {return 0;} +int linphone_core_terminate_conference(LinphoneCore *lc) {return 0;} +int linphone_core_get_conference_size(LinphoneCore *lc) {return 0;} diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index dbf698fa..0cd5a232 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1025,11 +1025,14 @@ const char* linphone_call_get_authentication_token(LinphoneCall *call); bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call); int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call); +int linphone_core_add_all_to_conference(LinphoneCore *lc); int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call); bool_t linphone_core_is_in_conference(const LinphoneCore *lc); int linphone_core_enter_conference(LinphoneCore *lc); int linphone_core_leave_conference(LinphoneCore *lc); +int linphone_core_terminate_conference(LinphoneCore *lc); +int linphone_core_get_conference_size(LinphoneCore *lc); #ifdef __cplusplus } diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7ce1959f..d5bd4ef4 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1198,6 +1198,11 @@ extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_getVideoEnabled(JNIEnv *env, jobject thiz, jlong lcp){ return linphone_call_params_video_enabled((LinphoneCallParams*)lcp); } + +extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_localConferenceMode(JNIEnv *env, jobject thiz, jlong lcp){ + return linphone_call_params_local_conference_mode((LinphoneCallParams*)lcp); +} + extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){ return linphone_call_params_destroy((LinphoneCallParams*)lc); } @@ -1323,6 +1328,41 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_pauseAllCalls(JNIEnv *en extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_resumeCall(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { return linphone_core_resume_call((LinphoneCore *) pCore, (LinphoneCall *) pCall); } +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isInConference(JNIEnv *env,jobject thiz,jlong pCore) { + return linphone_core_is_in_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enterConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_enter_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_leaveConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_leave_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addAllToConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_add_all_to_conference((LinphoneCore *) pCore); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addToConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { + linphone_core_add_to_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); +} +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFromConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { + linphone_core_remove_from_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); +} + +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateConference(JNIEnv *env,jobject thiz,jlong pCore) { + linphone_core_terminate_conference((LinphoneCore *) pCore); +} +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv *env,jobject thiz,jlong pCore) { + return linphone_core_get_conference_size((LinphoneCore *) pCore); +} +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" 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" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIEnv *env,jobject thiz,jlong pCore, jstring jFile) { if (jFile) { diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index a6edf1b7..5f874597 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -34,6 +34,14 @@ public interface LinphoneCall { @SuppressWarnings("unchecked") static private Vector values = new Vector(); private final int mValue; + public final int value() {return mValue;} + public static final int ID_INCOMING_RECEIVED=1; + public static final int ID_OUTGOING_RINGING=4; + public static final int ID_STREAMS_RUNNING=7; + public static final int ID_PAUSED=9; + public static final int ID_CALL_END=13; + public static final int ID_PAUSED_BY_REMOTE=14; + private final String mStringValue; /** * Idle @@ -42,7 +50,7 @@ public interface LinphoneCall { /** * Incoming call received. */ - public final static State IncomingReceived = new State(1,"IncomingReceived"); + public final static State IncomingReceived = new State(ID_INCOMING_RECEIVED,"IncomingReceived"); /** * Outgoing call initialiazed. */ @@ -54,7 +62,7 @@ public interface LinphoneCall { /** * Outgoing call ringing. */ - public final static State OutgoingRinging = new State(4,"OutgoingRinging"); + public final static State OutgoingRinging = new State(ID_OUTGOING_RINGING,"OutgoingRinging"); /** * Outgoing call early media */ @@ -66,7 +74,7 @@ public interface LinphoneCall { /** * Streams running */ - public final static State StreamsRunning = new State(7,"StreamsRunning"); + public final static State StreamsRunning = new State(ID_STREAMS_RUNNING,"StreamsRunning"); /** * Paussing */ @@ -74,7 +82,7 @@ public interface LinphoneCall { /** * Paused */ - public final static State Paused = new State(9,"Paused"); + public final static State Paused = new State(ID_PAUSED,"Paused"); /** * Resuming */ @@ -90,12 +98,12 @@ public interface LinphoneCall { /** * Call end */ - public final static State CallEnd = new State(13,"CallEnd"); + public final static State CallEnd = new State(ID_CALL_END,"CallEnd"); /** * Paused by remote */ - public final static State PausedByRemote = new State(14,"PausedByRemote"); + public final static State PausedByRemote = new State(ID_PAUSED_BY_REMOTE,"PausedByRemote"); /** * The call's parameters are updated, used for example when video is asked by remote @@ -219,4 +227,5 @@ public interface LinphoneCall { String getAuthenticationToken(); boolean isAuthenticationTokenVerified(); boolean areStreamsEncrypted(); + boolean isInConference(); } diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 457a7c34..9f4e3d5a 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -594,6 +594,20 @@ public interface LinphoneCore { boolean pauseAllCalls(); void setZrtpSecretsCache(String file); - public void enableEchoLimiter(boolean val); + void enableEchoLimiter(boolean val); + boolean isInConference(); + void enterConference(); + void leaveConference(); + + void addToConference(LinphoneCall call); + void addAllToConference(); + void removeFromConference(LinphoneCall call); + + void terminateConference(); + int getConferenceSize(); + + void terminateAllCalls(); + @SuppressWarnings("unchecked") List getCalls(); + int getCallsNb(); } diff --git a/mediastreamer2 b/mediastreamer2 index 22816808..88baea60 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 22816808514255867ae8fa5347b854f4570784f7 +Subproject commit 88baea6036b1831228cc9deff92acb944e373ce0