]> sjero.net Git - linphone/commitdiff
Merge remote-tracking branch 'private/dev_videoios'
authorJehan Monnier <jehan.monnier@linphone.org>
Mon, 14 Nov 2011 10:10:24 +0000 (11:10 +0100)
committerJehan Monnier <jehan.monnier@linphone.org>
Mon, 14 Nov 2011 10:10:24 +0000 (11:10 +0100)
Conflicts:
mediastreamer2

1  2 
configure.ac
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/private.h
mediastreamer2

diff --combined configure.ac
index 8e42964a1e7230de6bd66980d2cb90c362806318,f99e1dab49d741776281e6776c348135a8f5ba46..568f46b73d1c6e4e705b9c172ff072081e42d977
@@@ -1,6 -1,6 +1,6 @@@
  dnl Process this file with autoconf to produce a configure script.
  
 -AC_INIT([linphone],[3.4.99.2],[linphone-developers@nongnu.org])
 +AC_INIT([linphone],[3.4.99.4],[linphone-developers@nongnu.org])
  AC_CANONICAL_SYSTEM
  AC_CONFIG_SRCDIR([coreapi/linphonecore.c])
  
@@@ -44,7 -44,7 +44,7 @@@ AM_PROG_CC_C_
  AC_CHECK_PROGS(MD5SUM,[md5sum md5])
  AM_CONDITIONAL(HAVE_MD5SUM,test -n $MD5SUM)
  
- case $target_os in
+ case $target in
        *mingw32ce)
                CFLAGS="$CFLAGS -D_WIN32_WCE -DORTP_STATIC -D_WIN32_WINNT=0x0501"
                CXXFLAGS="$CXXFLAGS -DORTP_STATIC -D_WIN32_WINNT=0x0501"
                CONSOLE_FLAGS="-mconsole"
                mingw_found=yes
        ;;
-       *darwin*)
+        armv6-apple-darwin|armv7-apple-darwin|i386-apple-darwin)
+                 CFLAGS="$CFLAGS -DTARGET_OS_IPHONE "
+                 build_tests=no
+                 ios_found=yes
+         ;;
+         x86_64-apple-darwin*|i686-apple-darwin*)
+                 MSPLUGINS_CFLAGS=""
                dnl use macport installation
                ACLOCAL_MACOS_FLAGS="-I /opt/local/share/aclocal"
                build_macos=yes
-       ;;
+         ;;
  esac
  
  AC_SUBST(ACLOCAL_MACOS_FLAGS)
@@@ -74,6 -81,7 +81,7 @@@ AC_SUBST(GUI_FLAGS
  dnl localization tools
  IT_PROG_INTLTOOL([0.40], [no-xml])
  
+ AM_CONDITIONAL(BUILD_TESTS,test x$build_tests != xno)
  dnl Initialize libtool
  LT_INIT([win32-dll shared disable-static])
  
@@@ -364,14 -372,13 +372,14 @@@ AC_ARG_ENABLE(alsa
          *) AC_MSG_ERROR(bad value ${enableval} for --enable-alsa) ;;
        esac],[alsa=true])
  
 -AC_ARG_ENABLE(artsc,
 -      [  --enable-artsc    Turn on artsc (kde) sound input/output (auto) ],
 +AC_ARG_ENABLE(zrtp,
 +      [  --enable-zrtp    Turn on zrtp support - UNFINISHED],
        [case "${enableval}" in
 -        yes) artsc=true ;;
 -        no)  artsc=false ;;
 -        *) AC_MSG_ERROR(bad value ${enableval} for --enable-artsc) ;;
 -      esac],[artsc=false])
 +        yes) zrtp=true ;;
 +        no)  zrtp=false ;;
 +        *) AC_MSG_ERROR(bad value ${enableval} for --enable-zrtp) ;;
 +      esac],[zrtp=false])
 +
  
  AC_ARG_ENABLE(portaudio,
        [  --enable-portaudio    Turn on portaudio native support compiling],
@@@ -388,7 -395,6 +396,7 @@@ AM_CONDITIONAL(ARMBUILD, test x$use_arm
  dnl compilation of gtk user interface
  AM_CONDITIONAL(BUILD_GTK_UI, [test x$gtk_ui = xtrue ] )
  AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes )
 +AM_CONDITIONAL(BUILD_ZRTP, test x$zrtp = xtrue)
  
  dnl check getenv
  AH_TEMPLATE([HAVE_GETENV])
diff --combined coreapi/linphonecore.c
index a13e3921dce0b1269a85da4a95996bc97f36231c,49dad24ff7fbf35c37027c6eaa3cb61eaffbc616..2106e6c51873fbb5919b58b03f5504cc1f400f79
@@@ -23,7 -23,6 +23,7 @@@ Foundation, Inc., 59 Temple Place - Sui
  #include "private.h"
  
  #include <ortp/telephonyevents.h>
 +#include <ortp/zrtp.h>
  #include "mediastreamer2/mediastream.h"
  #include "mediastreamer2/mseventqueue.h"
  #include "mediastreamer2/msvolume.h"
  #endif
  #endif
  
 +#ifdef HAVE_CONFIG_H
 +#include "config.h"
 +#endif
 +
  /*#define UNSTANDART_GSM_11K 1*/
  
  #define ROOT_CA_FILE PACKAGE_DATA_DIR "/linphone/rootca.pem"
@@@ -528,7 -523,7 +528,7 @@@ static void sip_config_read(LinphoneCor
  #else
        sal_root_ca(lc->sal, lp_config_get_string(lc->config,"sip","root_ca", ROOT_CA_FILE));
  #endif
 -
 +      
        tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
        linphone_core_set_guess_hostname(lc,tmp);
  
                        break;
                }
        }
 +      /*this is to filter out unsupported encryption schemes*/
 +      linphone_core_set_media_encryption(lc,linphone_core_get_media_encryption(lc));
  
        /*for tuning or test*/
        lc->sip_conf.sdp_200_ack=lp_config_get_int(lc->config,"sip","sdp_200_ack",0);
