]> sjero.net Git - linphone/commitdiff
Merge commit '2e953b4'
authorGuillaume Beraudo <guillaume.beraudo@linphone.org>
Mon, 13 Dec 2010 14:08:31 +0000 (15:08 +0100)
committerGuillaume Beraudo <guillaume.beraudo@linphone.org>
Mon, 13 Dec 2010 14:08:31 +0000 (15:08 +0100)
Conflicts:
coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java
coreapi/linphonecore_jni.cc

1  2 
coreapi/help/java/org/linphone/core/tutorials/TutorialRegistration.java
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneProxyConfig.java

index 3f03081e91aac42fabb66555482a1128cc8f97e8,7ca24bbf02a1a8b8d67e7fbd5252b3177be36cfa..49689ba32b9aa0d448f2cfda19d458e6c36fddf2
@@@ -160,17 -152,13 +152,12 @@@ public class TutorialRegistration imple
                        lc.getDefaultProxyConfig().enableRegister(true);
                        lc.getDefaultProxyConfig().done();
  
-                       for (int i = 0; i < 20; i++) {
+                       while(lc.getDefaultProxyConfig().getState() != RegistrationState.RegistrationOk
+                                       && lc.getDefaultProxyConfig().getState() != RegistrationState.RegistrationFailed) {
                                lc.iterate();
-                               try{
-                                       Thread.sleep(50);
-                               } catch(InterruptedException ie) {
-                                       write("Interrupted!\nAborting");
-                                       return;
-                               }
+                               sleep(50);
                        }
  
-                       
 -
                        // Automatic unregistration on exit
                } finally {
                        write("Shutting down linphone...");
index 4128a0fd3d51dcddeea6147786d3eca5c841faaf,3a9346999fa5e514d422323e111936e8ef4f6c62..64c5997d6d2ff15d548e7af986b7c4203b0bddc5
@@@ -993,95 -924,10 +993,102 @@@ extern "C" void Java_org_linphone_core_
  
  }
  
++<<<<<<< HEAD
 +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setVideoWindowId(JNIEnv* env
 +                                                                                                                                              ,jobject thiz
 +                                                                                                                                              ,jlong lc
 +                                                                                                                                              ,jobject obj) {
 +      linphone_core_set_native_video_window_id((LinphoneCore*)lc,(unsigned long)obj);
 +}
 +
 +
 +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc, int enum_value){
 +      linphone_core_set_firewall_policy((LinphoneCore*)lc,(LinphoneFirewallPolicy)enum_value);
 +}
 +
 +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getFirewallPolicy(JNIEnv *env, jobject thiz, jlong lc){
 +      return linphone_core_get_firewall_policy((LinphoneCore*)lc);
 +}
 +
 +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setStunServer(JNIEnv *env, jobject thiz, jlong lc, jstring jserver){
 +      const char* server = NULL;
 +      if (jserver) server=env->GetStringUTFChars(jserver, NULL);
 +      linphone_core_set_stun_server((LinphoneCore*)lc,server);
 +      if (server) env->ReleaseStringUTFChars(jserver,server);
 +}
 +
 +extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getStunServer(JNIEnv *env, jobject thiz, jlong lc){
 +      const char *ret= linphone_core_get_stun_server((LinphoneCore*)lc);
 +      if (ret==NULL) return NULL;
 +      jstring jvalue =env->NewStringUTF(ret);
 +      return jvalue;
 +}
 +
 +extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_audioBandwidth(JNIEnv *env, jobject thiz, jlong lcp, jint bw){
 +      linphone_call_params_set_audio_bandwidth_limit((LinphoneCallParams*)lcp, bw);
 +}
 +
 +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" void Java_org_linphone_core_LinphoneCallParamsImpl_destroy(JNIEnv *env, jobject thiz, jlong lc){
 +      return linphone_call_params_destroy((LinphoneCallParams*)lc);
 +}
 +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_getCurrentParamsCopy(JNIEnv *env, jobject thiz, jlong lc){
 +      return (jlong) linphone_call_params_copy(linphone_call_get_current_params((LinphoneCall*)lc));
 +}
 +
 +extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_enableCamera(JNIEnv *env, jobject thiz, jlong lc, jboolean b){
 +      linphone_call_enable_camera((LinphoneCall *)lc, (bool_t) b);
 +}
 +
 +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, (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;
 +      vsize.height = (int)height;
 +      linphone_core_set_preferred_video_size((LinphoneCore *)lc, vsize);
 +}
 +
 +extern "C" jintArray Java_org_linphone_core_LinphoneCoreImpl_getPreferredVideoSize(JNIEnv *env, jobject thiz, jlong lc){
 +      MSVideoSize vsize = linphone_core_get_preferred_video_size((LinphoneCore *)lc);
 +    jintArray arr = env->NewIntArray(2);
 +      int tVsize [2]= {vsize.width,vsize.height};
 +    env->SetIntArrayRegion(arr, 0, 2, tVsize);
 +    return arr;
 +}
 +
 +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setDownloadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
 +      linphone_core_set_download_bandwidth((LinphoneCore *)lc, (int) bw);
 +}
 +
 +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setUploadBandwidth(JNIEnv *env, jobject thiz, jlong lc, jint bw){
 +      linphone_core_set_upload_bandwidth((LinphoneCore *)lc, (int) bw);
++
+ extern "C" int Java_org_linphone_core_LinphoneProxyConfigImpl_getState(JNIEnv*  env,jobject thiz,jlong ptr) {
+       return (int) linphone_proxy_config_get_state((const LinphoneProxyConfig *) ptr);
+ }
+ extern "C" void Java_org_linphone_core_LinphoneProxyConfigImpl_setExpires(JNIEnv*  env,jobject thiz,jlong ptr,jint delay) {
+       linphone_proxy_config_expires((LinphoneProxyConfig *) ptr, (int) delay);
  }
  
index 441ad51cfc12d1ec061777c09e6dfdf6cbf9847b,31444827582781d3fbfe296e36596cbad683b3e5..666fa75a41f209859c195d96eb0978d43ddec75f
@@@ -112,18 -112,12 +112,25 @@@ public interface LinphoneProxyConfig 
         * @return  the route set for this proxy configuration.
         */
        public String getRoute();
 +      /**
 +       * Indicates  either or not, PUBLISH must be issued for this #LinphoneProxyConfig .
 +       * <br> In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule.
 +       * @param obj object pointer
 +       * @param val if true, publish will be engaged
 +       *
 +       */
 +      public void enablePublish(boolean enable);
 +      /**
 +       * returns publish state for this proxy config (see {@link #enablePublish(boolean)} )
 +       */
 +      public boolean publishEnabled();
 +      
        
+       LinphoneCore.RegistrationState getState();
+       
+       /**
+        * Sets the registration expiration time.
+        * @param delay expiration time in seconds
+        */
+       void setExpires(int delay);
  }