]> sjero.net Git - linphone/commitdiff
wrap DSCP API for java
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 19 Apr 2013 13:39:40 +0000 (15:39 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 19 Apr 2013 13:39:40 +0000 (15:39 +0200)
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCore.java
java/impl/org/linphone/core/LinphoneCoreImpl.java

index 5046d83bbdc917cfd3e5b8d9eb66b9dc2732c390..b721c689247bacf88288decdf4a338114fbde52f 100644 (file)
@@ -2143,6 +2143,14 @@ extern "C" jint Java_org_linphone_core_LinphoneCallImpl_getDuration(JNIEnv*  env
        return (jint)linphone_call_get_duration((LinphoneCall *) ptr);
 }
 
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setSipDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){
+       linphone_core_set_sip_dscp((LinphoneCore*)ptr,dscp);
+}
+
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSipDscp(JNIEnv* env,jobject thiz,jlong ptr){
+       return linphone_core_get_sip_dscp((LinphoneCore*)ptr);
+}
+
 extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) {
        LCSipTransports tr;
        linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr);
@@ -2447,6 +2455,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoPortRange(JNIEnv
        linphone_core_set_video_port_range((LinphoneCore *)lc, min_port, max_port);
 }
 
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setAudioDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){
+       linphone_core_set_audio_dscp((LinphoneCore*)ptr,dscp);
+}
+
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getAudioDscp(JNIEnv* env,jobject thiz,jlong ptr){
+       return linphone_core_get_audio_dscp((LinphoneCore*)ptr);
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoDscp(JNIEnv* env,jobject thiz,jlong ptr, jint dscp){
+       linphone_core_set_video_dscp((LinphoneCore*)ptr,dscp);
+}
+
+extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getVideoDscp(JNIEnv* env,jobject thiz,jlong ptr){
+       return linphone_core_get_video_dscp((LinphoneCore*)ptr);
+}
+
 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setIncomingTimeout(JNIEnv *env, jobject thiz, jlong lc, jint timeout) {
        linphone_core_set_inc_timeout((LinphoneCore *)lc, timeout);
 }
index 144b7dfe22308f7995844ff01611b201be3072b3..d76acad9a235d435db1f348f8d2424743899611c 100644 (file)
@@ -637,6 +637,20 @@ public interface LinphoneCore {
         * @return transports used for signaling (TCP, UDP, TLS)
         */
        Transports getSignalingTransportPorts();
+       
+       /**
+        * Assign a dscp value for the SIP socket.
+        * DSCP is an IP packet field used to indicate the type of routing service to routers.
+        * @param dscp
+        */
+       void setSipDscp(int dscp);
+       
+       /**
+        * Get DSCP used for SIP socket.
+        * @return the DSCP value used for the SIP socket.
+        */
+       int getSipDscp();
+       
        /**
         * Activates or deactivates the speaker.
         * @param value
@@ -1146,6 +1160,19 @@ public interface LinphoneCore {
         */
        void setAudioPortRange(int minPort, int maxPort);
        
+       /**
+        * Assign a DSCP value to the audio RTP sockets.
+        * @param dscp the DSCP value.
+        * DSCP is an IP header field used to indicate a type of service to routers.
+        */
+       void setAudioDscp(int dscp);
+       
+       /**
+        * Return DSCP value used for the audio RTP sockets.
+        * @return the DSCP value used for the audio RTP sockets.
+        */
+       int getAudioDscp();
+       
        /**
         * Sets the UDP port used for video streaming.
        **/
@@ -1156,6 +1183,19 @@ public interface LinphoneCore {
         */
        void setVideoPortRange(int minPort, int maxPort);
        
+       /**
+        * Assign a DSCP value to the video RTP sockets.
+        * @param dscp the DSCP value.
+        * DSCP is an IP header field used to indicate a type of service to routers.
+        */
+       void setVideoDscp(int dscp);
+       
+       /**
+        * Return DSCP value used for the video RTP sockets.
+        * @return the DSCP value used for the video RTP sockets.
+        */
+       int getVideoDscp();
+       
        /**
         * Set the incoming call timeout in seconds.
         * If an incoming call isn't answered for this timeout period, it is
index 0b4c984d6afd603d89c54806464eef5df5cad198..f9a7abf39bc7f5a68be5aff9a85b881408083a54 100644 (file)
@@ -913,4 +913,39 @@ class LinphoneCoreImpl implements LinphoneCore {
        public PayloadType findPayloadType(String mime) {
                return findPayloadType(mime, FIND_PAYLOAD_IGNORE_RATE);
        }
+       
+       private native void setSipDscp(long nativePtr, int dscp);
+       @Override
+       public void setSipDscp(int dscp) {
+               setSipDscp(nativePtr,dscp);
+       }
+       
+       private native int getSipDscp(long nativePtr);
+       @Override
+       public int getSipDscp() {
+               return getSipDscp(nativePtr);
+       }
+       private native void setAudioDscp(long nativePtr, int dscp);
+       @Override
+       public void setAudioDscp(int dscp) {
+               setAudioDscp(nativePtr, dscp);
+       }
+       
+       private native int getAudioDscp(long nativePtr);
+       @Override
+       public int getAudioDscp() {
+               return getAudioDscp(nativePtr);
+       }
+       
+       private native void setVideoDscp(long nativePtr, int dscp);
+       @Override
+       public void setVideoDscp(int dscp) {
+               setVideoDscp(nativePtr,dscp);
+       }
+       
+       private native int getVideoDscp(long nativePtr);
+       @Override
+       public int getVideoDscp() {
+               return getVideoDscp(nativePtr);
+       }
 }