@@@ -3552,7 -3545,12 +3552,12 @@@ void linphone_core_set_native_preview_w
  void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno){
        lc->use_preview_window=yesno;
  }
+ /**
+  *returns current device orientation
+  */
+ int linphone_core_get_device_rotation(LinphoneCore *lc ) {
+       return lc->device_rotation;
+ }
  /**
   * Tells the core the device current orientation. This can be used by capture filters
   * on mobile devices to select between portrait/landscape mode and to produce properly
@@@ -3584,6 -3582,7 +3589,7 @@@ static MSVideoSizeDef supported_resolut
        {       {MS_VIDEO_SIZE_QVGA_H,MS_VIDEO_SIZE_QVGA_W}     ,       "qvga-portrait" },
        {       {MS_VIDEO_SIZE_QCIF_W,MS_VIDEO_SIZE_QCIF_H}     ,       "qcif"  },
        {       {MS_VIDEO_SIZE_QCIF_H,MS_VIDEO_SIZE_QCIF_W}     ,       "qcif-portrait" },
+       {       {MS_VIDEO_SIZE_IOS_MEDIUM_H,MS_VIDEO_SIZE_IOS_MEDIUM_W} ,       "ios-medium"    },      
        {       {0,0}                   ,       NULL    }
  };
  
@@@ -4267,7 -4266,7 +4273,7 @@@ LinphoneGlobalState linphone_core_get_g
  
  LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc){
        LinphoneCallParams *p=ms_new0(LinphoneCallParams,1);
 -      p->has_video=linphone_core_video_enabled(lc);
 +      linphone_core_init_default_params(lc, p);
        return p;
  }
  
@@@ -4318,9 -4317,7 +4324,9 @@@ void linphone_core_stop_dtmf_stream(Lin
  int linphone_core_get_max_calls(LinphoneCore *lc) {
        return lc->max_calls;
  }
 -
 +void linphone_core_set_max_calls(LinphoneCore *lc, int max) {
 +      lc->max_calls=max;
 +}
  
  typedef struct Hook{
        LinphoneCoreIterateHook fun;
@@@ -4372,6 -4369,7 +4378,6 @@@ void linphone_core_set_zrtp_secrets_fil
        lc->zrtp_secrets_cache=file ? ms_strdup(file) : NULL;
  }
  
 -//                            if (stringUri.equals(call.getRemoteAddress().asStringUriOnly())) {
  const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri) {
        if (uri == NULL) return NULL;
        MSList *calls=lc->calls;
        }
        return NULL;
  }
 +
 +
 +/**
 + * Check if a call will need the sound resources.
 + *
 + * @ingroup call_control
 + * @param lc The LinphoneCore
 +**/
 +bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){
 +      MSList *calls=lc->calls;
 +      while(calls) {
 +              LinphoneCall *c=(LinphoneCall*)calls->data;
 +              calls=calls->next;
 +              switch (c->state) {
 +                      case LinphoneCallOutgoingInit:
 +                      case LinphoneCallOutgoingProgress:
 +                      case LinphoneCallOutgoingRinging:
 +                      case LinphoneCallOutgoingEarlyMedia:
 +                      case LinphoneCallConnected:
 +                      case LinphoneCallRefered:
 +                      case LinphoneCallIncomingEarlyMedia:
 +                      case LinphoneCallUpdated:
 +                              return TRUE;
 +                      default:
 +                              break;
 +              }
 +      }
 +      return FALSE;
 +}
 +
 +void linphone_core_set_srtp_enabled(LinphoneCore *lc, bool_t enabled) {
 +      lp_config_set_int(lc->config,"sip","srtp",(int)enabled);
 +}
 +
 +/**
 + * Returns whether a media encryption scheme is supported by the LinphoneCore engine
 +**/
 +bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, LinphoneMediaEncryption menc){
 +      switch(menc){
 +              case LinphoneMediaEncryptionSRTP:
 +                      return ortp_srtp_supported();
 +              case LinphoneMediaEncryptionZRTP:
 +                      return ortp_zrtp_available();
 +              case LinphoneMediaEncryptionNone:
 +                      return TRUE;
 +      }
 +      return FALSE;
 +}
 +
 +int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMediaEncryption menc) {
 +      const char *type="none";
 +      int ret=0;
 +      if (menc == LinphoneMediaEncryptionSRTP){
 +              if (!ortp_srtp_supported()){
 +                      ms_warning("SRTP not supported by library.");
 +                      type="none";
 +                      ret=-1;
 +              }else type="srtp";
 +      }else if (menc == LinphoneMediaEncryptionZRTP){
 +              if (!ortp_zrtp_available()){
 +                      ms_warning("ZRTP not supported by library.");
 +                      type="none";
 +                      ret=-1;
 +              }else type="zrtp";
 +      }
 +      lp_config_set_string(lc->config,"sip","media_encryption",type);
 +      return ret;
 +}
 +
 +LinphoneMediaEncryption linphone_core_get_media_encryption(LinphoneCore *lc) {
 +      const char* menc = lp_config_get_string(lc->config, "sip", "media_encryption", NULL);
 +      
 +      if (menc == NULL)
 +              return LinphoneMediaEncryptionNone;
 +      else if (strcmp(menc, "srtp")==0)
 +              return LinphoneMediaEncryptionSRTP;
 +      else if (strcmp(menc, "zrtp")==0)
 +              return LinphoneMediaEncryptionZRTP;
 +      else
 +              return LinphoneMediaEncryptionNone;
 +}
 +
 +bool_t linphone_core_is_media_encryption_mandatory(LinphoneCore *lc) {
 +      return (bool_t)lp_config_get_int(lc->config, "sip", "media_encryption_mandatory", 0);
 +}
 +
 +void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m) {
 +      lp_config_set_int(lc->config, "sip", "media_encryption_mandatory", (int)m);
 +}
 +
 +void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params) {
 +      params->has_video=linphone_core_video_enabled(lc);
 +      params->media_encryption=linphone_core_get_media_encryption(lc);        
 +      params->in_conference=FALSE;
 +}
 +
