From 7cddd40cd151acf19dcf56022c635c096d96ef0a Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 8 Jan 2013 10:43:48 +0100 Subject: [PATCH] Add JNI to get lowBandwidthMode value --- coreapi/linphonecore_jni.cc | 3 +++ java/common/org/linphone/core/LinphoneCallParams.java | 7 +++++++ java/impl/org/linphone/core/LinphoneCallParamsImpl.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 5ed0b907f..a6a561c86 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1792,6 +1792,9 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv } //CallParams +extern "C" jboolean Java_org_linphone_core_LinphoneCallParamsImpl_isLowBandwidthEnabled(JNIEnv *env, jobject thiz, jlong cp) { + return (jboolean) linphone_call_params_low_bandwidth_enabled((LinphoneCallParams *)cp); +} extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_enableLowBandwidth(JNIEnv *env, jobject thiz, jlong cp, jboolean enable) { linphone_call_params_enable_low_bandwidth((LinphoneCallParams *)cp, enable); diff --git a/java/common/org/linphone/core/LinphoneCallParams.java b/java/common/org/linphone/core/LinphoneCallParams.java index 730a99dc2..f8c7c097f 100644 --- a/java/common/org/linphone/core/LinphoneCallParams.java +++ b/java/common/org/linphone/core/LinphoneCallParams.java @@ -65,4 +65,11 @@ public interface LinphoneCallParams { * that it is achievable by the codec selected after SDP handshake. Video is automatically disabled. **/ void enableLowBandwidth(boolean enable); + + /** + * Use to know if this call has been configured in low bandwidth mode. + *
When enabled, this param may transform a call request with video in audio only mode. + * @return true if low bandwidth has been configured/detected + */ + boolean isLowBandwidthEnabled(); } diff --git a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java index be3495a8d..b2ae4fe66 100644 --- a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java @@ -36,6 +36,7 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams { private native long getUsedVideoCodec(long nativePtr); private native void destroy(long nativePtr); private native void enableLowBandwidth(long nativePtr, boolean enable); + private native void isLowBandwidthEnabled(long nativePtr); public boolean getVideoEnabled() { return getVideoEnabled(nativePtr); @@ -83,4 +84,8 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams { public void enableLowBandwidth(boolean enable) { enableLowBandwidth(nativePtr, enable); } + + public boolean isLowBandwidthEnabled() { + return isLowBandwidthEnabled(nativePtr); + } }