]> sjero.net Git - linphone/commitdiff
Add JNI glue to enable/disable low bandwidth param in call
authorSylvain Berfini <sylvain.berfini@belledonne-communications.com>
Tue, 11 Dec 2012 09:59:40 +0000 (10:59 +0100)
committerSylvain Berfini <sylvain.berfini@belledonne-communications.com>
Tue, 11 Dec 2012 09:59:40 +0000 (10:59 +0100)
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCallParams.java
java/impl/org/linphone/core/LinphoneCallParamsImpl.java

index 06188f411a864e113072fb237e42fe9db200dcf1..d5835fe34c5560a3fdf5763070ff1a739407510b 100644 (file)
@@ -1774,6 +1774,10 @@ extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv
 
 //CallParams
 
+extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableLowBandwidth(JNIEnv *env, jobject thiz, jlong cp, jboolean enable) {
+       linphone_call_params_enable_low_bandwidth((LinphoneCallParams *)cp, enable);
+}
+
 extern "C" jlong Java_org_linphone_core_LinphoneCallParamsImpl_getUsedAudioCodec(JNIEnv *env, jobject thiz, jlong cp) {
        return (jlong)linphone_call_params_get_used_audio_codec((LinphoneCallParams *)cp);
 }
@@ -1851,7 +1855,6 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_updateCall(JNIEnv *env,
        return (jint) linphone_core_update_call((LinphoneCore *)lc, (LinphoneCall *)call, (const LinphoneCallParams *)params);
 }
 
-
 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc, jint width, jint height){
        MSVideoSize vsize;
        vsize.width = (int)width;
index 2dd497c9c346f4cf511a6d1448181ee24c3b0cdb..730a99dc2c8fe430d5ffef38eda721cb45fa8142 100644 (file)
@@ -57,4 +57,12 @@ public interface LinphoneCallParams {
         * @return PayloadType or null
         */
        PayloadType getUsedVideoCodec();
+       
+       /**
+        * Indicate low bandwith mode. 
+        * Configuring a call to low bandwidth mode will result in the core to activate several settings for the call in order to ensure that bitrate usage
+        * is lowered to the minimum possible. Typically, ptime (packetization time) will be increased, audio codec's output bitrate will be targetted to 20kbit/s provided
+        * that it is achievable by the codec selected after SDP handshake. Video is automatically disabled.
+       **/
+       void enableLowBandwidth(boolean enable);
 }
index 3c4514017b268ee8363d4e2cc746ed194efc47cf..be3495a8dda6cdfcd2afc1058013feb642d7fc49 100644 (file)
@@ -35,7 +35,7 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams {
        private native long getUsedAudioCodec(long nativePtr);
        private native long getUsedVideoCodec(long nativePtr);
        private native void destroy(long nativePtr);
-       
+       private native void enableLowBandwidth(long nativePtr, boolean enable);
        
        public boolean getVideoEnabled() {
                return getVideoEnabled(nativePtr);
@@ -79,4 +79,8 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams {
        public boolean localConferenceMode() {
                return localConferenceMode(nativePtr);
        }
+       
+       public void enableLowBandwidth(boolean enable) {
+               enableLowBandwidth(nativePtr, enable);
+       }
 }