diff --combined coreapi/linphonecore.h
index f6da27f9db851006ef12095b257dc9583003cc2e,d99ddb7732ad2a90359cbddd16b646608bde1a02..01353a3cae1dae963fe05c11587f38e8270b9c9f
@@@ -156,13 -156,7 +156,13 @@@ typedef struct _LinphoneCallLog
        struct _LinphoneCore *lc;
  } LinphoneCallLog;
  
 +enum LinphoneMediaEncryption {
 +      LinphoneMediaEncryptionNone,
 +      LinphoneMediaEncryptionSRTP,
 +      LinphoneMediaEncryptionZRTP
 +};
  
 +typedef enum LinphoneMediaEncryption LinphoneMediaEncryption;
  
  /*public: */
  void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
@@@ -185,8 -179,6 +185,8 @@@ typedef struct _LinphoneCallParams Linp
  LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
  void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
  bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
 +LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp);
 +void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, LinphoneMediaEncryption e);
  void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled);
  bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp);
  bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
@@@ -267,10 -259,6 +267,10 @@@ float linphone_call_get_play_volume(Lin
  float linphone_call_get_record_volume(LinphoneCall *call);
  float linphone_call_get_current_quality(LinphoneCall *call);
  float linphone_call_get_average_quality(LinphoneCall *call);
 +const char* linphone_call_get_authentication_token(LinphoneCall *call);
 +bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
 +void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t verified);
 +void linphone_call_send_vfu_request(LinphoneCall *call);
  void *linphone_call_get_user_pointer(LinphoneCall *call);
  void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
  /**
@@@ -947,6 -935,7 +947,7 @@@ unsigned long linphone_core_get_native_
  void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id);
  
  void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno);
+ int linphone_core_get_device_rotation(LinphoneCore *lc );
  void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation);
  
  /*play/record support: use files instead of soundcard*/
