From 7d7c860c973cbe205a33530ac7854bfcd0534dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 1 Aug 2014 17:28:14 +0200 Subject: [PATCH 01/19] Update mediastreamer2 submodule --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 47df383ea..c68891876 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 47df383ea1631ef1171e10ecf4d6d8333979c3fd +Subproject commit c68891876f9b29b41302c0b53106dde64842b7b0 From 09b56423dc50d974808cd15dc937aaf71258940b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Sun, 3 Aug 2014 21:04:09 +0200 Subject: [PATCH 02/19] Fix compilation with Visual Studio. --- coreapi/chat.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index 165d71ac3..c9ec8b6d5 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -184,11 +184,12 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co belle_http_provider_send_request(msg->chat_room->lc->http_provider,req,l); } if (code == 200 ) { /* file has been uploaded correctly, get server reply and send it */ + const char *body; /* TODO Check that the transfer has not been cancelled, note this shall be removed once the belle sip API will provide a cancel request as we shall never reach this part if the transfer is actually cancelled */ if (msg->http_request == NULL) { return; } - const char *body = belle_sip_message_get_body((belle_sip_message_t *)event->response); + body = belle_sip_message_get_body((belle_sip_message_t *)event->response); msg->message = ms_strdup(body); linphone_content_uninit(msg->file_transfer_information); ms_free(msg->file_transfer_information); From 48a2e6622c24e13dd2edd625d31a72a54a5e0692 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Sun, 3 Aug 2014 22:46:25 +0200 Subject: [PATCH 03/19] Improve compilation with CMake by using CMake modules to find the dependencies. --- CMakeLists.txt | 51 ++++++++++++++++++++++++++++++++++---- coreapi/CMakeLists.txt | 45 ++++++++++++++++++++++++--------- share/CMakeLists.txt | 29 ++++++++++++++++------ share/rings/CMakeLists.txt | 22 ++++++++++++++++ 4 files changed, 123 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae3952338..725126296 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,59 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2014 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. +# +############################################################################ + cmake_minimum_required(VERSION 2.6) project(LINPHONE C) -option(LINPHONE_ENABLE_VIDEO "Build linphone with video support." ON) + +option(ENABLE_STATIC "Build static library (default is shared library)." NO) +option(ENABLE_VIDEO "Build with video support." YES) + + +list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules) + +include(CheckIncludeFile) + +if(MSVC) + list(APPEND CMAKE_REQUIRED_INCLUDES ${CMAKE_PREFIX_PATH}/include/MSVC) +endif() + +find_package(BelleSIP REQUIRED) +find_package(MS2 REQUIRED) +find_package(XML2 REQUIRED) + include_directories( include/ coreapi/ ${CMAKE_CURRENT_BINARY_DIR}/coreapi/ + ${BELLESIP_INCLUDE_DIRS} + ${MS2_INCLUDE_DIRS} + ${XML2_INCLUDE_DIRS} ) -include_directories( - ${CMAKE_INSTALL_PREFIX}/include - ${CMAKE_INSTALL_PREFIX}/include/libxml2 -) +if(MSVC) + include_directories(${CMAKE_PREFIX_PATH}/include/MSVC) +endif() + add_subdirectory(coreapi) add_subdirectory(share) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 1fb5f2add..e6f530ee9 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -1,12 +1,29 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2014 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. +# +############################################################################ + if(MSVC) find_library(LIBGCC NAMES gcc) find_library(LIBMINGWEX NAMES mingwex) endif() -find_library(LIBORTP NAMES ortp) -find_library(LIBMEDIASTREAMER_BASE NAMES mediastreamer_base) -find_library(LIBMEDIASTREAMER_VOIP NAMES mediastreamer_voip) -find_library(LIBBELLESIP NAMES bellesip) -find_library(LIBXML2 NAMES xml2) find_program(GIT git) @@ -111,19 +128,23 @@ add_definitions( -DLINPHONE_PLUGINS_DIR="" ) -if(LINPHONE_ENABLE_VIDEO) +if(ENABLE_VIDEO) add_definitions(-DVIDEO_ENABLED) -endif(LINPHONE_ENABLE_VIDEO) +endif() +set(LIBS + ${LIBGCC} + ${LIBMINGWEX} + ${BELLESIP_LIBRARIES} + ${MS2_LIBRARIES} + ${XML2_LIBRARIES} +) if(WIN32) add_definitions( -DWINDOW_NATIVE /FIliblinphone_gitversion.h ) - -set(LIBS ws2_32) -endif(WIN32) -set(LIBS ${LIBS} ${LIBGCC} ${LIBMINGWEX} ${LIBORTP} ${LIBMEDIASTREAMER_BASE} ${LIBMEDIASTREAMER_VOIP} ${LIBBELLESIP} ${LIBXML2}) +endif() add_library(linphone SHARED ${SOURCE_FILES}) set_target_properties(linphone PROPERTIES VERSION 3.7.0 SOVERSION 5) @@ -150,4 +171,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/linphone.pdb PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() -endif(WIN32) +endif() diff --git a/share/CMakeLists.txt b/share/CMakeLists.txt index 8d15a6f5c..03b36a74d 100644 --- a/share/CMakeLists.txt +++ b/share/CMakeLists.txt @@ -1,17 +1,32 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2014 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. +# +############################################################################ + install(FILES archived-rootca.pem RENAME rootca.pem - COMPONENT COMP_liblinphone DESTINATION share/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) install(FILES ringback.wav - COMPONENT COMP_liblinphone DESTINATION share/sounds/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) add_subdirectory(rings) - -install(FILES ../mediastreamer2/src/voip/nowebcamCIF.jpg - COMPONENT COMP_liblinphone - DESTINATION share/images - PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) diff --git a/share/rings/CMakeLists.txt b/share/rings/CMakeLists.txt index cf359bb4e..63f2c47ac 100644 --- a/share/rings/CMakeLists.txt +++ b/share/rings/CMakeLists.txt @@ -1,3 +1,25 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2014 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. +# +############################################################################ + install(FILES oldphone.wav toy-mono.wav COMPONENT COMP_liblinphone DESTINATION share/sounds/linphone/rings From 113dece9cc4474a3d13954d5a56842e5c6d5e4f4 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 4 Aug 2014 09:07:28 +0200 Subject: [PATCH 04/19] fix liblinphone android tester --- console/commands.c | 2 +- tester/liblinphone_tester.c | 8 +++----- tester/liblinphone_tester.h | 2 ++ tester/tester.c | 21 +++++++++++++++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/console/commands.c b/console/commands.c index 009d8724b..f0b44bdd5 100644 --- a/console/commands.c +++ b/console/commands.c @@ -515,7 +515,7 @@ lpc_cmd_help(LinphoneCore *lc, char *arg) i=0; while (advanced_commands[i].help) { - linphonec_out("%10.10s\t%s\n", advanced_commands[i].name, + linphonec_out("%20.20s\t%s\n", advanced_commands[i].name, advanced_commands[i].help); i++; } diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index b11cbefaf..5fb91605c 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -27,9 +27,6 @@ #ifdef ANDROID -extern void AndroidPrintf(FILE *stream, const char *fmt, ...); -#define fprintf(file, fmt, ...) AndroidPrintf(file, fmt, ##__VA_ARGS__) - #include #include #include @@ -118,8 +115,9 @@ static void liblinphone_tester_qnx_log_handler(OrtpLogLevel lev, const char *fmt #endif /* __QNX__ */ + void helper(const char *name) { - fprintf(stderr,"%s --help\n" + liblinphone_tester_fprintf(stderr,"%s --help\n" "\t\t\t--verbose\n" "\t\t\t--silent\n" "\t\t\t--list-suites\n" @@ -197,7 +195,7 @@ int main (int argc, char *argv[]) liblinphone_tester_list_suite_tests(suite_name); return 0; } else { - fprintf(stderr, "Unknown option \"%s\"\n", argv[i]); \ + liblinphone_tester_fprintf(stderr, "Unknown option \"%s\"\n", argv[i]); \ helper(argv[0]); return -1; } diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 8fbeafc31..7eb7ab456 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -248,5 +248,7 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana void liblinphone_tester_clock_start(MSTimeSpec *start); bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms); +int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict format, ...); + #endif /* LIBLINPHONE_TESTER_H_ */ diff --git a/tester/tester.c b/tester/tester.c index d0faca038..a5a74a8af 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -294,7 +294,7 @@ int liblinphone_tester_test_suite_index(const char *suite_name) { void liblinphone_tester_list_suites() { int j; for(j=0;j Date: Mon, 4 Aug 2014 09:35:16 +0200 Subject: [PATCH 05/19] Update oRTP and ms2 submodules. --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index c68891876..44675f02a 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c68891876f9b29b41302c0b53106dde64842b7b0 +Subproject commit 44675f02ad01445478e2be8ad1ab533f74737bf0 diff --git a/oRTP b/oRTP index 1fc29ba46..7aaba994d 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 1fc29ba469c5bb1dbfc19c64e8dac382913d2fa7 +Subproject commit 7aaba994d4ec860a0773679dee9baa018b8801ee From 528f2e1582fd669c4685623f4b93aa292b30411e Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Mon, 4 Aug 2014 09:42:09 +0200 Subject: [PATCH 06/19] fix android liblinphone_tester_fprintf --- tester/liblinphone_tester.h | 6 ++++-- tester/tester.c | 10 +++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 7eb7ab456..9b2eeeb60 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -247,8 +247,10 @@ void liblinphone_tester_chat_message_state_change(LinphoneChatMessage* msg,Linph void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreManager* callee); void liblinphone_tester_clock_start(MSTimeSpec *start); bool_t liblinphone_tester_clock_elapsed(const MSTimeSpec *start, int value_ms); - -int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict format, ...); +#ifdef ANDROID +void cunit_android_trace_handler(int level, const char *fmt, va_list args) ; +#endif +int liblinphone_tester_fprintf(FILE * stream, const char * format, ...); #endif /* LIBLINPHONE_TESTER_H_ */ diff --git a/tester/tester.c b/tester/tester.c index a5a74a8af..12dd60a4a 100644 --- a/tester/tester.c +++ b/tester/tester.c @@ -443,12 +443,7 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name) CU_cleanup_registry(); return ret; } -#ifdef ANDROID -/*implemented in cunit*/ -extern void AndroidPrintf(FILE *stream, const char *fmt, ...); -#endif - -int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict format, ...) { +int liblinphone_tester_fprintf(FILE * stream, const char * format, ...) { va_list args; va_start(args, format); int result; @@ -456,7 +451,8 @@ int liblinphone_tester_fprintf(FILE * restrict stream, const char * restrict fo result = vfprintf(stream,format,args); #else /*used by liblinphone tester to retrieve suite list*/ - result = AndroidPrintf(stream, format, args); + result = 0; + cunit_android_trace_handler(stream, format, args); #endif va_end(args); return result; From 5547298f2527cb04a6fcef5b8092184b735a5981 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 4 Aug 2014 14:26:03 +0200 Subject: [PATCH 07/19] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 44675f02a..37ca88370 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 44675f02ad01445478e2be8ad1ab533f74737bf0 +Subproject commit 37ca88370e57fda9488d4523db46197beb36df94 From 9d547808651d3a4f1272da69a3e11afd4c4fd171 Mon Sep 17 00:00:00 2001 From: Margaux Clerc Date: Mon, 4 Aug 2014 14:28:40 +0200 Subject: [PATCH 08/19] Add jni for adaptive rate control --- coreapi/linphonecore_jni.cc | 14 ++++++++++++++ java/common/org/linphone/core/LinphoneCore.java | 12 ++++++++++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 11 +++++++++++ 3 files changed, 37 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 1f01ccadf..fc6b76f1f 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1287,6 +1287,20 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getPayloadTypeBitrate(JN return (jint)linphone_core_get_payload_type_bitrate((LinphoneCore*)lc,(PayloadType*)pt); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableAdaptiveRateControl(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jboolean enable) { + linphone_core_enable_adaptive_rate_control((LinphoneCore*)lc, enable); +} + +extern "C" jboolean Java_org_linphone_core_LinphoneCoreImpl_isAdaptiveRateControlEnabled(JNIEnv* env + ,jobject thiz + ,jlong lc + ) { + return (jboolean)linphone_core_adaptive_rate_control_enabled((LinphoneCore*)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableEchoCancellation(JNIEnv* env ,jobject thiz ,jlong lc diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 332a85be0..a74ebc125 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -707,6 +707,18 @@ public interface LinphoneCore { */ int getPayloadTypeBitrate(PayloadType pt); + /** + * Enable adaptive rate control. + * @param enable + */ + void enableAdaptiveRateControl(boolean enable); + + /** + * Enables or disable adaptive rate control. + * @return true if adaptive rate control is enabled. + */ + boolean isAdaptiveRateControlEnabled(); + /** * Enables or disable echo cancellation. * @param enable diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index eeebbd328..04a679f1a 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -73,6 +73,8 @@ class LinphoneCoreImpl implements LinphoneCore { private native long findPayloadType(long nativePtr, String mime, int clockRate, int channels); private native int enablePayloadType(long nativePtr, long payloadType, boolean enable); private native boolean isPayloadTypeEnabled(long nativePtr, long payloadType); + private native void enableAdaptiveRateControl(long nativePtr,boolean enable); + private native boolean isAdaptiveRateControlEnabled(long nativePtr); private native void enableEchoCancellation(long nativePtr,boolean enable); private native boolean isEchoCancellationEnabled(long nativePtr); private native Object getCurrentCall(long nativePtr) ; @@ -1190,5 +1192,14 @@ class LinphoneCoreImpl implements LinphoneCore { public synchronized int getPayloadTypeBitrate(PayloadType pt) { return getPayloadTypeBitrate(nativePtr, ((PayloadTypeImpl)pt).nativePtr); } + @Override + public void enableAdaptiveRateControl(boolean enable) { + enableAdaptiveRateControl(nativePtr,enable); + + } + @Override + public boolean isAdaptiveRateControlEnabled() { + return isAdaptiveRateControlEnabled(nativePtr); + } } From 9582124ed567f82a127d2062da0e2176feb49390 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 4 Aug 2014 18:17:41 +0200 Subject: [PATCH 09/19] Update mediastreamer2 submodule --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 37ca88370..cc94bbd37 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 37ca88370e57fda9488d4523db46197beb36df94 +Subproject commit cc94bbd3703acf2794093e948be08e39bed3d58c From d4665fde599479ae199c45a4a48281592cce9715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Mon, 4 Aug 2014 18:18:03 +0200 Subject: [PATCH 10/19] Add "Call recording" test to the Call suite --- tester/call_tester.c | 47 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index b507b5855..c07e29e86 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -18,6 +18,8 @@ #include +#include +#include #include "CUnit/Basic.h" #include "linphonecore.h" #include "lpconfig.h" @@ -2647,6 +2649,48 @@ static void savpf_to_savpf_call(void) { profile_call(TRUE, TRUE, TRUE, TRUE, "RTP/SAVPF"); } +static void call_recording() { + LinphoneCoreManager *marie = NULL, *pauline = NULL; + LinphoneCallParams *params = NULL; + const MSList *calls = NULL; + LinphoneCall *callInst = NULL; + const char filename[] = "recording.mkv"; + const char dirname[] = ".test"; + char *filepath = NULL; + + filepath = ms_new0(char, strlen(dirname) + strlen(filename) + 2); + strcpy(filepath, dirname); + strcat(filepath, "/"); + strcat(filepath, filename); + if(access(dirname, F_OK) != 0) { + CU_ASSERT_EQUAL(mkdir(dirname, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH), 0); + } + CU_ASSERT_EQUAL(access(dirname, W_OK), 0); + if(access(filepath, F_OK) == 0) { + CU_ASSERT_EQUAL(remove(filepath), 0); + } + + marie = linphone_core_manager_new("marie_rc"); + pauline = linphone_core_manager_new("pauline_rc"); + params = linphone_core_create_default_call_parameters(marie->lc); + linphone_call_params_set_record_file(params, filepath); + + CU_ASSERT_TRUE(call_with_caller_params(marie, pauline, params)); + calls = linphone_core_get_calls(marie->lc); + CU_ASSERT_PTR_NOT_NULL(calls); + callInst = (LinphoneCall *)calls->data; + linphone_call_start_recording(callInst); + sleep(2); + linphone_call_stop_recording(callInst); + + CU_ASSERT_EQUAL(access(filepath, F_OK), 0); + end_call(marie, pauline); + + linphone_core_manager_destroy(marie); + linphone_core_manager_destroy(pauline); + ms_free(filepath); +} + test_t call_tests[] = { { "Early declined call", early_declined_call }, { "Call declined", call_declined }, @@ -2735,7 +2779,8 @@ test_t call_tests[] = { { "SAVPF to AVP call", savpf_to_avp_call }, { "SAVPF to AVPF call", savpf_to_avpf_call }, { "SAVPF to SAVP call", savpf_to_savp_call }, - { "SAVPF to SAVPF call", savpf_to_savpf_call } + { "SAVPF to SAVPF call", savpf_to_savpf_call }, + { "Call recording", call_recording } }; test_suite_t call_test_suite = { From 9725f1596b61096dfdc2126c0122c0f8247a764b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 4 Aug 2014 22:11:49 +0200 Subject: [PATCH 11/19] Improve compilation with CMake. --- CMakeLists.txt | 35 ++++++++++++++- config.h.cmake | 28 ++++++++++++ coreapi/CMakeLists.txt | 95 ++++++++++++++-------------------------- coreapi/gitversion.cmake | 38 ++++++++++++++++ 4 files changed, 134 insertions(+), 62 deletions(-) create mode 100644 config.h.cmake create mode 100644 coreapi/gitversion.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 725126296..94f49e8f0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,11 +21,33 @@ ############################################################################ cmake_minimum_required(VERSION 2.6) -project(LINPHONE C) +project(LINPHONE C CXX) +set(LINPHONE_MAJOR_VERSION "3") +set(LINPHONE_MINOR_VERSION "7") +set(LINPHONE_MICRO_VERSION "0") +set(LINPHONE_VERSION "${LINPHONE_MAJOR_VERSION}.${LINPHONE_MINOR_VERSION}.${LINPHONE_MICRO_VERSION}") +set(LINPHONE_SO_VERSION "6") + + +include(CMakeDependentOption) + option(ENABLE_STATIC "Build static library (default is shared library)." NO) +option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." YES) +option(ENABLE_DATE "Use build date in internal version number." NO) +option(ENABLE_GTK_UI "Turn on or off compilation of gtk interface." YES) +option(ENABLE_LDAP "Enable LDAP support." NO) +option(ENABLE_MSG_STORAGE "Turn on compilation of message storage." YES) +option(ENABLE_NOTIFY "Enable libnotify support." YES) +option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO) +option(ENABLE_TOOLS "Turn on or off compilation of console interface" YES) +option(ENABLE_TUNNEL "Turn on compilation of tunnel support." NO) +option(ENABLE_TUTORIALS "Enable compilation of tutorials." YES) +option(ENABLE_UNIT_TESTS "Enable compilation of unit tests." YES) +option(ENABLE_UPNP "Build with uPnP support." YES) option(ENABLE_VIDEO "Build with video support." YES) +cmake_dependent_option(ENABLE_ASSISTANT "Turn on assistant compiling." YES "ENABLE_GTK_UI" NO) list(APPEND CMAKE_MODULE_PATH ${CMAKE_PREFIX_PATH}/share/cmake/Modules) @@ -44,6 +66,7 @@ find_package(XML2 REQUIRED) include_directories( include/ coreapi/ + ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/coreapi/ ${BELLESIP_INCLUDE_DIRS} ${MS2_INCLUDE_DIRS} @@ -55,5 +78,15 @@ if(MSVC) endif() +if(ENABLE_RELATIVE_PREFIX) + set(LINPHONE_PLUGINS_DIR "./lib/liblinphone/plugins") +else() + set(LINPHONE_PLUGINS_DIR "${CMAKE_INSTALL_PREFIX}/lib/liblinphone/plugins") +endif() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/config.h PROPERTIES GENERATED ON) +add_definitions(-DHAVE_CONFIG_H) + + add_subdirectory(coreapi) add_subdirectory(share) diff --git a/config.h.cmake b/config.h.cmake new file mode 100644 index 000000000..6f8db1a86 --- /dev/null +++ b/config.h.cmake @@ -0,0 +1,28 @@ +/*************************************************************************** +* config.h.cmake +* Copyright (C) 2014 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. +* +****************************************************************************/ + +#define LINPHONE_MAJOR_VERSION ${LINPHONE_MAJOR_VERSION} +#define LINPHONE_MINOR_VERSION ${LINPHONE_MINOR_VERSION} +#define LINPHONE_MICRO_VERSION ${LINPHONE_MICRO_VERSION} +#define LINPHONE_VERSION "${LINPHONE_VERSION}" + +#cmakedefine LINPHONE_PLUGINS_DIR "${LINPHONE_PLUGINS_DIR}" diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index e6f530ee9..ff39dfb41 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -25,40 +25,6 @@ if(MSVC) find_library(LIBMINGWEX NAMES mingwex) endif() -find_program(GIT git) - -set(GIT_VERSION "unknown") -if(GIT) - execute_process( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${GIT} describe --always - OUTPUT_VARIABLE GIT_DESCRIBE - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - execute_process( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${GIT} describe --abbrev=0 - OUTPUT_VARIABLE GIT_TAG - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - execute_process( - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${GIT} rev-parse HEAD - OUTPUT_VARIABLE GIT_REVISION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(GIT_DESCRIBE) - set(GIT_VERSION ${GIT_DESCRIBE}) - else(GIT_DESCRIBE) - if(GIT_REVISION) - set(GIT_VERSION ${GIT_REVISION}) - endif(GIT_REVISION) - endif(GIT_DESCRIBE) -endif(GIT) -execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "#define LIBLINPHONE_GIT_VERSION \"${GIT_VERSION}\"" - OUTPUT_FILE ${CMAKE_CURRENT_BINARY_DIR}/liblinphone_gitversion.h -) set(SOURCE_FILES address.c @@ -85,7 +51,6 @@ set(SOURCE_FILES info.c linphonecall.c linphonecore.c - #linphone_tunnel.cc linphone_tunnel_stubs.c linphone_tunnel_config.c lpconfig.c @@ -100,7 +65,6 @@ set(SOURCE_FILES sal.c siplogin.c sipsetup.c - #TunnelManager.cc xml.c xml2lpc.c bellesip_sal/sal_impl.h @@ -116,16 +80,26 @@ set(SOURCE_FILES sipsetup.h xml2lpc.h ) +if(ENABLE_TUNNEL) + list(APPEND SOURCE_FILES + linphone_tunnel.cc + TunnelManager.cc + ) + add_definitions(-DTUNNEL_ENABLED) +endif() + +set(GENERATED_SOURCE_FILES + ${CMAKE_CURRENT_BINARY_DIR}/liblinphone_gitversion.h +) +set_source_files_properties(${GENERATED_SOURCE_FILES} PROPERTIES GENERATED TRUE) +find_package(Git) +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/liblinphone_gitversion.h + COMMAND ${CMAKE_COMMAND} -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -DOUTPUT_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/gitversion.cmake) add_definitions( - -D_TRUE_TIME -DIN_LINPHONE -DUSE_BELLESIP - #-DTUNNEL_ENABLED - -DLINPHONE_PACKAGE_NAME="linphone" - -DLINPHONE_VERSION="Devel" -DLIBLINPHONE_EXPORTS - -DLINPHONE_PLUGINS_DIR="" ) if(ENABLE_VIDEO) @@ -139,23 +113,30 @@ set(LIBS ${MS2_LIBRARIES} ${XML2_LIBRARIES} ) -if(WIN32) -add_definitions( - -DWINDOW_NATIVE - /FIliblinphone_gitversion.h -) + +if(ENABLE_STATIC) + add_library(linphone STATIC ${SOURCE_FILES} ${GENERATED_SOURCE_FILES}) + target_link_libraries(linphone ${LIBS}) +else() + add_library(linphone SHARED ${SOURCE_FILES} ${GENERATED_SOURCE_FILES}) + set_target_properties(linphone PROPERTIES VERSION ${LINPHONE_VERSION} SOVERSION ${LINPHONE_SO_VERSION} LINKER_LANGUAGE CXX) + target_link_libraries(linphone ${LIBS}) + if(MSVC) + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/linphone.pdb + DESTINATION bin + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) + endif() + endif() endif() -add_library(linphone SHARED ${SOURCE_FILES}) -set_target_properties(linphone PROPERTIES VERSION 3.7.0 SOVERSION 5) - -target_link_libraries(linphone ${LIBS}) - install(TARGETS linphone - RUNTIME DESTINATION bin + RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE +) file(GLOB HEADER_FILES "*.h") @@ -164,11 +145,3 @@ install(FILES ${HEADER_FILES} DESTINATION include/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) -if(WIN32) -if(CMAKE_BUILD_TYPE STREQUAL "Debug") -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/linphone.pdb - DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE -) -endif() -endif() diff --git a/coreapi/gitversion.cmake b/coreapi/gitversion.cmake new file mode 100644 index 000000000..1a6ec406c --- /dev/null +++ b/coreapi/gitversion.cmake @@ -0,0 +1,38 @@ +############################################################################ +# CMakeLists.txt +# Copyright (C) 2014 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. +# +############################################################################ + +if(GIT_EXECUTABLE) + execute_process( + COMMAND ${GIT_EXECUTABLE} describe --always + OUTPUT_VARIABLE GIT_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + execute_process( + COMMAND ${CMAKE_COMMAND} -E echo "#define GIT_VERSION \"${GIT_REVISION}\"" + OUTPUT_FILE ${OUTPUT_DIR}/liblinphone_gitversion.h + ) +else() + execute_process( + COMMAND ${CMAKE_COMMAND} -E echo "#define GIT_VERSION \"unknown\"" + OUTPUT_FILE ${OUTPUT_DIR}/liblinphone_gitversion.h + ) +endif() From 0046baac1bfa3e027b901646c7315b2cec8ecce1 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 5 Aug 2014 12:02:22 +0200 Subject: [PATCH 12/19] Updated ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index cc94bbd37..2af3b2c25 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit cc94bbd3703acf2794093e948be08e39bed3d58c +Subproject commit 2af3b2c257c21278aa1b08fbb0f8a15da14f5471 From 7ec17111b0113481083334fc3bb0509542dd2e9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 5 Aug 2014 15:07:18 +0200 Subject: [PATCH 13/19] Add video support to the "Call recording" test --- mediastreamer2 | 2 +- tester/call_tester.c | 67 ++++++++++++++++++++++++++++---------------- 2 files changed, 44 insertions(+), 25 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index 2af3b2c25..e3fe44b86 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 2af3b2c257c21278aa1b08fbb0f8a15da14f5471 +Subproject commit e3fe44b86513914192078d2096d83592cfeb41ff diff --git a/tester/call_tester.c b/tester/call_tester.c index c07e29e86..095df01c9 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -27,7 +27,7 @@ #include "liblinphone_tester.h" static void call_base(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy); -static void disable_all_codecs_except_one(LinphoneCore *lc, const char *mime); +static void disable_all_audio_codecs_except_one(LinphoneCore *lc, const char *mime); void call_state_changed(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *msg){ char* to=linphone_address_as_string(linphone_call_get_call_log(call)->to); @@ -427,8 +427,8 @@ static void call_with_specified_codec_bitrate(void) { goto end; } - disable_all_codecs_except_one(marie->lc,"opus"); - disable_all_codecs_except_one(pauline->lc,"opus"); + disable_all_audio_codecs_except_one(marie->lc,"opus"); + disable_all_audio_codecs_except_one(pauline->lc,"opus"); linphone_core_set_payload_type_bitrate(marie->lc, linphone_core_find_payload_type(marie->lc,"opus",48000,-1), @@ -537,7 +537,7 @@ static void cancelled_call(void) { linphone_core_manager_destroy(pauline); } -static void disable_all_codecs_except_one(LinphoneCore *lc, const char *mime){ +static void disable_all_audio_codecs_except_one(LinphoneCore *lc, const char *mime){ const MSList *elem=linphone_core_get_audio_codecs(lc); PayloadType *pt; @@ -550,13 +550,25 @@ static void disable_all_codecs_except_one(LinphoneCore *lc, const char *mime){ linphone_core_enable_payload_type(lc,pt,TRUE); } +static void disable_all_video_codecs_except_one(LinphoneCore *lc, const char *mime) { + const MSList *codecs = linphone_core_get_video_codecs(lc); + const MSList *it = NULL; + PayloadType *pt = NULL; + + for(it = codecs; it != NULL; it = it->next) { + linphone_core_enable_payload_type(lc, (PayloadType *)it->data, FALSE); + } + CU_ASSERT_PTR_NOT_NULL_FATAL(pt = linphone_core_find_payload_type(lc, mime, -1, -1)); + linphone_core_enable_payload_type(lc, pt, TRUE); +} + static void call_failed_because_of_codecs(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc"); LinphoneCall* out_call; - disable_all_codecs_except_one(marie->lc,"pcmu"); - disable_all_codecs_except_one(pauline->lc,"pcma"); + disable_all_audio_codecs_except_one(marie->lc,"pcmu"); + disable_all_audio_codecs_except_one(pauline->lc,"pcma"); out_call = linphone_core_invite(pauline->lc,"marie"); linphone_call_ref(out_call); CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneCallOutgoingInit,1)); @@ -1913,8 +1925,8 @@ static void early_media_call_with_update_base(bool_t media_change){ lcs = ms_list_append(lcs,marie->lc); lcs = ms_list_append(lcs,pauline->lc); if (media_change) { - disable_all_codecs_except_one(marie->lc,"pcmu"); - disable_all_codecs_except_one(pauline->lc,"pcmu"); + disable_all_audio_codecs_except_one(marie->lc,"pcmu"); + disable_all_audio_codecs_except_one(pauline->lc,"pcmu"); } /* @@ -1939,8 +1951,8 @@ static void early_media_call_with_update_base(bool_t media_change){ pauline_params = linphone_call_params_copy(linphone_call_get_current_params(pauline_call)); if (media_change) { - disable_all_codecs_except_one(marie->lc,"pcma"); - disable_all_codecs_except_one(pauline->lc,"pcma"); + disable_all_audio_codecs_except_one(marie->lc,"pcma"); + disable_all_audio_codecs_except_one(pauline->lc,"pcma"); } #define UPDATED_SESSION_NAME "nouveau nom de session" @@ -2649,10 +2661,11 @@ static void savpf_to_savpf_call(void) { profile_call(TRUE, TRUE, TRUE, TRUE, "RTP/SAVPF"); } -static void call_recording() { - LinphoneCoreManager *marie = NULL, *pauline = NULL; - LinphoneCallParams *params = NULL; - const MSList *calls = NULL; +static void recording_call() { + LinphoneCoreManager *marie = linphone_core_manager_new("marie_rc"); + LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc"); + LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc); + LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc); LinphoneCall *callInst = NULL; const char filename[] = "recording.mkv"; const char dirname[] = ".test"; @@ -2670,17 +2683,23 @@ static void call_recording() { CU_ASSERT_EQUAL(remove(filepath), 0); } - marie = linphone_core_manager_new("marie_rc"); - pauline = linphone_core_manager_new("pauline_rc"); - params = linphone_core_create_default_call_parameters(marie->lc); - linphone_call_params_set_record_file(params, filepath); + linphone_core_enable_video_display(marie->lc, TRUE); + linphone_core_enable_video_display(pauline->lc, FALSE); + linphone_core_enable_video_capture(marie->lc, TRUE); + linphone_core_enable_video_capture(pauline->lc, TRUE); + + linphone_call_params_enable_video(marieParams, TRUE); + linphone_call_params_set_record_file(marieParams, filepath); + linphone_call_params_enable_video(paulineParams, TRUE); + + disable_all_video_codecs_except_one(marie->lc, "H264"); + disable_all_video_codecs_except_one(pauline->lc, "H264"); + + CU_ASSERT_TRUE(call_with_params(marie, pauline, marieParams, paulineParams)); + CU_ASSERT_PTR_NOT_NULL(callInst = linphone_core_get_current_call(marie->lc)); - CU_ASSERT_TRUE(call_with_caller_params(marie, pauline, params)); - calls = linphone_core_get_calls(marie->lc); - CU_ASSERT_PTR_NOT_NULL(calls); - callInst = (LinphoneCall *)calls->data; linphone_call_start_recording(callInst); - sleep(2); + sleep(20); linphone_call_stop_recording(callInst); CU_ASSERT_EQUAL(access(filepath, F_OK), 0); @@ -2780,7 +2799,7 @@ test_t call_tests[] = { { "SAVPF to AVPF call", savpf_to_avpf_call }, { "SAVPF to SAVP call", savpf_to_savp_call }, { "SAVPF to SAVPF call", savpf_to_savpf_call }, - { "Call recording", call_recording } + { "Call recording", recording_call } }; test_suite_t call_test_suite = { From f056bb1085b23b34e8d35a1f6c7f68c3e46186d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 5 Aug 2014 15:54:00 +0200 Subject: [PATCH 14/19] Make "Call recording" tester writes in a wav file when video support is disabled. --- configure.ac | 2 +- mediastreamer2 | 2 +- tester/call_tester.c | 13 ++++++++++++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 092b41129..8d4c80155 100644 --- a/configure.ac +++ b/configure.ac @@ -537,7 +537,7 @@ fi dnl conditionnal build of video support AC_ARG_ENABLE(video, - [AS_HELP_STRING([--enable-video], [Turn on video support compiling])], + [AS_HELP_STRING([--enable-video], [Turn on video support compiling (default=yes)])], [case "${enableval}" in yes) video=true ;; no) video=false ;; diff --git a/mediastreamer2 b/mediastreamer2 index e3fe44b86..a1746a013 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit e3fe44b86513914192078d2096d83592cfeb41ff +Subproject commit a1746a0139adcd656f29019c8b251d3947fe5580 diff --git a/tester/call_tester.c b/tester/call_tester.c index 095df01c9..510988a13 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -550,6 +550,7 @@ static void disable_all_audio_codecs_except_one(LinphoneCore *lc, const char *mi linphone_core_enable_payload_type(lc,pt,TRUE); } +#ifdef VIDEO_ENABLED static void disable_all_video_codecs_except_one(LinphoneCore *lc, const char *mime) { const MSList *codecs = linphone_core_get_video_codecs(lc); const MSList *it = NULL; @@ -561,6 +562,7 @@ static void disable_all_video_codecs_except_one(LinphoneCore *lc, const char *mi CU_ASSERT_PTR_NOT_NULL_FATAL(pt = linphone_core_find_payload_type(lc, mime, -1, -1)); linphone_core_enable_payload_type(lc, pt, TRUE); } +#endif static void call_failed_because_of_codecs(void) { LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc"); @@ -2667,7 +2669,13 @@ static void recording_call() { LinphoneCallParams *marieParams = linphone_core_create_default_call_parameters(marie->lc); LinphoneCallParams *paulineParams = linphone_core_create_default_call_parameters(pauline->lc); LinphoneCall *callInst = NULL; + +#ifdef VIDEO_ENABLED const char filename[] = "recording.mkv"; +#else + const char filename[] = "recording.wav"; +#endif + const char dirname[] = ".test"; char *filepath = NULL; @@ -2683,17 +2691,20 @@ static void recording_call() { CU_ASSERT_EQUAL(remove(filepath), 0); } + linphone_call_params_set_record_file(marieParams, filepath); + +#ifdef VIDEO_ENABLED linphone_core_enable_video_display(marie->lc, TRUE); linphone_core_enable_video_display(pauline->lc, FALSE); linphone_core_enable_video_capture(marie->lc, TRUE); linphone_core_enable_video_capture(pauline->lc, TRUE); linphone_call_params_enable_video(marieParams, TRUE); - linphone_call_params_set_record_file(marieParams, filepath); linphone_call_params_enable_video(paulineParams, TRUE); disable_all_video_codecs_except_one(marie->lc, "H264"); disable_all_video_codecs_except_one(pauline->lc, "H264"); +#endif CU_ASSERT_TRUE(call_with_params(marie, pauline, marieParams, paulineParams)); CU_ASSERT_PTR_NOT_NULL(callInst = linphone_core_get_current_call(marie->lc)); From 4525fe436c2be26dfd4ff3aa28baef762ecc3621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 5 Aug 2014 16:08:37 +0200 Subject: [PATCH 15/19] Do not set video session wether the H264 payload connot be found --- tester/call_tester.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 510988a13..3269c6fe0 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -2694,16 +2694,20 @@ static void recording_call() { linphone_call_params_set_record_file(marieParams, filepath); #ifdef VIDEO_ENABLED - linphone_core_enable_video_display(marie->lc, TRUE); - linphone_core_enable_video_display(pauline->lc, FALSE); - linphone_core_enable_video_capture(marie->lc, TRUE); - linphone_core_enable_video_capture(pauline->lc, TRUE); + if((linphone_core_find_payload_type(marie->lc, "H264", -1, -1) != NULL) && (linphone_core_find_payload_type(pauline->lc, "H264", -1, -1) != NULL)) { + linphone_core_enable_video_display(marie->lc, TRUE); + linphone_core_enable_video_display(pauline->lc, FALSE); + linphone_core_enable_video_capture(marie->lc, TRUE); + linphone_core_enable_video_capture(pauline->lc, TRUE); - linphone_call_params_enable_video(marieParams, TRUE); - linphone_call_params_enable_video(paulineParams, TRUE); + linphone_call_params_enable_video(marieParams, TRUE); + linphone_call_params_enable_video(paulineParams, TRUE); - disable_all_video_codecs_except_one(marie->lc, "H264"); - disable_all_video_codecs_except_one(pauline->lc, "H264"); + disable_all_video_codecs_except_one(marie->lc, "H264"); + disable_all_video_codecs_except_one(pauline->lc, "H264"); + } else { + ms_warning("call_recording(): the H264 payload has not been found. Only sound will be recorded"); + } #endif CU_ASSERT_TRUE(call_with_params(marie, pauline, marieParams, paulineParams)); From d798b9686918a80e2e984be675552f056c5e229b Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 5 Aug 2014 15:41:33 +0200 Subject: [PATCH 16/19] Update README.mingw file. --- README.mingw | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/README.mingw b/README.mingw index 79e8ce547..8b97ea1ef 100644 --- a/README.mingw +++ b/README.mingw @@ -4,20 +4,20 @@ Software to install Download lastest mingw-get-setup.exe from http://www.mingw.org Run mingw-get-setup.exe. In the package list, select and install: -* mingw32-developer-tool +* mingw-developer-toolkit * mingw32-base * mingw32-gcc-g++ +* mingw32-pthreads-w32 * msys-base +* msys-zip +* msys-unzip +* msys-wget For more information: http://www.mingw.org/wiki/Getting_Started In mingw shell (also refered as msys), run -mingw-get install msys-zip -mingw-get install msys-unzip -mingw-get install msys-wget - mkdir -p /opt/perl/bin cp /bin/perl /opt/perl/bin/. @@ -48,7 +48,7 @@ libintl.a libintl.la libintl.dll.a * Download and install Inno Setup Compiler (required only if you run 'make setup.exe'). Add it to your windows Path environment variable. -* Install msys-git from (http://code.google.com/p/msysgit/). During installation you are asked to make a choice about how line endings are treated by git. Choose "Checkout line endings as they are, commit as they are". THIS CHOICE IS VERY IMPORTANT. OTHERS BREAK AUTOMAKE. +* Install msys-git from (http://msysgit.github.io/). During installation you are asked to make a choice about how line endings are treated by git. Choose "Checkout line endings as they are, commit as they are". THIS CHOICE IS VERY IMPORTANT. OTHERS BREAK AUTOMAKE. General rules for compilation @@ -98,7 +98,8 @@ Building plugins (optional) *************************** This the example for msx264 (H264 plugin), the same applies for other linphone plugins. - $ cd mediastreamer2/plugins/msx264 + $ git clone git://git.linphone.org/msx264.git + $ cd msx264 $ ./autogen.sh $ PKG_CONFIG_PATH=/usr/lib/pkgconfig ./configure --prefix=/usr --enable-shared --disable-static #make a binary zip of this plugin From 62bb9e0b8c3f523e342c2310432487c7f0699cf3 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 5 Aug 2014 16:00:53 +0200 Subject: [PATCH 17/19] Updated ms2 --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index a1746a013..70a029a00 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit a1746a0139adcd656f29019c8b251d3947fe5580 +Subproject commit 70a029a00f2b7272d8c790557e71ff8b73004b85 From 549c6f024aa0e2bde2f6467a81763bcaadc3c36d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 5 Aug 2014 16:18:21 +0200 Subject: [PATCH 18/19] Update oRTP submodule. --- oRTP | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oRTP b/oRTP index 7aaba994d..fc8d8457e 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 7aaba994d4ec860a0773679dee9baa018b8801ee +Subproject commit fc8d8457eb630907eff50333ddf5243b448fe733 From b17cab312acdd0efe81b76fb8570bcb50fb00d47 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 5 Aug 2014 16:18:43 +0200 Subject: [PATCH 19/19] Output the logs from a single thread. --- coreapi/linphonecore.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 299bdc27f..a3d618e96 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1331,6 +1331,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab linphone_core_set_state(lc,LinphoneGlobalStartup,"Starting up"); ortp_init(); + ortp_set_log_thread_id(ortp_thread_self()); lc->dyn_pt=96; lc->default_profile=rtp_profile_new("default profile"); linphone_core_assign_payload_type(lc,&payload_type_pcmu8000,0,NULL); @@ -2395,6 +2396,8 @@ void linphone_core_iterate(LinphoneCore *lc){ lp_config_sync(lc->config); } } + + ortp_logv_flush(); } /** @@ -6035,6 +6038,7 @@ static void linphone_core_uninit(LinphoneCore *lc) linphone_core_message_storage_close(lc); ms_exit(); linphone_core_set_state(lc,LinphoneGlobalOff,"Off"); + ortp_set_log_thread_id(0); } static void set_network_reachable(LinphoneCore* lc,bool_t isReachable, time_t curtime){