From 9d547808651d3a4f1272da69a3e11afd4c4fd171 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 4 Aug 2014 14:28:40 +0200 Subject: [PATCH] Add jni for adaptive rate control --- coreapi/linphonecore_jni.cc | 14 ++++++++++++++ java/common/org/linphone/core/LinphoneCore.java | 12 ++++++++++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 11 +++++++++++ 3 files changed, 37 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 1f01ccadf..fc6b76f1f 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1287,6 +1287,20 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getPayloadTypeBitrate(JN return (jint)linphone_core_get_payload_type_bitrate((LinphoneCore*)lc,(PayloadType*)pt); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableAdaptiveRateControl(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jboolean enable) { + linphone_core_enable_adaptive_rate_control((LinphoneCore*)lc, enable); +} + +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isAdaptiveRateControlEnabled(JNIEnv* env + ,jobject thiz + ,jlong lc + ) { + return (jboolean)linphone_core_adaptive_rate_control_enabled((LinphoneCore*)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env ,jobject thiz ,jlong lc diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 332a85be0..a74ebc125 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -707,6 +707,18 @@ public interface LinphoneCore { */ int getPayloadTypeBitrate(PayloadType pt); + /** + * Enable adaptive rate control. + * @param enable + */ + void enableAdaptiveRateControl(boolean enable); + + /** + * Enables or disable adaptive rate control. + * @return true if adaptive rate control is enabled. + */ + boolean isAdaptiveRateControlEnabled(); + /** * Enables or disable echo cancellation. * @param enable diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index eeebbd328..04a679f1a 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -73,6 +73,8 @@ class LinphoneCoreImpl implements LinphoneCore { private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels); private native int enablePayloadType(long nativePtr, long payloadType, boolean enable); private native boolean isPayloadTypeEnabled(long nativePtr, long payloadType); + private native void enableAdaptiveRateControl(long nativePtr,boolean enable); + private native boolean isAdaptiveRateControlEnabled(long nativePtr); private native void enableEchoCancellation(long nativePtr,boolean enable); private native boolean isEchoCancellationEnabled(long nativePtr); private native Object getCurrentCall(long nativePtr) ; @@ -1190,5 +1192,14 @@ class LinphoneCoreImpl implements LinphoneCore { public synchronized int getPayloadTypeBitrate(PayloadType pt) { return getPayloadTypeBitrate(nativePtr, ((PayloadTypeImpl)pt).nativePtr); } + @Override + public void enableAdaptiveRateControl(boolean enable) { + enableAdaptiveRateControl(nativePtr,enable); + + } + @Override + public boolean isAdaptiveRateControlEnabled() { + return isAdaptiveRateControlEnabled(nativePtr); + } }