From fb4301fea3d8bee70652144d9148c39b90337f75 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Thu, 9 May 2013 22:49:25 +0200 Subject: [PATCH 01/14] AAC-ELD: fix SDP/ftmp content according to new recommendation from Fraunhofer --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index ca42ee87d..12a3d7951 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit ca42ee87ded3fa4cbf44757f13e2f5537afbb498 +Subproject commit 12a3d795131ab1b367ae000f8b70f9b8af684df6 From bd5fccb963382580ae1ad8efebc36ffe275aa2c7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Wed, 22 May 2013 16:13:35 +0200 Subject: [PATCH 02/14] update libvpx to v1.2.0 --- Classes/ContactDetailsTableViewController.m | 2 +- .../LinphoneUI/UICompositeViewController.m | 12 ++-- linphone.xcodeproj/project.pbxproj | 32 ++++++++-- submodules/build/builders.d/libvpx.mk | 7 ++- submodules/build/builders.d/libvpx.patch | 59 ++----------------- submodules/build/iphone-config.site | 8 +-- submodules/externals/libvpx | 2 +- 7 files changed, 51 insertions(+), 71 deletions(-) diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 8f49fd838..7fe664112 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -537,7 +537,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C NSMutableArray *sectionDict = [self getSectionData:[indexPath section]]; Entry *entry = [sectionDict objectAtIndex:[indexPath row]]; if (![self isEditing]) { - NSString *dest; + NSString *dest=NULL;; if(contactSections[[indexPath section]] == ContactSections_Number) { ABMultiValueRef lMap = ABRecordCopyValue(contact, kABPersonPhoneProperty); int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); diff --git a/Classes/LinphoneUI/UICompositeViewController.m b/Classes/LinphoneUI/UICompositeViewController.m index aa7237646..7a1913db0 100644 --- a/Classes/LinphoneUI/UICompositeViewController.m +++ b/Classes/LinphoneUI/UICompositeViewController.m @@ -103,7 +103,7 @@ - (void)initUICompositeViewController { viewControllerCache = [[NSMutableDictionary alloc] init]; - currentOrientation = UIDeviceOrientationUnknown; + currentOrientation = (UIInterfaceOrientation)UIDeviceOrientationUnknown; } - (id)init{ @@ -416,18 +416,18 @@ if(currentOrientation == UIDeviceOrientationUnknown) { return [UIApplication sharedApplication].statusBarOrientation; } - deviceOrientation = currentOrientation; + deviceOrientation = (UIDeviceOrientation)currentOrientation; } if (UIDeviceOrientationIsPortrait(deviceOrientation)) { if ([currentViewDescription portraitMode]) { - return deviceOrientation; + return (UIInterfaceOrientation)deviceOrientation; } else { return UIInterfaceOrientationLandscapeLeft; } } if (UIDeviceOrientationIsLandscape(deviceOrientation)) { if ([currentViewDescription landscapeMode]) { - return deviceOrientation; + return (UIInterfaceOrientation)deviceOrientation; } else { return UIInterfaceOrientationPortrait; } @@ -435,7 +435,7 @@ } else if([rotationPreference isEqualToString:@"portrait"]) { if ([currentViewDescription portraitMode]) { if (UIDeviceOrientationIsPortrait(deviceOrientation)) { - return deviceOrientation; + return (UIInterfaceOrientation)deviceOrientation; } else { if(UIInterfaceOrientationIsPortrait([UIApplication sharedApplication].statusBarOrientation)) { return [UIApplication sharedApplication].statusBarOrientation; @@ -449,7 +449,7 @@ } else if([rotationPreference isEqualToString:@"landscape"]) { if ([currentViewDescription landscapeMode]) { if (UIDeviceOrientationIsLandscape(deviceOrientation)) { - return deviceOrientation; + return (UIInterfaceOrientation)deviceOrientation; } else { if(UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) { return [UIApplication sharedApplication].statusBarOrientation; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 28efeaf74..8f5029539 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -75,6 +75,8 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; + 2200C2DB174BB87A002E9A70 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22405EED1600B4E400B92522 /* AssetsLibrary.framework */; }; + 2200C2DC174BBB24002E9A70 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 226EF06B15FA256B005865C7 /* MobileCoreServices.framework */; }; 22058C71116E305000B08DDD /* linphone_icon_57.png in Resources */ = {isa = PBXBuildFile; fileRef = 22058C70116E305000B08DDD /* linphone_icon_57.png */; }; 220FAD3110765B400068D98F /* libeXosip2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2810765B400068D98F /* libeXosip2.a */; }; 220FAD3210765B400068D98F /* libgsm.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 220FAD2910765B400068D98F /* libgsm.a */; }; @@ -2481,6 +2483,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 2200C2DC174BBB24002E9A70 /* MobileCoreServices.framework in Frameworks */, + 2200C2DB174BB87A002E9A70 /* AssetsLibrary.framework in Frameworks */, D30562131671DC3E00C97967 /* libNinePatch.a in Frameworks */, D30562141671DC3E00C97967 /* libXMLRPC.a in Frameworks */, 22D8F170147548E2008C97DB /* AVFoundation.framework in Frameworks */, @@ -3800,7 +3804,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0450; + LastUpgradeCheck = 0460; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "linphone" */; compatibilityVersion = "Xcode 3.2"; @@ -5494,15 +5498,20 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: jehan monnier"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; LIBRARY_SEARCH_PATHS = ""; - PROVISIONING_PROFILE = "7763350E-083E-4ADA-8535-05883F19F947"; + PROVISIONING_PROFILE = "BB7E624F-8CD6-448B-A235-CE8DBB401F92"; SDKROOT = iphoneos; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; TARGETED_DEVICE_FAMILY = "1,2"; @@ -5732,10 +5741,15 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Developer"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; @@ -5798,10 +5812,15 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; CODE_SIGN_IDENTITY = "iPhone Distribution: jehan monnier"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; @@ -5865,15 +5884,20 @@ isa = XCBuildConfiguration; buildSettings = { ARCHS = "$(ARCHS_STANDARD_32_BIT)"; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer: jehan monnier (E8MYPN2NXL)"; GCC_THUMB_SUPPORT = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ""; IPHONEOS_DEPLOYMENT_TARGET = 4.3; LIBRARY_SEARCH_PATHS = ""; - PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE = "2AC0DC11-4546-47B6-8B8A-453CCA80903C"; SDKROOT = iphoneos; STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic; TARGETED_DEVICE_FAMILY = "1,2"; diff --git a/submodules/build/builders.d/libvpx.mk b/submodules/build/builders.d/libvpx.mk index 8cf0564ec..badceee91 100644 --- a/submodules/build/builders.d/libvpx.mk +++ b/submodules/build/builders.d/libvpx.mk @@ -14,6 +14,9 @@ else libvpx_configure_options+= --target=x86-darwin10-gcc endif libvpx_dir?=externals/libvpx +all_p=armv6-darwin-gcc #neon Cortex-A8 +all_p+=armv7-darwin-gcc #neon Cortex-A8 +all_p+=armv7s-darwin-gcc #neon Cortex-A8 $(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp: cd $(BUILDER_SRC_DIR)/$(libvpx_dir) \ @@ -24,10 +27,10 @@ $(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: $(BUILDER_SRC_DIR)/$(libvpx_dir)/p mkdir -p $(BUILDER_BUILD_DIR)/$(libvpx_dir) cd $(BUILDER_BUILD_DIR)/$(libvpx_dir)/ \ && host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \ - && SYSROOT_PATH=$$SYSROOT_PATH SDK_BIN_PATH=$$SDK_BIN_PATH $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) $(libvpx_configure_options) + && export all_platforms="${all_p}" && $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) --sdk-path=$$SDK_BIN_PATH/../../ --libc=$$SYSROOT_PATH $(libvpx_configure_options) build-libvpx: $(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk - cd $(BUILDER_BUILD_DIR)/$(libvpx_dir) && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install + cd $(BUILDER_BUILD_DIR)/$(libvpx_dir) make && make install clean-libvpx: cd $(BUILDER_BUILD_DIR)/$(libvpx_dir) && make clean diff --git a/submodules/build/builders.d/libvpx.patch b/submodules/build/builders.d/libvpx.patch index d651ccfc8..0cd793f5f 100644 --- a/submodules/build/builders.d/libvpx.patch +++ b/submodules/build/builders.d/libvpx.patch @@ -1,29 +1,9 @@ diff --git a/build/make/configure.sh b/build/make/configure.sh -index 0426f92..38fdcb2 100755 +index c99a01c..48f8876 100755 --- a/build/make/configure.sh +++ b/build/make/configure.sh -@@ -624,6 +624,9 @@ process_common_toolchain() { - if [ -d "/Developer/SDKs/MacOSX10.7.sdk" ]; then - osx_sdk_dir="/Developer/SDKs/MacOSX10.7.sdk" - fi -+ if test -n "$SYSROOT_PATH" ; then -+ osx_sdk_dir=$SYSROOT_PATH -+ fi - - case ${toolchain} in - *-darwin8-*) -@@ -743,9 +746,17 @@ process_common_toolchain() { - darwin*) - SDK_PATH=/Developer/Platforms/iPhoneOS.platform/Developer - TOOLCHAIN_PATH=${SDK_PATH}/usr/bin -+ if test -n "$SYSROOT_PATH" ; then -+ SDK_FULL_PATH=$SYSROOT_PATH -+ else -+ SDK_FULL_PATH="${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" -+ fi -+ if test -n "$SDK_BIN_PATH" ; then -+ TOOLCHAIN_PATH=$SDK_BIN_PATH -+ fi +@@ -892,7 +892,7 @@ process_common_toolchain() { + CXX=${TOOLCHAIN_PATH}/g++ CC=${TOOLCHAIN_PATH}/gcc AR=${TOOLCHAIN_PATH}/ar - LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2 @@ -31,39 +11,12 @@ index 0426f92..38fdcb2 100755 AS=${TOOLCHAIN_PATH}/as STRIP=${TOOLCHAIN_PATH}/strip NM=${TOOLCHAIN_PATH}/nm -@@ -757,12 +768,12 @@ process_common_toolchain() { +@@ -904,7 +904,7 @@ process_common_toolchain() { ASFLAGS="-version -arch ${tgt_isa} -g" add_cflags -arch ${tgt_isa} - add_ldflags -arch_only ${tgt_isa} + add_ldflags -arch ${tgt_isa} -- add_cflags "-isysroot ${SDK_PATH}/SDKs/iPhoneOS5.0.sdk" -+ add_cflags "-isysroot $SDK_FULL_PATH" - - # This should be overridable -- alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.0.sdk -+ alt_libc=$SDK_FULL_PATH - - # Add the paths for the alternate libc - for d in usr/include; do -diff --git a/configure b/configure -index 6f20c6b..4638ea2 100755 ---- a/configure -+++ b/configure -@@ -94,6 +94,7 @@ all_platforms="${all_platforms} iwmmxt-linux-gcc" - all_platforms="${all_platforms} iwmmxt2-linux-rvct" - all_platforms="${all_platforms} iwmmxt2-linux-gcc" - all_platforms="${all_platforms} armv7-darwin-gcc" #neon Cortex-A8 -+all_platforms="${all_platforms} armv7s-darwin-gcc" #neon Cortex-A8 - all_platforms="${all_platforms} armv7-linux-rvct" #neon Cortex-A8 - all_platforms="${all_platforms} armv7-linux-gcc" #neon Cortex-A8 - all_platforms="${all_platforms} armv7-none-rvct" #neon Cortex-A8 -@@ -198,6 +199,7 @@ ARCH_EXT_LIST=" - armv5te - armv6 - armv7 -+ armv7s - iwmmxt - iwmmxt2 - + if [ -z "${alt_libc}" ]; then + alt_libc=${SDK_PATH}/SDKs/iPhoneOS5.1.sdk diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index ea15aad82..125bdebcd 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -27,11 +27,11 @@ else exit fi echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}" -XCODE_ROOT=/Applications/Xcode.app +XCODE_DEV_PATH=`xcode-select -print-path` #new path with Xcode 4.3: -if test -d ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then - SDK_PATH_LIST=`ls -drt ${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` - SDK_BIN_PATH=${XCODE_ROOT}/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin +if test -d ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then + SDK_PATH_LIST=`ls -drt ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin else SDK_PATH_LIST=`ls -drt /Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin diff --git a/submodules/externals/libvpx b/submodules/externals/libvpx index c8df1656b..b9ce43029 160000 --- a/submodules/externals/libvpx +++ b/submodules/externals/libvpx @@ -1 +1 @@ -Subproject commit c8df1656bd94928059204242e778bd5b8b9dc7aa +Subproject commit b9ce43029298182668d4dcb0e0814189e4a63c2a From 2f527bba0f3d4b44db14de65b024f4152ea2f165 Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Wed, 22 May 2013 23:00:34 +0200 Subject: [PATCH 03/14] AAC-ELD: support PLC and multiple frames per RTP packet and fix uninit to free the audio converter. --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 12a3d7951..889ff55a0 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 12a3d795131ab1b367ae000f8b70f9b8af684df6 +Subproject commit 889ff55a035ece493d053d5bd631df560c28c062 From 1f0089b06c4b5dcbdb085624b4801e40ae333c0f Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Thu, 23 May 2013 11:54:37 +0200 Subject: [PATCH 04/14] AAC-ELD : set an initial max ptime at 50ms - to avoid ptime automatic growing too high when packets are losts - setting overridden up to 100 by initial set ptime --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index 889ff55a0..7cb2aa263 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 889ff55a035ece493d053d5bd631df560c28c062 +Subproject commit 7cb2aa2639fd6180e8996eee303cfbbcb3048941 From 7162af2c3d1bee3d79355a258b11a1389fe22b05 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 27 May 2013 22:07:52 +0200 Subject: [PATCH 05/14] add opus submodule --- .gitmodules | 3 + submodules/build/builder-iphone-os.mk | 8 +-- submodules/build/builders.d/opus.mk | 67 +++++++++++++++++++ submodules/externals/opus | 1 + .../liblinphone.xcodeproj/project.pbxproj | 8 +++ submodules/linphone | 2 +- 6 files changed, 84 insertions(+), 5 deletions(-) create mode 100644 submodules/build/builders.d/opus.mk create mode 160000 submodules/externals/opus diff --git a/.gitmodules b/.gitmodules index 48fa6c484..801c0cc77 100644 --- a/.gitmodules +++ b/.gitmodules @@ -49,3 +49,6 @@ [submodule "submodules/bcg729"] path = submodules/bcg729 url = git://git.linphone.org/bcg729.git +[submodule "submodules/externals/opus"] + path = submodules/externals/opus + url = git://git.opus-codec.org/opus.git diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index e7643586d..605e898c4 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -109,18 +109,18 @@ veryclean: veryclean-linphone veryclean-msbcg729 rm -rf $(BUILDER_BUILD_DIR) -.NOTPARALLEL build-linphone: init build-openssl build-srtp build-zrtpcpp build-osip2 build-eXosip2 build-speex build-libgsm build-ffmpeg build-libvpx detect_gpl_mode_switch $(LINPHONE_BUILD_DIR)/Makefile +.NOTPARALLEL build-linphone: init build-openssl build-srtp build-zrtpcpp build-osip2 build-eXosip2 build-speex build-libgsm build-ffmpeg build-libvpx build-opus detect_gpl_mode_switch $(LINPHONE_BUILD_DIR)/Makefile cd $(LINPHONE_BUILD_DIR) && export PKG_CONFIG_LIBDIR=$(prefix)/lib/pkgconfig export CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make newdate && make && make install mkdir -p $(prefix)/share/linphone/tutorials && cp -f $(LINPHONE_SRC_DIR)/coreapi/help/*.c $(prefix)/share/linphone/tutorials/ -clean-linphone: clean-osip2 clean-eXosip2 clean-speex clean-libgsm clean-srtp clean-zrtpcpp clean-msilbc clean-libilbc clean-openssl clean-msamr clean-mssilk clean-ffmpeg clean-libvpx clean-msx264 +clean-linphone: clean-osip2 clean-eXosip2 clean-speex clean-libgsm clean-srtp clean-zrtpcpp clean-msilbc clean-libilbc clean-openssl clean-msamr clean-mssilk clean-ffmpeg clean-libvpx clean-msx264 clean-opus cd $(LINPHONE_BUILD_DIR) && make clean -veryclean-linphone: veryclean-osip2 veryclean-eXosip2 veryclean-speex veryclean-srtp veryclean-zrtpcpp veryclean-libgsm veryclean-msilbc veryclean-libilbc veryclean-openssl veryclean-msamr veryclean-mssilk veryclean-msx264 veryclean-libvpx +veryclean-linphone: veryclean-osip2 veryclean-eXosip2 veryclean-speex veryclean-srtp veryclean-zrtpcpp veryclean-libgsm veryclean-msilbc veryclean-libilbc veryclean-openssl veryclean-msamr veryclean-mssilk veryclean-msx264 veryclean-libvpx veryclean-opus #-cd $(LINPHONE_BUILD_DIR) && make distclean -cd $(LINPHONE_SRC_DIR) && rm -f configure -clean-makefile-linphone: clean-makefile-osip2 clean-makefile-eXosip2 clean-makefile-speex clean-makefile-srtp clean-makefile-zrtpcpp clean-makefile-libilbc clean-makefile-msilbc clean-makefile-openssl clean-makefile-msamr clean-makefile-ffmpeg clean-makefile-libvpx clean-makefile-mssilk +clean-makefile-linphone: clean-makefile-osip2 clean-makefile-eXosip2 clean-makefile-speex clean-makefile-srtp clean-makefile-zrtpcpp clean-makefile-libilbc clean-makefile-msilbc clean-makefile-openssl clean-makefile-msamr clean-makefile-ffmpeg clean-makefile-libvpx clean-makefile-mssilk clean-makefile-opus cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile diff --git a/submodules/build/builders.d/opus.mk b/submodules/build/builders.d/opus.mk new file mode 100644 index 000000000..6d905843e --- /dev/null +++ b/submodules/build/builders.d/opus.mk @@ -0,0 +1,67 @@ +############################################################################ +# opus.mk +# Copyright (C) 2013 Belledonne Communications,Grenoble France +# +############################################################################ +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################ +opus_dir?=externals/opus +enable_opus?=yes + +libopus_configure_options=--disable-extra-programs --disable-doc +#ifeq (,$(findstring armv7s,$(host))) +# libopus_configure_options+= --enable-fixed-point +#compilation error with armv7, switching to fpu impl +#endif + +$(BUILDER_SRC_DIR)/$(opus_dir)/configure: + @echo -e "\033[01;32m Running autogen for msopus in $(BUILDER_SRC_DIR)/$(opus_dir) \033[0m" + cd $(BUILDER_SRC_DIR)/$(opus_dir) && ./autogen.sh + +$(BUILDER_BUILD_DIR)/$(opus_dir)/Makefile: $(BUILDER_SRC_DIR)/$(opus_dir)/configure + @echo -e "\033[01;32m Running configure in $(BUILDER_BUILD_DIR)/$(opus_dir) \033[0m" + mkdir -p $(BUILDER_BUILD_DIR)/$(opus_dir) + cd $(BUILDER_BUILD_DIR)/$(opus_dir)/ \ + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + $(BUILDER_SRC_DIR)/$(opus_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ + ${libopus_configure_options} + +ifeq ($(enable_opus),yes) + +build-opus: $(BUILDER_BUILD_DIR)/$(opus_dir)/Makefile + @echo -e "\033[01;32m building opus \033[0m" + cd $(BUILDER_BUILD_DIR)/$(opus_dir) \ + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig \ + CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + make -j1 && make install + + +else +build-opus: + @echo "opus is disabled" + +endif + +clean-opus: + -cd $(BUILDER_BUILD_DIR)/$(opus_dir) && make clean + +veryclean-opus: + -cd $(BUILDER_BUILD_DIR)/$(opus_dir) && make distclean + rm -f $(BUILDER_SRC_DIR)/$(opus_dir)/configure + +clean-makefile-opus: + -cd $(BUILDER_BUILD_DIR)/$(opus_dir) && rm -f Makefile diff --git a/submodules/externals/opus b/submodules/externals/opus new file mode 160000 index 000000000..fcecd29ab --- /dev/null +++ b/submodules/externals/opus @@ -0,0 +1 @@ +Subproject commit fcecd29abf32164326e568acdcdf7d8e877b33b1 diff --git a/submodules/liblinphone.xcodeproj/project.pbxproj b/submodules/liblinphone.xcodeproj/project.pbxproj index 590a8ac6e..9921fdae2 100644 --- a/submodules/liblinphone.xcodeproj/project.pbxproj +++ b/submodules/liblinphone.xcodeproj/project.pbxproj @@ -364,6 +364,8 @@ 22A10B5911F84E2D00373793 /* proto.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5311F84E2D00373793 /* proto.h */; }; 22A10B5A11F84E2D00373793 /* toast.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5411F84E2D00373793 /* toast.h */; }; 22A10B5B11F84E2D00373793 /* unproto.h in Headers */ = {isa = PBXBuildFile; fileRef = 22A10B5511F84E2D00373793 /* unproto.h */; }; + 22AF73BE1753E83700BE8398 /* msopus.c in Sources */ = {isa = PBXBuildFile; fileRef = 22AF73BD1753E83700BE8398 /* msopus.c */; }; + 22AF73C01753F3E100BE8398 /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AF73BF1753F3E100BE8398 /* libopus.a */; }; 22D07CD016F3BC5F009F2C9E /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 22D07CB416F3BC5F009F2C9E /* InfoPlist.strings */; }; 22D07CD116F3BC5F009F2C9E /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22D07CB616F3BC5F009F2C9E /* MainWindow.xib */; }; 22D07CD216F3BC5F009F2C9E /* mediastreamViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 22D07CB816F3BC5F009F2C9E /* mediastreamViewController.xib */; }; @@ -666,6 +668,8 @@ 22A10B5311F84E2D00373793 /* proto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = proto.h; sourceTree = ""; }; 22A10B5411F84E2D00373793 /* toast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = toast.h; sourceTree = ""; }; 22A10B5511F84E2D00373793 /* unproto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = unproto.h; sourceTree = ""; }; + 22AF73BD1753E83700BE8398 /* msopus.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msopus.c; sourceTree = ""; }; + 22AF73BF1753F3E100BE8398 /* libopus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopus.a; path = "../liblinphone-sdk/apple-darwin/lib/libopus.a"; sourceTree = ""; }; 22D07CB516F3BC5F009F2C9E /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 22D07CB716F3BC5F009F2C9E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/MainWindow.xib; sourceTree = ""; }; 22D07CB916F3BC5F009F2C9E /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/mediastreamViewController.xib; sourceTree = ""; }; @@ -715,6 +719,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 22AF73C01753F3E100BE8398 /* libopus.a in Frameworks */, 225D65CD1521C19A008B2E81 /* libortp.a in Frameworks */, 225D65CC1521C195008B2E81 /* libmediastreamer.a in Frameworks */, 2211DB9F14765CED00DEE054 /* libmssilk.a in Frameworks */, @@ -767,6 +772,7 @@ 0867D691FE84028FC02AAC07 /* liblinphone */ = { isa = PBXGroup; children = ( + 22AF73BF1753F3E100BE8398 /* libopus.a */, 2211DBA0147660BB00DEE054 /* libSKP_SILK_SDK.a */, 2211DB9E14765CEC00DEE054 /* libmssilk.a */, 7066FC0913E830B800EFC6DC /* libvpx.a */, @@ -1050,6 +1056,7 @@ 223CA7EF16D9268D00EF1BEC /* audiofilters */ = { isa = PBXGroup; children = ( + 22AF73BD1753E83700BE8398 /* msopus.c */, 0406A7651721FF79009FD24F /* aac-eld.c */, 22D07CE416F3BFCB009F2C9E /* speexec.c */, 223CA7F016D9268D00EF1BEC /* alaw.c */, @@ -1679,6 +1686,7 @@ 223CA8D416D9268D00EF1BEC /* scaler.c in Sources */, 223CA8D716D9268D00EF1BEC /* videostream.c in Sources */, 22D07CE516F3BFCB009F2C9E /* speexec.c in Sources */, + 22AF73BE1753E83700BE8398 /* msopus.c in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/submodules/linphone b/submodules/linphone index 7cb2aa263..5355e3775 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 7cb2aa2639fd6180e8996eee303cfbbcb3048941 +Subproject commit 5355e37750d8c32fbd978161966ba80390a8bec0 From b33387c611fe4a02f901137a961f71510ce7da48 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 28 May 2013 08:49:54 +0200 Subject: [PATCH 06/14] update speex submodule to fix symbole colission with opus --- submodules/externals/speex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/externals/speex b/submodules/externals/speex index 89e99a481..e780bd2ce 160000 --- a/submodules/externals/speex +++ b/submodules/externals/speex @@ -1 +1 @@ -Subproject commit 89e99a4814fd62945ff559d3d37d9aa92caf3169 +Subproject commit e780bd2ce36af4133fd0ff304ab2078f1dacaaf6 From 1f2c48e380c90a2e7996797c1fa00cba1bbe7f77 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 28 May 2013 12:40:05 +0200 Subject: [PATCH 07/14] add opus library --- linphone.xcodeproj/project.pbxproj | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 8f5029539..c029ee1e5 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -129,6 +129,8 @@ 22AA8AFD13D7125600B30535 /* libx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFB13D7125500B30535 /* libx264.a */; }; 22AA8AFE13D7125600B30535 /* libmsx264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AA8AFC13D7125500B30535 /* libmsx264.a */; }; 22AA8B0113D83F6300B30535 /* UICamSwitch.m in Sources */ = {isa = PBXBuildFile; fileRef = 22AA8B0013D83F6300B30535 /* UICamSwitch.m */; }; + 22AF73C21754C0D100BE8398 /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AF73C11754C0D000BE8398 /* libopus.a */; }; + 22AF73C31754C0D800BE8398 /* libopus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 22AF73C11754C0D000BE8398 /* libopus.a */; }; 22B5EFA310CE50BD00777D97 /* AddressBookUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */; }; 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22B5F03410CE6B2F00777D97 /* AddressBook.framework */; }; 22BB1A69132FF16A005CD7AA /* UIEraseButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 22BB1A68132FF16A005CD7AA /* UIEraseButton.m */; }; @@ -1616,6 +1618,7 @@ 22AA8AFC13D7125500B30535 /* libmsx264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsx264.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsx264.a"; sourceTree = ""; }; 22AA8AFF13D83F6300B30535 /* UICamSwitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UICamSwitch.h; sourceTree = ""; }; 22AA8B0013D83F6300B30535 /* UICamSwitch.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = UICamSwitch.m; sourceTree = ""; }; + 22AF73C11754C0D000BE8398 /* libopus.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libopus.a; path = "liblinphone-sdk/apple-darwin/lib/libopus.a"; sourceTree = ""; }; 22B5EFA210CE50BD00777D97 /* AddressBookUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBookUI.framework; path = System/Library/Frameworks/AddressBookUI.framework; sourceTree = SDKROOT; }; 22B5F03410CE6B2F00777D97 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; 22BB1A67132FF16A005CD7AA /* UIEraseButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UIEraseButton.h; sourceTree = ""; }; @@ -2423,6 +2426,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 22AF73C21754C0D100BE8398 /* libopus.a in Frameworks */, D30562151671DC4900C97967 /* libNinePatch.a in Frameworks */, D30562161671DC4900C97967 /* libXMLRPC.a in Frameworks */, 22B5F03510CE6B2F00777D97 /* AddressBook.framework in Frameworks */, @@ -2525,6 +2529,7 @@ 22D8F16F147548E2008C97DB /* libspeexdsp.a in Frameworks */, 22D8F163147548E2008C97DB /* libssl.a in Frameworks */, 22D8F15B147548E2008C97DB /* libvpx.a in Frameworks */, + 22AF73C31754C0D800BE8398 /* libopus.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2985,6 +2990,7 @@ 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { isa = PBXGroup; children = ( + 22AF73C11754C0D000BE8398 /* libopus.a */, 2258633C11410BAC00C5A737 /* README */, 22276E8013C73D3100210156 /* libavcodec.a */, 22276E8113C73D3100210156 /* libavutil.a */, From e132497f6e721ab960e99fc29f1d46d4d67f7d1c Mon Sep 17 00:00:00 2001 From: Johan Pascal Date: Tue, 28 May 2013 13:24:09 +0200 Subject: [PATCH 08/14] Add opus codec to the linphone application - only one mode available: 48kHz --- Classes/LinphoneManager.m | 1 + Settings/InAppSettings.bundle/Audio.plist | 52 ++++++++++++++--------- 2 files changed, 33 insertions(+), 20 deletions(-) diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 92976227d..0cf52f4be 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -133,6 +133,7 @@ struct codec_name_pref_table codec_pref_table[]={ { "vp8", 90000, @"vp8_preference"}, { "mpeg4-generic", 44100, @"aaceld_44k_preference"}, { "mpeg4-generic", 22050, @"aaceld_22k_preference"}, + { "opus", 48000, @"opus_preference"}, { NULL,0,Nil } }; diff --git a/Settings/InAppSettings.bundle/Audio.plist b/Settings/InAppSettings.bundle/Audio.plist index 4331a88d4..5fa9900a1 100644 --- a/Settings/InAppSettings.bundle/Audio.plist +++ b/Settings/InAppSettings.bundle/Audio.plist @@ -30,6 +30,16 @@ Type PSToggleSwitchSpecifier + + DefaultValue + + Key + opus_preference + Title + Opus 48kHz + Type + PSToggleSwitchSpecifier + DefaultValue @@ -50,6 +60,28 @@ Type PSToggleSwitchSpecifier + + DefaultValue + + Key + aaceld_22k_preference + Title + AAC-ELD 22kHz + Type + PSToggleSwitchSpecifier + + + New item + + DefaultValue + + Key + aaceld_44k_preference + Title + AAC-ELD 44kHz + Type + PSToggleSwitchSpecifier + DefaultValue @@ -120,26 +152,6 @@ Type PSToggleSwitchSpecifier - - DefaultValue - - Key - aaceld_44k_preference - Title - AAC-ELD 44kHz - Type - PSToggleSwitchSpecifier - - - DefaultValue - - Key - aaceld_22k_preference - Title - AAC-ELD 22kHz - Type - PSToggleSwitchSpecifier - Key audio_advanced_group From 49a10e1e9671336f94031c6570a95250294a2ed4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Tue, 28 May 2013 17:10:50 +0200 Subject: [PATCH 09/14] better address book sip address handling/filtering --- Classes/ChatViewController.m | 2 +- Classes/ContactDetailsTableViewController.m | 44 ++++++++++++++++++--- Classes/ContactsViewController.h | 5 ++- Classes/ContactsViewController.m | 10 ++--- Classes/LinphoneManager.h | 5 ++- Classes/LinphoneManager.m | 8 +++- Classes/Utils/FastAddressBook.m | 2 +- Resources/linphonerc-factory | 3 ++ 8 files changed, 61 insertions(+), 18 deletions(-) diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 4f52378a2..453f11927 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -122,7 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil; if ([[addressField text ]length] == 0) { // if no address is manually set, lauch address book [ContactSelection setSelectionMode:ContactSelectionModeMessage]; [ContactSelection setAddAddress:nil]; - [ContactSelection setSipFilter:TRUE]; + [ContactSelection setSipFilter:@"*"]; [ContactSelection setEmailFilter:FALSE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE]; } else { diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 7fe664112..f43280bdc 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -198,7 +198,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); BOOL add = false; if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { - if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { + if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { add = true; } } else { @@ -285,7 +285,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C lMap = ABMultiValueCreateMutable(kABDictionaryPropertyType); } CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey }; - CFTypeRef values[] = { [value copy], kContactSipField }; + CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 1, NULL, NULL); CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; if(!ABMultiValueAddValueAndLabel(lMap, lDict, label, &identifier)) { @@ -497,7 +497,17 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, index); CFStringRef valueRef = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); if(valueRef != NULL) { - value = [NSString stringWithString:(NSString*) valueRef]; + LinphoneAddress* addr=NULL; + if ([[LinphoneManager instance] lpConfigBoolForKey:@"contact_display_username_only"] + && (addr=linphone_address_new([(NSString *)valueRef UTF8String]))) { + if (linphone_address_get_username(addr)) { + value = [NSString stringWithCString:linphone_address_get_username(addr) + encoding:[NSString defaultCStringEncoding]]; + } /*else value=@""*/ + } else { + value = [NSString stringWithString:(NSString*) valueRef]; + } + if (addr) linphone_address_destroy(addr); } CFRelease(lDict); CFRelease(lMap); @@ -825,11 +835,33 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C CFRelease(lcMap); int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [value copy], kContactSipField }; + CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); ABMultiValueReplaceValueAtIndex(lMap, lDict, index); - CFRelease(lDict); - ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); + ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); + CFRelease(lDict); + /*check if message type is kept or not*/ + lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); + lMap = ABMultiValueCreateMutableCopy(lcMap); + CFRelease(lcMap); + index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + lDict = ABMultiValueCopyValueAtIndex(lMap,index); + if(!CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { + /*too bad probably a gtalk number, storing uri*/ + NSString* username = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); + LinphoneAddress* address = linphone_core_interpret_url([LinphoneManager getLc] + ,[username UTF8String]); + char* uri = linphone_address_as_string_uri_only(address); + CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; + CFTypeRef values[] = { [NSString stringWithCString:uri encoding:[NSString defaultCStringEncoding]], [LinphoneManager instance].contactSipField }; + CFDictionaryRef lDict2 = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); + ABMultiValueReplaceValueAtIndex(lMap, lDict2, index); + ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); + CFRelease(lDict2); + linphone_address_destroy(address); + ms_free(uri); + } + CFRelease(lDict); CFRelease(lMap); } else if(contactSections[[path section]] == ContactSections_Email) { ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonEmailProperty); diff --git a/Classes/ContactsViewController.h b/Classes/ContactsViewController.h index 00da1d3ad..c21948896 100644 --- a/Classes/ContactsViewController.h +++ b/Classes/ContactsViewController.h @@ -36,8 +36,9 @@ typedef enum _ContactSelectionMode { + (ContactSelectionMode)getSelectionMode; + (void)setAddAddress:(NSString*)address; + (NSString*)getAddAddress; -+ (void)setSipFilter:(BOOL)enable; -+ (BOOL)getSipFilter; +/* define sip filter, can be * or sip domain*/ ++ (void)setSipFilter:(NSString*) domain; ++ (NSString*)getSipFilter; + (void)setEmailFilter:(BOOL)enable; + (BOOL)getEmailFilter; diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index cf23d9d01..342ee059f 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -27,7 +27,7 @@ static ContactSelectionMode sSelectionMode = ContactSelectionModeNone; static NSString* sAddAddress = nil; -static BOOL sSipFilter = FALSE; +static NSString* sSipFilter = nil; static BOOL sEmailFilter = FALSE; + (void)setSelectionMode:(ContactSelectionMode)selectionMode { @@ -52,11 +52,11 @@ static BOOL sEmailFilter = FALSE; return sAddAddress; } -+ (void)setSipFilter:(BOOL)enable { - sSipFilter = enable; ++ (void)setSipFilter:(NSString*)domain { + sSipFilter = domain; } -+ (BOOL)getSipFilter { ++ (NSString*)getSipFilter { return sSipFilter; } @@ -206,7 +206,7 @@ static UICompositeViewDescription *compositeDescription = nil; } if(view == History_Linphone) { - [ContactSelection setSipFilter:TRUE]; + [ContactSelection setSipFilter:@"*"]; [ContactSelection setEmailFilter:FALSE]; [tableController loadData]; linphoneButton.selected = TRUE; diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index b90e36f74..4f9a27d06 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -47,8 +47,6 @@ extern NSString *const kLinphoneLogsUpdate; extern NSString *const kLinphoneSettingsUpdate; extern NSString *const kLinphoneBluetoothAvailabilityUpdate; -extern NSString *const kContactSipField; - typedef enum _NetworkType { network_none = 0, network_2g, @@ -117,6 +115,7 @@ typedef struct _LinphoneManagerSounds { + (NSSet *)unsupportedCodecs; + (NSString *)getUserAgent; + - (void)startLibLinphone; - (void)destroyLibLinphone; - (BOOL)resignActive; @@ -155,6 +154,7 @@ typedef struct _LinphoneManagerSounds { - (void)lpConfigSetBool:(BOOL)value forKey:(NSString*)key forSection:(NSString*)section; - (BOOL)lpConfigBoolForKey:(NSString*)key forSection:(NSString*)section; + @property (readonly) FastAddressBook* fastAddressBook; @property Connectivity connectivity; @property (readonly) NetworkType network; @@ -168,6 +168,7 @@ typedef struct _LinphoneManagerSounds { @property (nonatomic, assign) BOOL bluetoothAvailable; @property (nonatomic, assign) BOOL bluetoothEnabled; @property (readonly) ALAssetsLibrary *photoLibrary; +@property (readonly) NSString* contactSipField; @end diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 0cf52f4be..c24357942 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -57,7 +57,7 @@ NSString *const kLinphoneMainViewChange = @"LinphoneMainViewChange"; NSString *const kLinphoneLogsUpdate = @"LinphoneLogsUpdate"; NSString *const kLinphoneSettingsUpdate = @"LinphoneSettingsUpdate"; NSString *const kLinphoneBluetoothAvailabilityUpdate = @"LinphoneBluetoothAvailabilityUpdate"; -NSString *const kContactSipField = @"SIP"; + extern void libmsilbc_init(); @@ -246,6 +246,7 @@ struct codec_name_pref_table codec_pref_table[]={ [self copyDefaultSettings]; pendindCallIdFromRemoteNotif = [[NSMutableArray alloc] init ]; photoLibrary = [[ALAssetsLibrary alloc] init]; + } return self; } @@ -925,6 +926,11 @@ static LinphoneCoreVTable linphonec_vtable = { //go directly to bg mode [self resignActive]; } + + _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value"]; + if (_contactSipField == nil) + _contactSipField =@"SIP"; + // Post event NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; diff --git a/Classes/Utils/FastAddressBook.m b/Classes/Utils/FastAddressBook.m index ab5f0b1a3..9831c2812 100644 --- a/Classes/Utils/FastAddressBook.m +++ b/Classes/Utils/FastAddressBook.m @@ -179,7 +179,7 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); BOOL add = false; if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { - if(CFStringCompare((CFStringRef)kContactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { + if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { add = true; } } else { diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index fb48ebbdf..ec3d25d96 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -47,3 +47,6 @@ stun=stun.linphone.org [video] display_filter_auto_rotate=0 + +[app] +#contact_display_username_only=1 From a0a02062d194f82c77ccd856966218ac527c912f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Fri, 31 May 2013 11:25:00 +0200 Subject: [PATCH 10/14] enhanced management of sip uri in contact --- Classes/ChatViewController.m | 2 +- Classes/ContactDetailsTableViewController.m | 34 ++++++++++++++------- Classes/ContactsTableViewController.m | 25 +++++++++++---- Classes/ContactsViewController.m | 7 +++-- Classes/DialerViewController.m | 2 +- Classes/HistoryDetailsViewController.m | 18 ++++++----- Classes/LinphoneManager.h | 2 ++ Classes/LinphoneManager.m | 27 +++++++++++++--- Classes/LinphoneUI/UIMainBar.m | 2 +- Resources/linphonerc-factory | 1 + linphone.xcodeproj/project.pbxproj | 2 ++ 11 files changed, 86 insertions(+), 36 deletions(-) diff --git a/Classes/ChatViewController.m b/Classes/ChatViewController.m index 453f11927..1bc923dbc 100644 --- a/Classes/ChatViewController.m +++ b/Classes/ChatViewController.m @@ -122,7 +122,7 @@ static UICompositeViewDescription *compositeDescription = nil; if ([[addressField text ]length] == 0) { // if no address is manually set, lauch address book [ContactSelection setSelectionMode:ContactSelectionModeMessage]; [ContactSelection setAddAddress:nil]; - [ContactSelection setSipFilter:@"*"]; + [ContactSelection setSipFilter: [LinphoneManager instance].contactFilter]; [ContactSelection setEmailFilter:FALSE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE]; } else { diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index f43280bdc..7b64c2990 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -201,17 +201,29 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey), kCFCompareCaseInsensitive) == 0) { add = true; } - } else { - add = true; - } - if(add) { - Entry *entry = [[Entry alloc] initWithData:identifier]; - [subArray addObject: entry]; - [entry release]; - } - CFRelease(lDict); - } - CFRelease(lMap); + } else { //check domain + LinphoneAddress* address = linphone_address_new([(NSString*)CFDictionaryGetValue(lDict,kABPersonInstantMessageUsernameKey) UTF8String]); + if (address) { + if ([[ContactSelection getSipFilter] compare:@"*" options:NSCaseInsensitiveSearch] == NSOrderedSame) { + add = true; + } else { + NSString* domain = [NSString stringWithCString:linphone_address_get_domain(address) + encoding:[NSString defaultCStringEncoding]]; + add = [domain compare:[ContactSelection getSipFilter] options:NSCaseInsensitiveSearch] == NSOrderedSame; + } + linphone_address_destroy(address); + } else { + add = false; + } + } + if(add) { + Entry *entry = [[Entry alloc] initWithData:identifier]; + [subArray addObject: entry]; + [entry release]; + } + CFRelease(lDict); + } + CFRelease(lMap); } [dataCache addObject:subArray]; } diff --git a/Classes/ContactsTableViewController.m b/Classes/ContactsTableViewController.m index 866b247ce..c424b1ea5 100644 --- a/Classes/ContactsTableViewController.m +++ b/Classes/ContactsTableViewController.m @@ -87,13 +87,26 @@ static void sync_address_book (ABAddressBookRef addressBook, CFDictionaryRef inf CFDictionaryRef lDict = ABMultiValueCopyValueAtIndex(lMap, i); if(CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { CFStringRef serviceKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageServiceKey); - if(CFStringCompare((CFStringRef)@"SIP", serviceKey, kCFCompareCaseInsensitive) == 0) { - add = true; - } - } else { - NSString* usernameKey = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); - if([usernameKey hasPrefix:@"sip:"]) { + CFStringRef username = username=CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); + if(CFStringCompare((CFStringRef)[LinphoneManager instance].contactSipField, serviceKey, kCFCompareCaseInsensitive) == 0) { add = true; + } else { + add=false; + } + } else { + //check domain + LinphoneAddress* address = linphone_address_new([(NSString*)CFDictionaryGetValue(lDict,kABPersonInstantMessageUsernameKey) UTF8String]); + if (address) { + if ([[ContactSelection getSipFilter] compare:@"*" options:NSCaseInsensitiveSearch] == NSOrderedSame) { + add = true; + } else { + NSString* domain = [NSString stringWithCString:linphone_address_get_domain(address) + encoding:[NSString defaultCStringEncoding]]; + add = [domain compare:[ContactSelection getSipFilter] options:NSCaseInsensitiveSearch] == NSOrderedSame; + } + linphone_address_destroy(address); + } else { + add = false; } } CFRelease(lDict); diff --git a/Classes/ContactsViewController.m b/Classes/ContactsViewController.m index 342ee059f..d3b54c122 100644 --- a/Classes/ContactsViewController.m +++ b/Classes/ContactsViewController.m @@ -53,7 +53,8 @@ static BOOL sEmailFilter = FALSE; } + (void)setSipFilter:(NSString*)domain { - sSipFilter = domain; + [sSipFilter release]; + sSipFilter = [domain retain]; } + (NSString*)getSipFilter { @@ -197,7 +198,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)changeView:(HistoryView)view { if(view == History_All) { - [ContactSelection setSipFilter:FALSE]; + [ContactSelection setSipFilter:nil]; [ContactSelection setEmailFilter:FALSE]; [tableController loadData]; allButton.selected = TRUE; @@ -206,7 +207,7 @@ static UICompositeViewDescription *compositeDescription = nil; } if(view == History_Linphone) { - [ContactSelection setSipFilter:@"*"]; + [ContactSelection setSipFilter:[LinphoneManager instance].contactFilter]; [ContactSelection setEmailFilter:FALSE]; [tableController loadData]; linphoneButton.selected = TRUE; diff --git a/Classes/DialerViewController.m b/Classes/DialerViewController.m index 0263d8138..cb28fefaa 100644 --- a/Classes/DialerViewController.m +++ b/Classes/DialerViewController.m @@ -317,7 +317,7 @@ static UICompositeViewDescription *compositeDescription = nil; - (IBAction)onAddContactClick: (id) event { [ContactSelection setSelectionMode:ContactSelectionModeEdit]; [ContactSelection setAddAddress:[addressField text]]; - [ContactSelection setSipFilter:FALSE]; + [ContactSelection setSipFilter:nil]; [ContactSelection setEmailFilter:FALSE]; ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { diff --git a/Classes/HistoryDetailsViewController.m b/Classes/HistoryDetailsViewController.m index 16454d126..ec172566a 100644 --- a/Classes/HistoryDetailsViewController.m +++ b/Classes/HistoryDetailsViewController.m @@ -281,13 +281,15 @@ static UICompositeViewDescription *compositeDescription = nil; // contact name [plainAddressLabel setText:@""]; if (addr != NULL) { - char* lAddress = linphone_address_as_string_uri_only(addr); - if(lAddress != NULL) { - [plainAddressLabel setText:[NSString stringWithUTF8String:lAddress]]; - ms_free(lAddress); - } else { - - } + if ([[LinphoneManager instance] lpConfigBoolForKey:@"contact_display_username_only"]) { + [plainAddressLabel setText:[NSString stringWithUTF8String:linphone_address_get_username(addr)?linphone_address_get_username(addr):""]]; + } else { + char* lAddress = linphone_address_as_string_uri_only(addr); + if(lAddress != NULL) { + [plainAddressLabel setText:[NSString stringWithUTF8String:lAddress]]; + ms_free(lAddress); + } + } } if (addr != NULL) { @@ -327,7 +329,7 @@ static UICompositeViewDescription *compositeDescription = nil; [ContactSelection setAddAddress:[NSString stringWithUTF8String:lAddress]]; [ContactSelection setSelectionMode:ContactSelectionModeEdit]; - [ContactSelection setSipFilter:FALSE]; + [ContactSelection setSipFilter:nil]; [ContactSelection setEmailFilter:FALSE]; ContactsViewController *controller = DYNAMIC_CAST([[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription] push:TRUE], ContactsViewController); if(controller != nil) { diff --git a/Classes/LinphoneManager.h b/Classes/LinphoneManager.h index 4f9a27d06..da64fca6c 100644 --- a/Classes/LinphoneManager.h +++ b/Classes/LinphoneManager.h @@ -143,6 +143,7 @@ typedef struct _LinphoneManagerSounds { - (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key; - (NSString*)lpConfigStringForKey:(NSString*)key; +- (NSString*)lpConfigStringForKey:(NSString*)key withDefault:(NSString*)value; - (void)lpConfigSetString:(NSString*)value forKey:(NSString*)key forSection:(NSString*)section; - (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString*)section; - (void)lpConfigSetInt:(NSInteger)value forKey:(NSString*)key; @@ -169,6 +170,7 @@ typedef struct _LinphoneManagerSounds { @property (nonatomic, assign) BOOL bluetoothEnabled; @property (readonly) ALAssetsLibrary *photoLibrary; @property (readonly) NSString* contactSipField; +@property (readonly,copy) NSString* contactFilter; @end diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index c24357942..882dae154 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -842,6 +842,11 @@ static LinphoneCoreVTable linphonec_vtable = { ,self); linphone_core_set_user_agent(theLinphoneCore,"LinphoneIPhone", [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey] UTF8String]); + + _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value"]; + if (_contactSipField == nil) + _contactSipField =@"SIP"; + fastAddressBook = [[FastAddressBook alloc] init]; linphone_core_set_root_ca(theLinphoneCore, lRootCa); @@ -926,11 +931,7 @@ static LinphoneCoreVTable linphonec_vtable = { //go directly to bg mode [self resignActive]; } - - _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value"]; - if (_contactSipField == nil) - _contactSipField =@"SIP"; - + // Post event NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; @@ -1420,6 +1421,10 @@ static void audioRouteChangeListenerCallback ( - (NSString*)lpConfigStringForKey:(NSString*)key { return [self lpConfigStringForKey:key forSection:[NSString stringWithUTF8String:LINPHONERC_APPLICATION_KEY]]; } +- (NSString*)lpConfigStringForKey:(NSString*)key withDefault:(NSString*)defaultValue { + NSString* value = [self lpConfigStringForKey:key]; + return value?value:defaultValue; +} - (NSString*)lpConfigStringForKey:(NSString*)key forSection:(NSString *)section { if (!key) return nil; @@ -1504,4 +1509,16 @@ static void audioRouteChangeListenerCallback ( } } //else nop, keep call in paused state } +-(NSString*) contactFilter { + NSString* filter=@"*"; + if ( [self lpConfigBoolForKey:@"contact_filter_on_default_domain"]) { + LinphoneProxyConfig* proxy_cfg; + linphone_core_get_default_proxy(theLinphoneCore, &proxy_cfg); + if (proxy_cfg && linphone_proxy_config_get_addr(proxy_cfg)) { + return [NSString stringWithCString:linphone_proxy_config_get_domain(proxy_cfg) + encoding:[NSString defaultCStringEncoding]]; + } + } + return filter; +} @end diff --git a/Classes/LinphoneUI/UIMainBar.m b/Classes/LinphoneUI/UIMainBar.m index 5e7cbe771..18d750620 100644 --- a/Classes/LinphoneUI/UIMainBar.m +++ b/Classes/LinphoneUI/UIMainBar.m @@ -400,7 +400,7 @@ static NSString * const kDisappearAnimation = @"disappear"; - (IBAction)onContactsClick:(id)event { [ContactSelection setSelectionMode:ContactSelectionModeNone]; [ContactSelection setAddAddress:nil]; - [ContactSelection setSipFilter:FALSE]; + [ContactSelection setSipFilter:nil]; [ContactSelection setEmailFilter:FALSE]; [[PhoneMainView instance] changeCurrentView:[ContactsViewController compositeViewDescription]]; } diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index ec3d25d96..cc6384010 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -50,3 +50,4 @@ display_filter_auto_rotate=0 [app] #contact_display_username_only=1 +#contact_filter_on_default_domain=1 diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index c029ee1e5..a585e11ca 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -5529,6 +5529,7 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; CODE_SIGN_ENTITLEMENTS = ""; + CODE_SIGN_IDENTITY = "iPhone Distribution: jehan monnier"; COMPRESS_PNG_FILES = NO; COPY_PHASE_STRIP = NO; FRAMEWORK_SEARCH_PATHS = ""; @@ -5567,6 +5568,7 @@ ORDER_FILE = ""; OTHER_LDFLAGS = "-ObjC"; PRODUCT_NAME = linphone; + PROVISIONING_PROFILE = "B0005B58-1160-4269-B1FC-C5BA54ACBA65"; SKIP_INSTALL = NO; TARGETED_DEVICE_FAMILY = "1,2"; }; From 2339dce28514806069a986f73450c53cc6777d87 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 3 Jun 2013 09:00:48 +0200 Subject: [PATCH 11/14] port sdk to clang except for mssilk & opencore-amr --- submodules/build/builder-iphone-os.mk | 1 + submodules/build/builders.d/mssilk.mk | 4 +- submodules/build/builders.d/opencore-amr.mk | 4 +- submodules/build/builders.d/opus.mk | 12 +++-- submodules/build/builders.d/srtp.mk | 2 +- submodules/build/iphone-config-gcc.site | 51 +++++++++++++++++++++ submodules/build/iphone-config.site | 12 ++--- submodules/externals/speex | 2 +- 8 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 submodules/build/iphone-config-gcc.site diff --git a/submodules/build/builder-iphone-os.mk b/submodules/build/builder-iphone-os.mk index 605e898c4..d8b1f5938 100644 --- a/submodules/build/builder-iphone-os.mk +++ b/submodules/build/builder-iphone-os.mk @@ -22,6 +22,7 @@ host?=armv7-apple-darwin config_site:=iphone-config.site +config_site_gcc:=iphone-config-gcc.site library_mode:= --disable-shared --enable-static linphone_configure_controls= \ --disable-strict \ diff --git a/submodules/build/builders.d/mssilk.mk b/submodules/build/builders.d/mssilk.mk index bffd7de26..8c5aad5e4 100644 --- a/submodules/build/builders.d/mssilk.mk +++ b/submodules/build/builders.d/mssilk.mk @@ -30,7 +30,7 @@ $(BUILDER_BUILD_DIR)/$(mssilk_dir)/Makefile: $(BUILDER_SRC_DIR)/$(mssilk_dir)/co echo -e "\033[01;32m Running configure in $(BUILDER_BUILD_DIR)/$(mssilk_dir) \033[0m" mkdir -p $(BUILDER_BUILD_DIR)/$(mssilk_dir) cd $(BUILDER_BUILD_DIR)/$(mssilk_dir)/ \ - && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site_gcc) \ $(BUILDER_SRC_DIR)/$(mssilk_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} \ --enable-static @@ -40,7 +40,7 @@ build-mssilk: $(BUILDER_BUILD_DIR)/$(mssilk_dir)/Makefile echo -e "\033[01;32m building silk \033[0m" cd $(BUILDER_BUILD_DIR)/$(mssilk_dir) \ && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig \ - CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site_gcc) \ make -j1 && make install diff --git a/submodules/build/builders.d/opencore-amr.mk b/submodules/build/builders.d/opencore-amr.mk index dcd2347e9..8ab5abe96 100644 --- a/submodules/build/builders.d/opencore-amr.mk +++ b/submodules/build/builders.d/opencore-amr.mk @@ -31,11 +31,11 @@ $(BUILDER_SRC_DIR)/$(opencore-amr_dir)/configure: $(BUILDER_SRC_DIR)/$(opencore- $(BUILDER_BUILD_DIR)/$(opencore-amr_dir)/Makefile: $(BUILDER_SRC_DIR)/$(opencore-amr_dir)/configure mkdir -p $(BUILDER_BUILD_DIR)/$(opencore-amr_dir) cd $(BUILDER_BUILD_DIR)/$(opencore-amr_dir)/ \ - && CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ + && CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site_gcc) \ $(BUILDER_SRC_DIR)/$(opencore-amr_dir)/configure -prefix=$(prefix) --host=$(host) ${library_mode} ${opencore-amr-configure-option} build-opencore-amr: $(BUILDER_BUILD_DIR)/$(opencore-amr_dir)/Makefile - cd $(BUILDER_BUILD_DIR)/$(opencore-amr_dir) && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) make && make install + cd $(BUILDER_BUILD_DIR)/$(opencore-amr_dir) && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site_gcc) make && make install clean-opencore-amr: cd $(BUILDER_BUILD_DIR)/$(opencore-amr_dir) && make clean diff --git a/submodules/build/builders.d/opus.mk b/submodules/build/builders.d/opus.mk index 6d905843e..f0e6dcf32 100644 --- a/submodules/build/builders.d/opus.mk +++ b/submodules/build/builders.d/opus.mk @@ -23,10 +23,12 @@ opus_dir?=externals/opus enable_opus?=yes libopus_configure_options=--disable-extra-programs --disable-doc -#ifeq (,$(findstring armv7s,$(host))) -# libopus_configure_options+= --enable-fixed-point -#compilation error with armv7, switching to fpu impl -#endif +ifneq (,$(findstring armv7,$(host))) + libopus_configure_options+= --enable-fixed-point --disable-asm +endif +ifneq (,$(findstring armv7s,$(host))) + libopus_configure_options+= --enable-fixed-point --disable-asm +endif $(BUILDER_SRC_DIR)/$(opus_dir)/configure: @echo -e "\033[01;32m Running autogen for msopus in $(BUILDER_SRC_DIR)/$(opus_dir) \033[0m" @@ -47,7 +49,7 @@ build-opus: $(BUILDER_BUILD_DIR)/$(opus_dir)/Makefile cd $(BUILDER_BUILD_DIR)/$(opus_dir) \ && PKG_CONFIG_PATH=$(prefix)/lib/pkgconfig \ CONFIG_SITE=$(BUILDER_SRC_DIR)/build/$(config_site) \ - make -j1 && make install + make && make install else diff --git a/submodules/build/builders.d/srtp.mk b/submodules/build/builders.d/srtp.mk index dd5ebfc22..ee2d6c92a 100644 --- a/submodules/build/builders.d/srtp.mk +++ b/submodules/build/builders.d/srtp.mk @@ -11,7 +11,7 @@ $(BUILDER_BUILD_DIR)/$(srtp_dir)/Makefile: $(BUILDER_SRC_DIR)/$(srtp_dir)/config build-srtp: $(BUILDER_BUILD_DIR)/$(srtp_dir)/Makefile host_alias=$(host) && . /$(BUILDER_SRC_DIR)/build/$(config_site) && \ - cd $(BUILDER_BUILD_DIR)/$(srtp_dir) && make libsrtp.a AR=$$AR && make install + cd $(BUILDER_BUILD_DIR)/$(srtp_dir) && make libsrtp.a AR="$$AR" && make install clean-srtp: -cd $(BUILDER_BUILD_DIR)/$(srtp_dir) && make clean diff --git a/submodules/build/iphone-config-gcc.site b/submodules/build/iphone-config-gcc.site new file mode 100644 index 000000000..125bdebcd --- /dev/null +++ b/submodules/build/iphone-config-gcc.site @@ -0,0 +1,51 @@ +# -*- shell-script -*- + +SDK_VERSION_MAJOR=4 +SDK_VERSION=4.0 +MCPU="" +if test "${host_alias}" = "i386-apple-darwin" ; then + PLATFORM=Simulator + ARCH=i386 + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=i386" + MCPU="" +elif test "${host_alias}" = "armv6-apple-darwin" ; then + ARCH=armv6 + PLATFORM=OS + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" + MCPU="-mcpu=arm1176jzf-s" +elif test "${host_alias}" = "armv7-apple-darwin" ; then + ARCH=armv7 + PLATFORM=OS + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" + MCPU="-mcpu=cortex-a8" +elif test "${host_alias}" = "armv7s-apple-darwin" ; then + ARCH=armv7s + PLATFORM=OS + CMAKE_OPTS="-DCMAKE_SYSTEM_PROCESSOR=arm" +else + echo "bad host ${host_alias} must be either i386-apple-darwin or armv6-apple-darwin" + exit +fi +echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}" +XCODE_DEV_PATH=`xcode-select -print-path` +#new path with Xcode 4.3: +if test -d ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then + SDK_PATH_LIST=`ls -drt ${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=${XCODE_DEV_PATH}/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin +else + SDK_PATH_LIST=`ls -drt /Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*` + SDK_BIN_PATH=/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/usr/bin +fi + +for SYSROOT_PATH in $SDK_PATH_LIST ; do echo $SYSROOT_PATH ; done ; +echo "Selecting SDK path = ${SYSROOT_PATH}" +COMMON_FLAGS=" -arch ${ARCH} ${MCPU} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS" +CC="${SDK_BIN_PATH}/gcc -std=c99 $COMMON_FLAGS" +OBJC="${SDK_BIN_PATH}/gcc -std=c99 $COMMON_FLAGS" +CXX="${SDK_BIN_PATH}/g++ $COMMON_FLAGS" +LD="${SDK_BIN_PATH}/ld -arch ${ARCH}" +AR=${SDK_BIN_PATH}/ar +RANLIB=${SDK_BIN_PATH}/ranlib + +CPPFLAGS="-Dasm=__asm" +OBJCFLAGS="-x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch" diff --git a/submodules/build/iphone-config.site b/submodules/build/iphone-config.site index 125bdebcd..2c93fa080 100644 --- a/submodules/build/iphone-config.site +++ b/submodules/build/iphone-config.site @@ -40,12 +40,12 @@ fi for SYSROOT_PATH in $SDK_PATH_LIST ; do echo $SYSROOT_PATH ; done ; echo "Selecting SDK path = ${SYSROOT_PATH}" COMMON_FLAGS=" -arch ${ARCH} ${MCPU} -isysroot ${SYSROOT_PATH} -miphoneos-version-min=${SDK_VERSION} -DTARGET_OS_IPHONE=1 -D__IOS" -CC="${SDK_BIN_PATH}/gcc -std=c99 $COMMON_FLAGS" -OBJC="${SDK_BIN_PATH}/gcc -std=c99 $COMMON_FLAGS" -CXX="${SDK_BIN_PATH}/g++ $COMMON_FLAGS" -LD="${SDK_BIN_PATH}/ld -arch ${ARCH}" -AR=${SDK_BIN_PATH}/ar -RANLIB=${SDK_BIN_PATH}/ranlib +CC="xcrun clang -std=c99 $COMMON_FLAGS" +OBJC="xcrun clang -std=c99 $COMMON_FLAGS" +CXX="xcrun clang++ $COMMON_FLAGS" +LD="xcrun ld -arch ${ARCH}" +AR="xcrun ar" +RANLIB="xcrun ranlib" CPPFLAGS="-Dasm=__asm" OBJCFLAGS="-x objective-c -fexceptions -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch" diff --git a/submodules/externals/speex b/submodules/externals/speex index e780bd2ce..3c3178184 160000 --- a/submodules/externals/speex +++ b/submodules/externals/speex @@ -1 +1 @@ -Subproject commit e780bd2ce36af4133fd0ff304ab2078f1dacaaf6 +Subproject commit 3c317818481b67e0dd732e5dc045d6b981a8775b From adacafb30b24102e6d322fe0354503b17d79010c Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 3 Jun 2013 16:13:03 +0200 Subject: [PATCH 12/14] fix contact management + update liblinphone --- Classes/ContactDetailsTableViewController.m | 132 +++++++++++--------- Classes/LinphoneManager.m | 5 +- Resources/linphonerc-factory | 4 +- submodules/linphone | 2 +- 4 files changed, 77 insertions(+), 66 deletions(-) diff --git a/Classes/ContactDetailsTableViewController.m b/Classes/ContactDetailsTableViewController.m index 7b64c2990..42332e723 100644 --- a/Classes/ContactDetailsTableViewController.m +++ b/Classes/ContactDetailsTableViewController.m @@ -253,6 +253,68 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C [self.tableView reloadData]; } +-(Entry *) setOrCreateSipContactEntry:(Entry *)entry withValue:(NSString*)value { + ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); + ABMutableMultiValueRef lMap; + if(lcMap != NULL) { + lMap = ABMultiValueCreateMutableCopy(lcMap); + CFRelease(lcMap); + } else { + lMap = ABMultiValueCreateMutable(kABStringPropertyType); + } + ABMultiValueIdentifier index; + NSError* error = NULL; + + CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; + CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; + CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); + if (entry) { + index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + ABMultiValueReplaceValueAtIndex(lMap, lDict, index); + } else { + + CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; + ABMultiValueAddValueAndLabel(lMap, lDict, label, &index); + } + if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, (CFErrorRef*)&error)) { + [LinphoneLogger log:LinphoneLoggerLog format:@"Can't set contact with value [%@] cause [%@]", value,[error localizedDescription]]; + } else { + if (entry == nil) { + entry = [[Entry alloc] initWithData:index]; + } + CFRelease(lDict); + /*check if message type is kept or not*/ + lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); + lMap = ABMultiValueCreateMutableCopy(lcMap); + CFRelease(lcMap); + index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); + lDict = ABMultiValueCopyValueAtIndex(lMap,index); + if(!CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { + /*too bad probably a gtalk number, storing uri*/ + NSString* username = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); + LinphoneAddress* address = linphone_core_interpret_url([LinphoneManager getLc] + ,[username UTF8String]); + char* uri = linphone_address_as_string_uri_only(address); + CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; + CFTypeRef values[] = { [NSString stringWithCString:uri encoding:[NSString defaultCStringEncoding]], [LinphoneManager instance].contactSipField }; + CFDictionaryRef lDict2 = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); + ABMultiValueReplaceValueAtIndex(lMap, lDict2, index); + if (!ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, (CFErrorRef*)&error)) { + [LinphoneLogger log:LinphoneLoggerLog format:@"Can't set contact with value [%@] cause [%@]", value,[error localizedDescription]]; + } + CFRelease(lDict2); + linphone_address_destroy(address); + ms_free(uri); + } + CFRelease(lMap); + } + CFRelease(lDict); + + return entry; +} +-(void) setSipContactEntry:(Entry *)entry withValue:(NSString*)value { + [self setOrCreateSipContactEntry:entry withValue:value]; +} - (void)addEntry:(UITableView*)tableview section:(NSInteger)section animated:(BOOL)animated { [self addEntry:tableview section:section animated:animated value:@""]; } @@ -287,33 +349,15 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C } CFRelease(lMap); } else if(contactSections[section] == ContactSections_Sip) { - ABMultiValueIdentifier identifier; - ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); - ABMutableMultiValueRef lMap; - if(lcMap != NULL) { - lMap = ABMultiValueCreateMutableCopy(lcMap); - CFRelease(lcMap); - } else { - lMap = ABMultiValueCreateMutable(kABDictionaryPropertyType); - } - CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey }; - CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; - CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 1, NULL, NULL); - CFStringRef label = (CFStringRef)[labelArray objectAtIndex:0]; - if(!ABMultiValueAddValueAndLabel(lMap, lDict, label, &identifier)) { - added = false; - } - CFRelease(lDict); - - if(added && ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, (CFErrorRef*)&error)) { - Entry *entry = [[Entry alloc] initWithData:identifier]; - [sectionArray addObject:entry]; - [entry release]; - } else { - added = false; - [LinphoneLogger log:LinphoneLoggerError format:@"Can't add entry: %@", [error localizedDescription]]; - } - CFRelease(lMap); + Entry *entry = [self setOrCreateSipContactEntry:nil withValue:value]; + if (entry) { + [sectionArray addObject:entry]; + [entry release]; + added=true; + } else { + added=false; + [LinphoneLogger log:LinphoneLoggerError format:@"Can't add entry for value: %@", value]; + } } else if(contactSections[section] == ContactSections_Email) { ABMultiValueIdentifier identifier; ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonEmailProperty); @@ -842,39 +886,7 @@ static const int contactSections[ContactSections_MAX] = {ContactSections_None, C ABRecordSetValue(contact, kABPersonPhoneProperty, lMap, nil); CFRelease(lMap); } else if(contactSections[[path section]] == ContactSections_Sip) { - ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); - ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); - CFRelease(lcMap); - int index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [value copy], [LinphoneManager instance].contactSipField }; - CFDictionaryRef lDict = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); - ABMultiValueReplaceValueAtIndex(lMap, lDict, index); - ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); - CFRelease(lDict); - /*check if message type is kept or not*/ - lcMap = ABRecordCopyValue(contact, kABPersonInstantMessageProperty); - lMap = ABMultiValueCreateMutableCopy(lcMap); - CFRelease(lcMap); - index = ABMultiValueGetIndexForIdentifier(lMap, [entry identifier]); - lDict = ABMultiValueCopyValueAtIndex(lMap,index); - if(!CFDictionaryContainsKey(lDict, kABPersonInstantMessageServiceKey)) { - /*too bad probably a gtalk number, storing uri*/ - NSString* username = CFDictionaryGetValue(lDict, kABPersonInstantMessageUsernameKey); - LinphoneAddress* address = linphone_core_interpret_url([LinphoneManager getLc] - ,[username UTF8String]); - char* uri = linphone_address_as_string_uri_only(address); - CFStringRef keys[] = { kABPersonInstantMessageUsernameKey, kABPersonInstantMessageServiceKey}; - CFTypeRef values[] = { [NSString stringWithCString:uri encoding:[NSString defaultCStringEncoding]], [LinphoneManager instance].contactSipField }; - CFDictionaryRef lDict2 = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, NULL, NULL); - ABMultiValueReplaceValueAtIndex(lMap, lDict2, index); - ABRecordSetValue(contact, kABPersonInstantMessageProperty, lMap, nil); - CFRelease(lDict2); - linphone_address_destroy(address); - ms_free(uri); - } - CFRelease(lDict); - CFRelease(lMap); + [self setSipContactEntry:entry withValue:value]; } else if(contactSections[[path section]] == ContactSections_Email) { ABMultiValueRef lcMap = ABRecordCopyValue(contact, kABPersonEmailProperty); ABMutableMultiValueRef lMap = ABMultiValueCreateMutableCopy(lcMap); diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index 882dae154..bd1cdf406 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -842,10 +842,9 @@ static LinphoneCoreVTable linphonec_vtable = { ,self); linphone_core_set_user_agent(theLinphoneCore,"LinphoneIPhone", [[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey] UTF8String]); + [_contactSipField release]; + _contactSipField = [[self lpConfigStringForKey:@"contact_im_type_value" withDefault:@"SIP"] retain]; - _contactSipField = [self lpConfigStringForKey:@"contact_im_type_value"]; - if (_contactSipField == nil) - _contactSipField =@"SIP"; fastAddressBook = [[FastAddressBook alloc] init]; diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index cc6384010..92e740b16 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -49,5 +49,5 @@ stun=stun.linphone.org display_filter_auto_rotate=0 [app] -#contact_display_username_only=1 -#contact_filter_on_default_domain=1 +contact_display_username_only=1 +contact_filter_on_default_domain=1 diff --git a/submodules/linphone b/submodules/linphone index 5355e3775..f1eb0ec07 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 5355e37750d8c32fbd978161966ba80390a8bec0 +Subproject commit f1eb0ec07fda4221722ef1de098824299c85fd0a From fd20018d6b186e2da54874bebf46fb808470288f Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 3 Jun 2013 16:17:19 +0200 Subject: [PATCH 13/14] fix wrong linphonerc-factory --- Resources/linphonerc-factory | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Resources/linphonerc-factory b/Resources/linphonerc-factory index 92e740b16..cc6384010 100644 --- a/Resources/linphonerc-factory +++ b/Resources/linphonerc-factory @@ -49,5 +49,5 @@ stun=stun.linphone.org display_filter_auto_rotate=0 [app] -contact_display_username_only=1 -contact_filter_on_default_domain=1 +#contact_display_username_only=1 +#contact_filter_on_default_domain=1 From 8227e6f49b5a7024c7c8451c1e6d1ac6fec39bb9 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 3 Jun 2013 16:24:24 +0200 Subject: [PATCH 14/14] update linphone --- submodules/linphone | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/linphone b/submodules/linphone index f1eb0ec07..638cff943 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit f1eb0ec07fda4221722ef1de098824299c85fd0a +Subproject commit 638cff9433c3787a74b2db79aebc19092d6323b4