From b66d57d5b5cba9d5e98c1dced00a489dd677923e Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 15 Oct 2015 16:30:15 +0200 Subject: [PATCH 1/5] submodules: update linphone --- Classes/IncomingCallViewController.m | 2 +- submodules/linphone | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/IncomingCallViewController.m b/Classes/IncomingCallViewController.m index 2ee789c8e..beef707b6 100644 --- a/Classes/IncomingCallViewController.m +++ b/Classes/IncomingCallViewController.m @@ -93,7 +93,7 @@ static UICompositeViewDescription *compositeDescription = nil; [self dismiss]; } else if ([LinphoneManager.instance lpConfigBoolForKey:@"auto_answer"]) { LinphoneCallState state = linphone_call_get_state(call); - if (state == LinphoneCallIncomingReceived || state == LinphoneCallIncomingEarlyMedia) { + if (state == LinphoneCallIncomingReceived) { [self onAcceptClick:nil]; } } diff --git a/submodules/linphone b/submodules/linphone index 1dc50acfd..00e96f59f 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 1dc50acfd10b48ca23e96a3311eaadec7aa40b86 +Subproject commit 00e96f59f7af7fd7a47421ea0f118036182f8ea6 From e47b87d6e1ea27bf78242cb0bd27e11287603ca9 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 15 Oct 2015 16:44:55 +0200 Subject: [PATCH 2/5] prepare.py: update README --- README.md | 6 +++--- prepare.py | 23 +++++++++-------------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 3dfdc0228..3aa492dce 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ You can also choose to enable/disable features one by one (custom audio/video co You can for instance enable X264 by using: - ./prepare.py -DENABLE_X264=ON [other options] + ./prepare.py -DENABLE_NON_FREE_CODECS=ON -DENABLE_X264=ON [other options] ## Built architectures @@ -74,7 +74,7 @@ After the SDK is built, just open the Linphone Xcode project with Xcode, and pre The liblinphone SDK is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs. Linphone controls the embedding of these codecs by generating dummy libraries when there are not available. You can enable them using `prepare.py` - script (see `--enable-non-free-codecs` option). Before embedding these 4 codecs in the final application, **make sure to have the right to do so**. + script (see `--enable-non-free-codecs` option). Before embedding patent codecs in the final application, **make sure to have the right to do so**. # Testing the application @@ -85,7 +85,7 @@ Simply press `⌘U` and the default simulator / device will launch and try to pa # Limitations and known bugs -* Video capture will not work in simulator (not implemented in it). +* Video capture will not work in simulator (simulator limitation). # Debugging the SDK diff --git a/prepare.py b/prepare.py index aca19f628..91ddcfcba 100755 --- a/prepare.py +++ b/prepare.py @@ -362,35 +362,30 @@ zipres: help-prepare-options: \t@echo "prepare.py was previously executed with the following options:" -\t@echo " {options}" +\t@echo "\t{options}" help: help-prepare-options \t@echo "" \t@echo "(please read the README.md file first)" \t@echo "" \t@echo "Available architectures: {archs}" -\t@echo "Available packages: {packages}" \t@echo "" -\t@echo "Available targets:" +\t@echo "=== Available targets ===" \t@echo "" -\t@echo " * all or build: builds all architectures and creates the liblinphone SDK" -\t@echo " * sdk: creates the liblinphone SDK. Use this only after a full build" +\t@echo " * all or build (default): builds all architectures and creates the liblinphone SDK." +\t@echo " * dev: rebuilds liblinphone for all architectures. You must invoke 'sdk' target after this." +\t@echo " * sdk: creates the liblinphone SDK. Use this only after a full build." \t@echo " * zipsdk: generates a ZIP archive of liblinphone-sdk/apple-darwin containing the SDK. Use this only after SDK is built." -\t@echo " * zipres: creates a tar.gz file with all the resources (images)" +\t@echo " * zipres: creates a tar.gz file with all the resources (images)." \t@echo "" \t@echo "=== Advanced usage ===" \t@echo "" -\t@echo " * build-[package]: builds the package for all architectures" -\t@echo " * clean-[package]: cleans package compilation for all architectures" -\t@echo " * veryclean-[package]: cleans the package for all architectures" -\t@echo "" -\t@echo " * [{arch_opts}]-build-[package]: builds a package for the selected architecture" -\t@echo " * [{arch_opts}]-clean-[package]: cleans package compilation for the selected architecture" -\t@echo " * [{arch_opts}]-veryclean-[package]: cleans the package for the selected architecture" +\t@echo " * [{arch_opts}]-build: rebuilds everything for a single architecture. You must invoke 'sdk' target after this." +\t@echo " * [{arch_opts}]-dev: rebuilds liblinphone for a single architecture. You must invoke 'sdk' target after this." \t@echo "" """.format(archs=' '.join(platforms), arch_opts='|'.join(platforms), first_arch=platforms[0], options=' '.join(sys.argv), - arch_targets=arch_targets, packages=' '.join(packages), + arch_targets=arch_targets, multiarch=multiarch, generator=generator) f = open('Makefile', 'w') f.write(makefile) From 5faeeeef448bceefbed9cbcd37465c4019ecebec Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 15 Oct 2015 17:01:04 +0200 Subject: [PATCH 3/5] [Outgrade submodule] cmake: Temporary revert new build procedure until full migration Revert "prepare.py: update README" This reverts commit e47b87d6e1ea27bf78242cb0bd27e11287603ca9. Revert "Update linphone-cmake-builder submodule." This reverts commit f340644f63e2f16e1f78858006d97d9c14e0197c. Revert "Use the projects grouping feature of linphone-cmake-builder." This reverts commit 94e103798d50b84add3c69cd565f8273f3b30892. --- README.md | 6 +-- prepare.py | 101 ++++++++++++++++++++++++++++++------- submodules/bzrtp | 2 +- submodules/cmake-builder | 2 +- submodules/libilbc-rfc3951 | 2 +- submodules/msamr | 2 +- submodules/msilbc | 2 +- submodules/msopenh264 | 2 +- submodules/mssilk | 2 +- submodules/mswebrtc | 2 +- submodules/msx264 | 2 +- 11 files changed, 94 insertions(+), 31 deletions(-) diff --git a/README.md b/README.md index 3aa492dce..3dfdc0228 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ You can also choose to enable/disable features one by one (custom audio/video co You can for instance enable X264 by using: - ./prepare.py -DENABLE_NON_FREE_CODECS=ON -DENABLE_X264=ON [other options] + ./prepare.py -DENABLE_X264=ON [other options] ## Built architectures @@ -74,7 +74,7 @@ After the SDK is built, just open the Linphone Xcode project with Xcode, and pre The liblinphone SDK is compiled with third parties code that are subject to patent license, specially: AMR, SILK G729 and H264 codecs. Linphone controls the embedding of these codecs by generating dummy libraries when there are not available. You can enable them using `prepare.py` - script (see `--enable-non-free-codecs` option). Before embedding patent codecs in the final application, **make sure to have the right to do so**. + script (see `--enable-non-free-codecs` option). Before embedding these 4 codecs in the final application, **make sure to have the right to do so**. # Testing the application @@ -85,7 +85,7 @@ Simply press `⌘U` and the default simulator / device will launch and try to pa # Limitations and known bugs -* Video capture will not work in simulator (simulator limitation). +* Video capture will not work in simulator (not implemented in it). # Debugging the SDK diff --git a/prepare.py b/prepare.py index 91ddcfcba..ac46643c2 100755 --- a/prepare.py +++ b/prepare.py @@ -50,7 +50,6 @@ class IOSTarget(prepare.Target): self.toolchain_file = 'toolchains/toolchain-ios-' + arch + '.cmake' self.output = 'liblinphone-sdk/' + arch + '-apple-darwin.ios' self.additional_args = [ - '-DLINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS=YES', '-DLINPHONE_BUILDER_EXTERNAL_SOURCE_PATH=' + current_path + '/submodules' ] @@ -279,16 +278,56 @@ def generate_makefile(platforms, generator): arch_targets += """ {arch}: {arch}-build -{arch}-build: -\t{generator} WORK/ios-{arch}/cmake +{arch}-build: $(addprefix {arch}-build-, $(packages)) \t@echo "Done" -WORK/ios-{arch}/build.done: -\t$(MAKE) {arch}-build && touch WORK/ios-{arch}/build.done - -{arch}-dev: WORK/ios-{arch}/build.done -\t{generator} WORK/ios-{arch}/Build/linphone_builder +{arch}-clean: $(addprefix {arch}-clean-, $(packages)) \t@echo "Done" + +{arch}-veryclean: $(addprefix {arch}-veryclean-, $(packages)) +\t@echo "Done" + +{arch}-build-%: package-in-list-% +\trm -f WORK/ios-{arch}/Stamp/EP_$*/EP_$*-update; \\ +\t{generator} WORK/ios-{arch}/cmake EP_$* + +{arch}-clean-%: package-in-list-% +\t{generator} WORK/ios-{arch}/Build/$* clean; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_$*/EP_$*-build; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_$*/EP_$*-install; + +{arch}-veryclean-%: package-in-list-% +\ttest -f WORK/ios-{arch}/Build/$*/install_manifest.txt && \\ +\tcat WORK/ios-{arch}/Build/$*/install_manifest.txt | xargs rm; \\ +\trm -rf WORK/ios-{arch}/Build/$*/*; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_$*/*; \\ +\techo "Run 'make {arch}-build-$*' to rebuild $* correctly."; + +{arch}-veryclean-ffmpeg: +\t{generator} WORK/ios-{arch}/Build/ffmpeg uninstall; \\ +\trm -rf WORK/ios-{arch}/Build/ffmpeg/*; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_ffmpeg/*; \\ +\techo "Run 'make {arch}-build-ffmpeg' to rebuild ffmpeg correctly."; + +{arch}-clean-openh264: +\tcd WORK/ios-{arch}/Build/openh264; \\ +\t$(MAKE) -f ../../../../submodules/externals/openh264/Makefile clean; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_openh264/EP_openh264-build; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_openh264/EP_openh264-install; + +{arch}-veryclean-openh264: +\trm -rf liblinphone-sdk/{arch}-apple-darwin.ios/include/wels; \\ +\trm -f liblinphone-sdk/{arch}-apple-darwin.ios/lib/libopenh264.*; \\ +\trm -rf WORK/ios-{arch}/Build/openh264/*; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_openh264/*; \\ +\techo "Run 'make {arch}-build-openh264' to rebuild openh264 correctly."; + +{arch}-veryclean-vpx: +\trm -rf liblinphone-sdk/{arch}-apple-darwin.ios/include/vpx; \\ +\trm -f liblinphone-sdk/{arch}-apple-darwin.ios/lib/libvpx.*; \\ +\trm -rf WORK/ios-{arch}/Build/vpx/*; \\ +\trm -f WORK/ios-{arch}/Stamp/EP_vpx/*; \\ +\techo "Run 'make {arch}-build-vpx' to rebuild vpx correctly."; """.format(arch=arch, generator=generator) multiarch = "" for arch in platforms[1:]: @@ -302,14 +341,33 @@ WORK/ios-{arch}/build.done: """.format(first_arch=platforms[0], arch=arch) makefile = """ archs={archs} +packages={packages} LINPHONE_IPHONE_VERSION=$(shell git describe --always) .PHONY: all .SILENT: sdk +#turn off parallelism because it is not yet handled properly +.NOTPARALLEL: all: build -dev: $(addsuffix -dev, $(archs)) -\t$(MAKE) sdk +package-in-list-%: +\tif ! grep -q " $* " <<< " $(packages) "; then \\ +\t\techo "$* not in list of available packages: $(packages)"; \\ +\t\texit 3; \\ +\tfi + +build-%: package-in-list-% $(addsuffix -build-%, $(archs)) +\t@echo "Build of $* terminated" + +clean-%: package-in-list-% $(addsuffix -clean, $(archs)) +\t@echo "Clean of $* terminated" + +veryclean-%: package-in-list-% $(addsuffix -veryclean, $(archs)) +\t@echo "Veryclean of $* terminated" + +clean: $(addprefix clean-,$(packages)) + +veryclean: $(addprefix veryclean-,$(packages)) sdk: \tfor arch in $(archs); do {generator} WORK/ios-$$arch/cmake EP_dummy_libraries; done && \\ @@ -362,30 +420,35 @@ zipres: help-prepare-options: \t@echo "prepare.py was previously executed with the following options:" -\t@echo "\t{options}" +\t@echo " {options}" help: help-prepare-options \t@echo "" \t@echo "(please read the README.md file first)" \t@echo "" \t@echo "Available architectures: {archs}" +\t@echo "Available packages: {packages}" \t@echo "" -\t@echo "=== Available targets ===" +\t@echo "Available targets:" \t@echo "" -\t@echo " * all or build (default): builds all architectures and creates the liblinphone SDK." -\t@echo " * dev: rebuilds liblinphone for all architectures. You must invoke 'sdk' target after this." -\t@echo " * sdk: creates the liblinphone SDK. Use this only after a full build." +\t@echo " * all or build: builds all architectures and creates the liblinphone SDK" +\t@echo " * sdk: creates the liblinphone SDK. Use this only after a full build" \t@echo " * zipsdk: generates a ZIP archive of liblinphone-sdk/apple-darwin containing the SDK. Use this only after SDK is built." -\t@echo " * zipres: creates a tar.gz file with all the resources (images)." +\t@echo " * zipres: creates a tar.gz file with all the resources (images)" \t@echo "" \t@echo "=== Advanced usage ===" \t@echo "" -\t@echo " * [{arch_opts}]-build: rebuilds everything for a single architecture. You must invoke 'sdk' target after this." -\t@echo " * [{arch_opts}]-dev: rebuilds liblinphone for a single architecture. You must invoke 'sdk' target after this." +\t@echo " * build-[package]: builds the package for all architectures" +\t@echo " * clean-[package]: cleans package compilation for all architectures" +\t@echo " * veryclean-[package]: cleans the package for all architectures" +\t@echo "" +\t@echo " * [{arch_opts}]-build-[package]: builds a package for the selected architecture" +\t@echo " * [{arch_opts}]-clean-[package]: cleans package compilation for the selected architecture" +\t@echo " * [{arch_opts}]-veryclean-[package]: cleans the package for the selected architecture" \t@echo "" """.format(archs=' '.join(platforms), arch_opts='|'.join(platforms), first_arch=platforms[0], options=' '.join(sys.argv), - arch_targets=arch_targets, + arch_targets=arch_targets, packages=' '.join(packages), multiarch=multiarch, generator=generator) f = open('Makefile', 'w') f.write(makefile) diff --git a/submodules/bzrtp b/submodules/bzrtp index 4c9fc9539..7f0b84802 160000 --- a/submodules/bzrtp +++ b/submodules/bzrtp @@ -1 +1 @@ -Subproject commit 4c9fc9539a06483da62938e8ae0ea48b18d026e6 +Subproject commit 7f0b84802a6e1d1f99efb95de4d9b460069a3f23 diff --git a/submodules/cmake-builder b/submodules/cmake-builder index 58a2a71ee..e5ddd8925 160000 --- a/submodules/cmake-builder +++ b/submodules/cmake-builder @@ -1 +1 @@ -Subproject commit 58a2a71ee6d4bc5f0a4f77958375a832b18253ed +Subproject commit e5ddd892561b0c5df25b7036bd9229fe6a6ea81a diff --git a/submodules/libilbc-rfc3951 b/submodules/libilbc-rfc3951 index 91b61e39f..a6bb1eb6d 160000 --- a/submodules/libilbc-rfc3951 +++ b/submodules/libilbc-rfc3951 @@ -1 +1 @@ -Subproject commit 91b61e39fb9c5d3dc78691f3d6e4f1d65c8b0d2a +Subproject commit a6bb1eb6dab5541cdded6a1f0326539234954c5d diff --git a/submodules/msamr b/submodules/msamr index e56ef9f86..c2a0886a9 160000 --- a/submodules/msamr +++ b/submodules/msamr @@ -1 +1 @@ -Subproject commit e56ef9f86989bafa9a0e808ed4b34c2264c6e10d +Subproject commit c2a0886a9350004e3da94d968cae9978c7472a9d diff --git a/submodules/msilbc b/submodules/msilbc index bf4815c4c..b5a2b0702 160000 --- a/submodules/msilbc +++ b/submodules/msilbc @@ -1 +1 @@ -Subproject commit bf4815c4cf9574afeae7c6b28347b747085019fc +Subproject commit b5a2b070259ef0c4f404fa8ca87752b8b1259d76 diff --git a/submodules/msopenh264 b/submodules/msopenh264 index 78ed115b5..9be271700 160000 --- a/submodules/msopenh264 +++ b/submodules/msopenh264 @@ -1 +1 @@ -Subproject commit 78ed115b583ee43473f982d370d85d2f86754dac +Subproject commit 9be271700b377a251b95e9d8dbe0e8b878a403ac diff --git a/submodules/mssilk b/submodules/mssilk index 49306ca45..dd9dd3e81 160000 --- a/submodules/mssilk +++ b/submodules/mssilk @@ -1 +1 @@ -Subproject commit 49306ca4566480e08a0b64f1323bfc9f354d41bf +Subproject commit dd9dd3e81719972232d9d4df7bc5e7c5282722bb diff --git a/submodules/mswebrtc b/submodules/mswebrtc index 9f7b3128b..eecba24b5 160000 --- a/submodules/mswebrtc +++ b/submodules/mswebrtc @@ -1 +1 @@ -Subproject commit 9f7b3128b9c6b396c89d784ba5ddfa68be05607a +Subproject commit eecba24b5559c89e123991ab1f32f35649b7ebe8 diff --git a/submodules/msx264 b/submodules/msx264 index 2e9b11b82..e8fd6adb5 160000 --- a/submodules/msx264 +++ b/submodules/msx264 @@ -1 +1 @@ -Subproject commit 2e9b11b8255a305adcc8e94ff3f77b6a2c08418e +Subproject commit e8fd6adb59e9015c1bfe58e364565016ef26122c From f48e8122c57a75856a7c7f77ba87db5b3810f329 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 16 Oct 2015 10:44:00 +0200 Subject: [PATCH 4/5] ChatRoom: avoid potential misposition of chatbubble when sending text --- Classes/ChatRoomViewController.m | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 452e5392a..f24e58882 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -283,11 +283,10 @@ static void message_status(LinphoneChatMessage *msg, LinphoneChatMessageState st [LinphoneManager setValueInMessageAppData:[internalUrl absoluteString] forKey:@"localimage" inMessage:msg]; } + linphone_chat_room_send_message2(chatRoom, msg, message_status, (__bridge void *)(self)); [tableController addChatEntry:msg]; [tableController scrollToBottom:true]; - linphone_chat_room_send_message2(chatRoom, msg, message_status, (__bridge void *)(self)); - return TRUE; } From 20fcf449fc55a75e3369d4cff2c614cc678f6d42 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 16 Oct 2015 11:09:03 +0200 Subject: [PATCH 5/5] Utils.m: properly handle UTF8 logging --- Classes/Utils/Utils.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Classes/Utils/Utils.m b/Classes/Utils/Utils.m index 06ba6f344..8b857cf36 100644 --- a/Classes/Utils/Utils.m +++ b/Classes/Utils/Utils.m @@ -28,15 +28,17 @@ va_list args; va_start(args, format); NSString *str = [[NSString alloc] initWithFormat:format arguments:args]; + NSStringEncoding enc = CFStringConvertEncodingToNSStringEncoding(CFStringGetSystemEncoding()); + const char *utf8str = [str cStringUsingEncoding:enc]; int filesize = 20; const char *filename = strchr(file, '/') ? strrchr(file, '/') + 1 : file; if (severity <= ORTP_DEBUG) { // lol: ortp_debug(XXX) can be disabled at compile time, but ortp_log(ORTP_DEBUG, xxx) will always be valid even // not in debug build... - ortp_debug("%*s:%3d - %s", filesize, filename + MAX((int)strlen(filename) - filesize, 0), line, str.UTF8String); + ortp_debug("%*s:%3d - %s", filesize, filename + MAX((int)strlen(filename) - filesize, 0), line, utf8str); } else { ortp_log(severity, "%*s:%3d - %s", filesize, filename + MAX((int)strlen(filename) - filesize, 0), line, - str.UTF8String); + utf8str); } va_end(args); }