diff --git a/Classes/LinphoneManager.m b/Classes/LinphoneManager.m index b50f77ebd..752f99051 100644 --- a/Classes/LinphoneManager.m +++ b/Classes/LinphoneManager.m @@ -33,6 +33,7 @@ #include "linphone/linphonecore_utils.h" #include "lpconfig.h" +#include "mediastreamer2/mscommon.h" #define LINPHONE_LOGS_MAX_ENTRY 5000 @@ -70,6 +71,9 @@ extern void libmsamr_init(); #ifdef HAVE_X264 extern void libmsx264_init(); #endif +#ifdef HAVE_OPENH264 +extern void libmsopenh264_init(); +#endif #define FRONT_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:1" /*"AV Capture: Front Camera"*/ #define BACK_CAM_NAME "AV Capture: com.apple.avfoundation.avcapturedevice.built-in_video:0" /*"AV Capture: Back Camera"*/ @@ -1035,6 +1039,8 @@ static LinphoneCoreVTable linphonec_vtable = { connectivity = none; signal(SIGPIPE, SIG_IGN); + ms_init(); // Need to initialize mediastreamer2 before loading the plugins + libmsilbc_init(); #if defined (HAVE_SILK) libmssilk_init(); @@ -1045,6 +1051,9 @@ static LinphoneCoreVTable linphonec_vtable = { #ifdef HAVE_X264 libmsx264_init(); //load x264 plugin if present from the liblinphone sdk #endif +#ifdef HAVE_OPENH264 + libmsopenh264_init(); //load openh264 plugin if present from the liblinphone sdk +#endif #if HAVE_G729 libmsbcg729_init(); // load g729 plugin @@ -1132,6 +1141,7 @@ static LinphoneCoreVTable linphonec_vtable = { [LinphoneLogger logc:LinphoneLoggerLog format:"Destroy linphonecore"]; linphone_core_destroy(theLinphoneCore); theLinphoneCore = nil; + ms_exit(); // Uninitialize mediastreamer2 // Post event NSDictionary *dict = [NSDictionary dictionaryWithObject:[NSValue valueWithPointer:theLinphoneCore] forKey:@"core"]; diff --git a/linphone.xcodeproj/project.pbxproj b/linphone.xcodeproj/project.pbxproj index 8f01f7220..f16cbd3a5 100755 --- a/linphone.xcodeproj/project.pbxproj +++ b/linphone.xcodeproj/project.pbxproj @@ -10,6 +10,8 @@ 045B5CB318D72E9A0088350C /* libbzrtp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 045B5CB218D72E9A0088350C /* libbzrtp.a */; }; 15017E701773578400784ACB /* libxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15017E6F1773578400784ACB /* libxml2.a */; }; 15017E71177357C500784ACB /* libxml2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 15017E6F1773578400784ACB /* libxml2.a */; }; + 1560821D18EEF23F00765332 /* libwels.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1560821C18EEF23F00765332 /* libwels.a */; }; + 1560821F18EEF26100765332 /* libmsopenh264.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1560821E18EEF26100765332 /* libmsopenh264.a */; }; 1599105316F746B2007BF52B /* route_bluetooth_off_default_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104316F746B2007BF52B /* route_bluetooth_off_default_landscape.png */; }; 1599105416F746B2007BF52B /* route_bluetooth_off_default_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104316F746B2007BF52B /* route_bluetooth_off_default_landscape.png */; }; 1599105516F746B2007BF52B /* route_bluetooth_off_disabled_landscape.png in Resources */ = {isa = PBXBuildFile; fileRef = 1599104416F746B2007BF52B /* route_bluetooth_off_disabled_landscape.png */; }; @@ -1488,6 +1490,8 @@ /* Begin PBXFileReference section */ 045B5CB218D72E9A0088350C /* libbzrtp.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libbzrtp.a; path = "liblinphone-sdk/apple-darwin/lib/libbzrtp.a"; sourceTree = ""; }; 15017E6F1773578400784ACB /* libxml2.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libxml2.a; path = "liblinphone-sdk/apple-darwin/lib/libxml2.a"; sourceTree = ""; }; + 1560821C18EEF23F00765332 /* libwels.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libwels.a; path = "liblinphone-sdk/apple-darwin/lib/libwels.a"; sourceTree = ""; }; + 1560821E18EEF26100765332 /* libmsopenh264.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libmsopenh264.a; path = "liblinphone-sdk/apple-darwin/lib/mediastreamer/plugins/libmsopenh264.a"; sourceTree = ""; }; 1599104316F746B2007BF52B /* route_bluetooth_off_default_landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = route_bluetooth_off_default_landscape.png; path = Resources/route_bluetooth_off_default_landscape.png; sourceTree = ""; }; 1599104416F746B2007BF52B /* route_bluetooth_off_disabled_landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = route_bluetooth_off_disabled_landscape.png; path = Resources/route_bluetooth_off_disabled_landscape.png; sourceTree = ""; }; 1599104516F746B2007BF52B /* route_bluetooth_off_over_landscape.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = route_bluetooth_off_over_landscape.png; path = Resources/route_bluetooth_off_over_landscape.png; sourceTree = ""; }; @@ -2589,6 +2593,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 1560821F18EEF26100765332 /* libmsopenh264.a in Frameworks */, + 1560821D18EEF23F00765332 /* libwels.a in Frameworks */, 15017E701773578400784ACB /* libxml2.a in Frameworks */, 22AF73C21754C0D100BE8398 /* libopus.a in Frameworks */, 57B0E360173C010400A476B8 /* libpolarssl.a in Frameworks */, @@ -3403,6 +3409,8 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 1560821E18EEF26100765332 /* libmsopenh264.a */, + 1560821C18EEF23F00765332 /* libwels.a */, F0B89C2118DC89E30050B60E /* MediaPlayer.framework */, F03A9B9718C0DB6F00C4D7FE /* libc++.dylib */, F03A9B9418C0DAE100C4D7FE /* libstdc++.dylib */, @@ -6448,7 +6456,7 @@ GCC_PREFIX_HEADER = linphone_Prefix.pch; GCC_PREPROCESSOR_DEFINITIONS = ( VIDEO_ENABLED, - HAVE_X264, + HAVE_OPENH264, HAVE_SILK, HAVE_SSL, DEBUG, @@ -6518,7 +6526,7 @@ GCC_PREPROCESSOR_DEFINITIONS = ( IN_LINPHONE, VIDEO_ENABLED, - HAVE_X264, + HAVE_OPENH264, HAVE_SILK, HAVE_SSL, );