@@@ -1019,9 -1008,15 +1020,9 @@@ LinphoneGlobalState linphone_core_get_g
   */
  void linphone_core_refresh_registers(LinphoneCore* lc);
  
 -
 -void linphone_call_send_vfu_request(LinphoneCall *call);
 -
  /* Path to the file storing secrets cache */
  void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file);
  
 -bool_t linphone_call_are_all_streams_encrypted(LinphoneCall *call);
 -const char* linphone_call_get_authentication_token(LinphoneCall *call);
 -bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
  
  const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri);
  
@@@ -1037,29 -1032,6 +1038,29 @@@ int linphone_core_terminate_conference(
  int linphone_core_get_conference_size(LinphoneCore *lc);
  
  int linphone_core_get_max_calls(LinphoneCore *lc);
 +void linphone_core_set_max_calls(LinphoneCore *lc, int max);
 +
 +bool_t linphone_core_sound_resources_locked(LinphoneCore *lc);
 +
 +bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, LinphoneMediaEncryption menc);
 +
 +/**
 + * Choose media encryption policy to be used for RTP packets
 + */
 +int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMediaEncryption menc);
 +LinphoneMediaEncryption linphone_core_get_media_encryption(LinphoneCore *lc);
 +
 +bool_t linphone_core_is_media_encryption_mandatory(LinphoneCore *lc);
 +/**
 + * Defines Linphone behaviour when encryption parameters negociation fails on outoing call.
 + * If set to TRUE call will fail; if set to FALSE will resend an INVITE with encryption disabled
 + */
 +void linphone_core_set_media_encryption_mandatory(LinphoneCore *lc, bool_t m);
 +
 +/**
 + * Init call params using LinphoneCore's current configuration
 + */
 +void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params);
  
  #ifdef __cplusplus
  }
diff --combined coreapi/private.h
index bd04c82bb36f0e92e39ad3c7a8858655253093e7,f90f27bf21ae628c893ff5eb212e31dda71009c5..657cd47fd43e2ecec00736a728cc3c950f558442
  #define PACKAGE_SOUND_DIR "."
  #endif
  
+ #ifndef PACKAGE_DATA_DIR
+ #define PACKAGE_DATA_DIR "."
+ #endif
  #ifdef HAVE_GETTEXT
  #include <libintl.h>
  #ifndef _
  #endif
  #endif
  
 -
  struct _LinphoneCallParams{
        LinphoneCall *referer; /*in case this call creation is consecutive to an incoming transfer, this points to the original call */
        int audio_bw; /* bandwidth limit for audio stream */
 +      LinphoneMediaEncryption media_encryption;
        bool_t has_video;
        bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/
        bool_t in_conference; /*in conference mode */
        bool_t pad;
 +      
  };
  
  struct _LinphoneCall
diff --combined mediastreamer2
index fb45658a172fa53f0fd722b0660cc9b8c4396752,7e80b7c99175ff4165814eaa90d13a7b1bd7a869..4ee916b3fcae0aba38a0d595079298242c9ac2cd
@@@ -1,1 -1,1 +1,1 @@@
- Subproject commit fb45658a172fa53f0fd722b0660cc9b8c4396752
 -Subproject commit 7e80b7c99175ff4165814eaa90d13a7b1bd7a869
++Subproject commit 4ee916b3fcae0aba38a0d595079298242c9ac2cd