From eb58fc9848f35769b9c5faa65004eea5a006aef5 Mon Sep 17 00:00:00 2001 From: Guillaume Beraudo Date: Thu, 25 Nov 2010 11:48:29 +0100 Subject: [PATCH] Added access to call parameters and updating call to allow video reinvite. --- coreapi/linphonecore_jni.cc | 27 ++++++++++++++++ .../org/linphone/core/LinphoneCall.java | 5 +++ .../org/linphone/core/LinphoneCallParams.java | 32 +++++++++++++++++++ .../org/linphone/core/LinphoneCore.java | 7 ++++ 4 files changed, 71 insertions(+) create mode 100644 java/common/org/linphone/core/LinphoneCallParams.java diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 50444077c..3ed73fd4c 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -973,5 +973,32 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv return jvalue; } +extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableVideo(JNIEnv *env, jobject thiz, jlong lcp, jboolean b){ + linphone_call_params_enable_video((LinphoneCallParams*)lcp, b); +} +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" jlong Java_org_linphone_core_LinphoneCallParamsImpl_copy(JNIEnv *env, jobject thiz, jlong lcp){ + return (jlong) linphone_call_params_copy((LinphoneCallParams*)lcp); +} +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_createDefaultCallParams(JNIEnv *env, jobject thiz, jlong lc){ + return (jlong) linphone_core_create_default_call_parameters((LinphoneCore*)lc); +} +extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getCurrentParams(JNIEnv *env, jobject thiz, jlong lc){ + return (jlong) linphone_call_get_current_params((LinphoneCall*)lc); +} + +extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_inviteAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong addr, jlong params){ + return (jlong) linphone_core_invite_address_with_params((LinphoneCore *)lc, (const LinphoneAddress *)addr, (const LinphoneCallParams *)params); +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateAddressWithParams(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){ + return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params); +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env, jobject thiz, jlong lc, jlong call, jlong params){ + return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (LinphoneCallParams *)params); +} \ No newline at end of file diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 65923706c..840a5fa99 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -132,4 +132,9 @@ public interface LinphoneCall { **/ public LinphoneCallLog getCallLog(); + /** + * @return parameters for this call; read only, call copy() to get a read/write version. + */ + public LinphoneCallParams getCurrentParamsReadOnly(); + } diff --git a/java/common/org/linphone/core/LinphoneCallParams.java b/java/common/org/linphone/core/LinphoneCallParams.java new file mode 100644 index 000000000..2b903b9ec --- /dev/null +++ b/java/common/org/linphone/core/LinphoneCallParams.java @@ -0,0 +1,32 @@ +/* +LinphoneCallParameters.java +Copyright (C) 2010 Belledonne Communications, Grenoble, France + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +package org.linphone.core; + +/** + * The LinphoneCallParams is an object containing various call related parameters. + * It can be used to retrieve parameters from a currently running call or modify the call's characteristics + * dynamically. + * @author Guillaume Beraudo + * + */ +public interface LinphoneCallParams { + void setVideoEnalbled(boolean b); + boolean getVideoEnabled(); + LinphoneCallParams copy(); +} diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 0c8c0afeb..94705b49d 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -454,4 +454,11 @@ public interface LinphoneCore { * @return previously set firewall policy. */ public FirewallPolicy getFirewallPolicy(); + + public LinphoneCall inviteAddressWithParams(LinphoneAddress destination, LinphoneCallParams params) throws LinphoneCoreException ; + + public int updateCall(LinphoneCall call, LinphoneCallParams params); + + public LinphoneCallParams createDefaultCallParameters(); + }