Merge remote-tracking branch 'origin/master' into wip_video_ui_improvements

Conflicts:
	Classes/LinphoneAppDelegate.m
	Classes/VideoViewController-ipad.xib
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2012-03-26 17:26:52 +02:00
commit dc169b7f21
17 changed files with 319 additions and 100 deletions

View file

@ -20,6 +20,7 @@
#import <UIKit/UIKit.h>
#import <AddressBookUI/ABPeoplePickerNavigationController.h>
#import "CoreTelephony/CTCallCenter.h"
#define DIALER_TAB_INDEX 1
#define CONTACTS_TAB_INDEX 2
@ -39,9 +40,14 @@
IBOutlet PhoneViewController* myPhoneViewController;
CallHistoryTableViewController* myCallHistoryTableViewController;
ContactPickerDelegate* myContactPickerDelegate;
CTCallCenter* callCenter;
}
- (void) loadDefaultSettings:(NSDictionary *) appDefaults;
-(void) setupUI;
-(void) setupGSMInteraction;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UITabBarController* myTabBarController;
@property (nonatomic, retain) ABPeoplePickerNavigationController* myPeoplePickerController;

View file

@ -22,6 +22,9 @@
#import "ContactPickerDelegate.h"
#import "AddressBook/ABPerson.h"
#import "CoreTelephony/CTCallCenter.h"
#import "CoreTelephony/CTCall.h"
#import "ConsoleViewController.h"
#import "MoreViewController.h"
#include "CallHistoryTableViewController.h"
@ -43,6 +46,24 @@ int __aeabi_idiv(int a, int b) {
@synthesize myPeoplePickerController;
@synthesize myPhoneViewController;
-(void) handleGSMCallInteration: (id) cCenter {
CTCallCenter* ct = (CTCallCenter*) cCenter;
int callCount = [ct.currentCalls count];
if (!callCount) {
NSLog(@"No GSM call -> enabling SIP calls");
linphone_core_set_max_calls([LinphoneManager getLc], 3);
} else {
NSLog(@"%d GSM call(s) -> disabling SIP calls", callCount);
/* pause current call, if any */
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
if (call) {
NSLog(@"Pausing SIP call");
linphone_core_pause_call([LinphoneManager getLc], call);
}
linphone_core_set_max_calls([LinphoneManager getLc], 0);
}
}
-(void)applicationWillResignActive:(UIApplication *)application {
LinphoneCore* lc = [LinphoneManager getLc];
@ -62,11 +83,31 @@ int __aeabi_idiv(int a, int b) {
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
[[LinphoneManager instance] enterBackgroundMode];
if (![[LinphoneManager instance] enterBackgroundMode]) {
// destroying eventHandler if app cannot go in background.
// Otherwise if a GSM call happen and Linphone is resumed,
// the handler will be called before LinphoneCore is built.
// Then handler will be restored in appDidBecomeActive cb
callCenter.callEventHandler = nil;
[callCenter release];
callCenter = nil;
}
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[LinphoneManager instance] becomeActive];
if (callCenter == nil) {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
}
// check call state at startup
[self handleGSMCallInteration:callCenter];
LinphoneCore* lc = [LinphoneManager getLc];
LinphoneCall* call = linphone_core_get_current_call(lc);
if (call == NULL)
@ -84,7 +125,7 @@ int __aeabi_idiv(int a, int b) {
}
}
- (void) loadDefaultSettings {
- (void) loadDefaultSettings:(NSDictionary *) appDefaults {
NSString *settingsBundle = [[NSBundle mainBundle] pathForResource:@"Settings" ofType:@"bundle"];
if(!settingsBundle) {
@ -108,32 +149,14 @@ int __aeabi_idiv(int a, int b) {
[defaultsToRegister setObject:[prefSpecification objectForKey:@"DefaultValue"] forKey:key];
}
}
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
#ifdef HAVE_AMR
@"YES",@"amr_8k_preference", // enable amr by default if compiled with
#endif
#ifdef HAVE_G729
@"YES",@"g729_preference", // enable amr by default if compiled with
#endif
@"NO",@"debugenable_preference",
//@"+33",@"countrycode_preference",
nil];
[defaultsToRegister addEntriesFromDictionary:appDefaults];
[[NSUserDefaults standardUserDefaults] registerDefaults:defaultsToRegister];
[defaultsToRegister release];
[[NSUserDefaults standardUserDefaults] synchronize];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
/*
*Custumization
*/
[self loadDefaultSettings];
//as defined in PhoneMainView.xib
-(void) setupUI {
//as defined in PhoneMainView.xib
//dialer
myPhoneViewController = (PhoneViewController*) [myTabBarController.viewControllers objectAtIndex: DIALER_TAB_INDEX];
myPhoneViewController.myTabBarController = myTabBarController;
@ -175,10 +198,44 @@ int __aeabi_idiv(int a, int b) {
[window makeKeyAndVisible];
[[LinphoneManager instance] setCallDelegate:myPhoneViewController];
}
-(void) setupGSMInteraction {
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
waitUntilDone:YES];
};
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{
NSDictionary *appDefaults = [NSDictionary dictionaryWithObjectsAndKeys:
@"NO", @"enable_first_login_view_preference", //
#ifdef HAVE_AMR
@"YES",@"amr_8k_preference", // enable amr by default if compiled with
#endif
#ifdef HAVE_G729
@"YES",@"g729_preference", // enable amr by default if compiled with
#endif
//@"+33",@"countrycode_preference",
nil];
/* explicitely instanciate LinphoneManager */
LinphoneManager* lm = [[LinphoneManager alloc] init];
assert(lm == [LinphoneManager instance]);
[self loadDefaultSettings: appDefaults];
[self setupUI];
[[LinphoneManager instance] startLibLinphone];
[[UIApplication sharedApplication] registerForRemoteNotificationTypes:UIRemoteNotificationTypeAlert|UIRemoteNotificationTypeSound];
[self setupGSMInteraction];
return YES;
}

View file

@ -37,10 +37,16 @@ typedef struct _CallContext {
bool_t cameraIsEnabled;
} CallContext;
struct NetworkReachabilityContext {
bool_t testWifi, testWWan;
void (*networkStateChanged) (Connectivity newConnectivity);
};
@interface LinphoneManager : NSObject <AVAudioSessionDelegate> {
@private
SCNetworkReachabilityContext proxyReachabilityContext;
@protected
SCNetworkReachabilityRef proxyReachability;
@private
NSTimer* mIterateTimer;
id<LogView> mLogView;
bool isbackgroundModeEnabled;
@ -70,13 +76,14 @@ typedef struct _CallContext {
-(BOOL) isNotIphone3G;
-(void) destroyLibLinphone;
-(void) enterBackgroundMode;
-(BOOL) enterBackgroundMode;
-(void) becomeActive;
-(void) kickOffNetworkConnection;
-(NSString*) getDisplayNameFromAddressBook:(NSString*) number andUpdateCallLog:(LinphoneCallLog*)log;
-(UIImage*) getImageFromAddressBook:(NSString*) number;
-(BOOL) reconfigureLinphoneIfNeeded:(NSDictionary *)oldSettings;
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx;
@property (nonatomic, retain) id<LinphoneUICallDelegate> callDelegate;
@property (nonatomic, retain) id<LinphoneUIRegistrationDelegate> registrationDelegate;
@ -85,4 +92,3 @@ typedef struct _CallContext {
@property (readonly) const char* backCamId;
@end

View file

@ -57,14 +57,16 @@ extern void libmsbcg729_init();
@synthesize backCamId;
-(id) init {
assert (!theLinphoneManager);
if ((self= [super init])) {
mFastAddressBook = [[FastAddressBook alloc] init];
theLinphoneManager = self;
}
return self;
}
+(LinphoneManager*) instance {
if (theLinphoneManager==nil) {
theLinphoneManager = [[LinphoneManager alloc] init];
[[LinphoneManager alloc] init];
}
return theLinphoneManager;
}
@ -387,6 +389,7 @@ static void linphone_iphone_call_state(LinphoneCore *lc, LinphoneCall* call, Lin
cancelButtonTitle:NSLocalizedString(@"Continue",nil)
otherButtonTitles:nil ,nil];
[error show];
[error release];
}
}
@ -447,16 +450,21 @@ static LinphoneCoreVTable linphonec_vtable = {
CFWriteStreamClose (writeStream);
}
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void * info) {
void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReachabilityFlags flags, void* nilCtx) {
ms_message("Network connection flag [%x]",flags);
LinphoneManager* lLinphoneMgr = (LinphoneManager*)info;
LinphoneManager* lLinphoneMgr = [LinphoneManager instance];
if ([LinphoneManager getLc] != nil) {
struct NetworkReachabilityContext* ctx = nilCtx ? ((struct NetworkReachabilityContext*)nilCtx) : 0;
if ((flags == 0) | (flags & (kSCNetworkReachabilityFlagsConnectionRequired |kSCNetworkReachabilityFlagsConnectionOnTraffic))) {
[[LinphoneManager instance] kickOffNetworkConnection];
linphone_core_set_network_reachable([LinphoneManager getLc],false);
((LinphoneManager*)info).connectivity = none;
lLinphoneMgr.connectivity = none;
} else {
Connectivity newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
Connectivity newConnectivity;
if (!ctx || ctx->testWWan)
newConnectivity = flags & kSCNetworkReachabilityFlagsIsWWAN ? wwan:wifi;
else
newConnectivity = wifi;
if (lLinphoneMgr.connectivity == none) {
linphone_core_set_network_reachable([LinphoneManager getLc],true);
} else if (lLinphoneMgr.connectivity != newConnectivity) {
@ -467,7 +475,9 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
lLinphoneMgr.connectivity=newConnectivity;
ms_message("new network connectivity of type [%s]",(newConnectivity==wifi?"wifi":"wwan"));
}
if (ctx && ctx->networkStateChanged) {
(*ctx->networkStateChanged)(lLinphoneMgr.connectivity);
}
}
}
@ -683,6 +693,15 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
bool enableSrtp = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_srtp_preference"];
linphone_core_set_media_encryption(theLinphoneCore, enableSrtp?LinphoneMediaEncryptionSRTP:LinphoneMediaEncryptionZRTP);
NSString* stun_server = [[NSUserDefaults standardUserDefaults] stringForKey:@"stun_preference"];
if ([stun_server length]>0){
linphone_core_set_stun_server(theLinphoneCore,[stun_server cStringUsingEncoding:[NSString defaultCStringEncoding]]);
linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyUseStun);
}else{
linphone_core_set_stun_server(theLinphoneCore, NULL);
linphone_core_set_firewall_policy(theLinphoneCore, LinphonePolicyNoFirewall);
}
LinphoneVideoPolicy policy;
policy.automatically_accept = [[NSUserDefaults standardUserDefaults] boolForKey:@"start_video_preference"];;
@ -732,10 +751,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setDelegate:nil];
if (theLinphoneCore != nil) { //just in case application terminate before linphone core initialization
NSLog(@"Destroy linphonecore");
linphone_core_destroy(theLinphoneCore);
theLinphoneCore = nil;
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
if (proxyReachability)
CFRelease(proxyReachability);
proxyReachability=nil;
}
@ -743,7 +764,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
//**********************BG mode management*************************///////////
-(void) enterBackgroundMode {
-(BOOL) enterBackgroundMode {
LinphoneProxyConfig* proxyCfg;
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
linphone_core_stop_dtmf_stream(theLinphoneCore);
@ -783,13 +804,13 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
if (linphone_core_get_sip_transports(theLinphoneCore, &transportValue)) {
ms_error("cannot get current transport");
}
return YES;
}
else {
ms_warning("Entering lite bg mode");
[self destroyLibLinphone];
return NO;
}
}
@ -799,7 +820,30 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
-(void) setupNetworkReachabilityCallback: (const char*) nodeName withContext:(SCNetworkReachabilityContext*) ctx {
if (proxyReachability) {
ms_message("Cancel old network reachability check");
SCNetworkReachabilityUnscheduleFromRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);
CFRelease(proxyReachability);
proxyReachability = nil;
}
proxyReachability = SCNetworkReachabilityCreateWithName(nil, nodeName);
//initial state is network off should be done as soon as possible
SCNetworkReachabilityFlags flags;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
ms_error("Cannot get reachability flags");
};
networkReachabilityCallBack(proxyReachability, flags, ctx ? ctx->info : 0);
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack, ctx)){
ms_error("Cannot register reachability cb");
};
if(!SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)){
ms_error("Cannot register schedule reachability cb");
};
}
/*************
@ -841,6 +885,7 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
#endif
/* Initialize linphone core*/
NSLog(@"Create linphonecore");
theLinphoneCore = linphone_core_new (&linphonec_vtable
, [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]
, [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]]
@ -850,22 +895,8 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
linphone_core_set_zrtp_secrets_file(theLinphoneCore, [zrtpSecretsFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]);
proxyReachability=SCNetworkReachabilityCreateWithName(nil, "linphone.org");
proxyReachabilityContext.info=self;
//initial state is network off should be done as soon as possible
SCNetworkReachabilityFlags flags;
if (!SCNetworkReachabilityGetFlags(proxyReachability, &flags)) {
ms_error("Cannot get reachability flags");
};
networkReachabilityCallBack(proxyReachability,flags,self);
[self setupNetworkReachabilityCallback: "linphone.org" withContext:nil];
if (!SCNetworkReachabilitySetCallback(proxyReachability, (SCNetworkReachabilityCallBack)networkReachabilityCallBack,&proxyReachabilityContext)){
ms_error("Cannot register reachability cb");
};
if(!SCNetworkReachabilityScheduleWithRunLoop(proxyReachability, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode)){
ms_error("Cannot register schedule reachability cb");
};
[self reconfigureLinphoneIfNeeded:nil];
// start scheduler
@ -930,13 +961,12 @@ void networkReachabilityCallBack(SCNetworkReachabilityRef target, SCNetworkReach
}
-(void) becomeActive {
if (theLinphoneCore == nil) {
//back from standby and background mode is disabled
[self startLibLinphone];
} else {
if (![self reconfigureLinphoneIfNeeded:currentSettings]) {
ms_message("becomming active with no config modification, make sure we are registered");
ms_message("becoming active with no config modification, make sure we are registered");
linphone_core_refresh_registers(theLinphoneCore);//just to make sure REGISTRATION is up to date
}

View file

@ -45,8 +45,10 @@
otherButtonTitles:nil];
[error show];
[error release];
[ct release];
return;
}
[ct release];
if (TRUE /*!linphone_core_in_call([LinphoneManager getLc])*/) {
LinphoneProxyConfig* proxyCfg;

View file

@ -60,7 +60,7 @@
}
-(BOOL) updateWithRegistrationState:(LinphoneRegistrationState)state message:(NSString*) message {
label.hidden = NO;
switch(state) {
case LinphoneRegistrationCleared:
image.hidden = NO;

View file

@ -39,7 +39,7 @@
<array class="NSMutableArray" key="NSSubviews">
<object class="IBUIImageView" id="332800514">
<reference key="NSNextResponder" ref="848661322"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{0, -1}, {25, 23}}</string>
<reference key="NSSuperview" ref="848661322"/>
<reference key="NSWindow"/>
@ -66,7 +66,7 @@
</object>
<object class="IBUILabel" id="200467549">
<reference key="NSNextResponder" ref="848661322"/>
<int key="NSvFlags">292</int>
<int key="NSvFlags">-2147483356</int>
<string key="NSFrame">{{28, 0}, {280, 21}}</string>
<reference key="NSSuperview" ref="848661322"/>
<reference key="NSWindow"/>
@ -76,7 +76,7 @@
<int key="IBUIContentMode">7</int>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
<string key="IBUIText">No SIP account defined</string>
<string key="IBUIText">CARAMBA</string>
<object class="NSColor" key="IBUITextColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>

View file

@ -35,8 +35,10 @@
<object class="IBUIView" id="191373211">
<reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<string key="NSFrameSize">{768, 1004}</string>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">4</int>
<bytes key="NSWhite">MAA</bytes>
@ -50,9 +52,10 @@
<object class="IBUIImageView" id="873033834">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{-9, 0}, {777, 1004}}</string>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSNextKeyView" ref="68468370"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="901145609"/>
<string key="NSReuseIdentifierKey">_NS:569</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
@ -69,7 +72,7 @@
<object class="IBUIButton" id="897140295">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{329, 942}, {108, 62}}</string>
<string key="NSFrame">{{329, 962}, {108, 62}}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSNextKeyView" ref="509323940"/>
<bool key="IBUIOpaque">NO</bool>
@ -111,7 +114,7 @@
<object class="IBUIButton" id="68468370">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{223, 942}, {108, 62}}</string>
<string key="NSFrame">{{223, 962}, {108, 62}}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSNextKeyView" ref="897140295"/>
<bool key="IBUIOpaque">NO</bool>
@ -131,8 +134,10 @@
<object class="IBUIView" id="679593526">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{598, 779}, {170, 225}}</string>
<string key="NSFrame">{{598, 799}, {170, 225}}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MQA</bytes>
@ -145,7 +150,7 @@
<object class="IBUIButton" id="509323940">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{436, 942}, {108, 62}}</string>
<string key="NSFrame">{{436, 962}, {108, 62}}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSNextKeyView" ref="679593526"/>
<bool key="IBUIOpaque">NO</bool>
@ -164,8 +169,19 @@
<reference key="IBUIFontDescription" ref="714163490"/>
<reference key="IBUIFont" ref="5163959"/>
</object>
<object class="IBUIImageView" id="901145609">
<reference key="NSNextResponder" ref="25193021"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 976}, {28, 28}}</string>
<reference key="NSSuperview" ref="25193021"/>
<reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="68468370"/>
<string key="NSReuseIdentifierKey">_NS:567</string>
<bool key="IBUIUserInteractionEnabled">NO</bool>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<string key="NSFrameSize">{768, 1004}</string>
<string key="NSFrameSize">{768, 1024}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="873033834"/>
<string key="NSReuseIdentifierKey">_NS:212</string>
@ -182,7 +198,7 @@
<object class="IBUIImageView" id="696525010">
<reference key="NSNextResponder" ref="763566492"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{1004, 768}</string>
<string key="NSFrameSize">{1024, 768}</string>
<reference key="NSSuperview" ref="763566492"/>
<reference key="NSNextKeyView" ref="637528292"/>
<string key="NSReuseIdentifierKey">_NS:569</string>
@ -192,7 +208,7 @@
<object class="IBUIView" id="756580344">
<reference key="NSNextResponder" ref="763566492"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{779, 598}, {225, 170}}</string>
<string key="NSFrame">{{799, 598}, {225, 170}}</string>
<reference key="NSSuperview" ref="763566492"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@ -204,7 +220,7 @@
<object class="IBUIButton" id="637528292">
<reference key="NSNextResponder" ref="763566492"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{341, 706}, {108, 62}}</string>
<string key="NSFrame">{{351, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="763566492"/>
<reference key="NSNextKeyView" ref="303730267"/>
<bool key="IBUIOpaque">NO</bool>
@ -224,7 +240,7 @@
<object class="IBUIButton" id="303730267">
<reference key="NSNextResponder" ref="763566492"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{448, 706}, {108, 62}}</string>
<string key="NSFrame">{{458, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="763566492"/>
<reference key="NSNextKeyView" ref="499714887"/>
<bool key="IBUIOpaque">NO</bool>
@ -245,7 +261,7 @@
<object class="IBUIButton" id="499714887">
<reference key="NSNextResponder" ref="763566492"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{555, 706}, {108, 62}}</string>
<string key="NSFrame">{{565, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="763566492"/>
<reference key="NSNextKeyView" ref="756580344"/>
<bool key="IBUIOpaque">NO</bool>
@ -274,7 +290,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<string key="NSFrameSize">{1004, 768}</string>
<string key="NSFrameSize">{1024, 768}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="696525010"/>
<string key="NSReuseIdentifierKey">_NS:212</string>
@ -295,7 +311,7 @@
<object class="IBUIImageView" id="97794255">
<reference key="NSNextResponder" ref="79829529"/>
<int key="NSvFlags">292</int>
<string key="NSFrameSize">{1004, 768}</string>
<string key="NSFrameSize">{1024, 768}</string>
<reference key="NSSuperview" ref="79829529"/>
<reference key="NSNextKeyView" ref="243148779"/>
<string key="NSReuseIdentifierKey">_NS:569</string>
@ -305,7 +321,7 @@
<object class="IBUIView" id="799261982">
<reference key="NSNextResponder" ref="79829529"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{779, 598}, {225, 170}}</string>
<string key="NSFrame">{{799, 598}, {225, 170}}</string>
<reference key="NSSuperview" ref="79829529"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@ -317,7 +333,7 @@
<object class="IBUIButton" id="243148779">
<reference key="NSNextResponder" ref="79829529"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{341, 706}, {108, 62}}</string>
<string key="NSFrame">{{351, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="79829529"/>
<reference key="NSNextKeyView" ref="796028571"/>
<bool key="IBUIOpaque">NO</bool>
@ -337,7 +353,7 @@
<object class="IBUIButton" id="796028571">
<reference key="NSNextResponder" ref="79829529"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{448, 706}, {108, 62}}</string>
<string key="NSFrame">{{458, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="79829529"/>
<reference key="NSNextKeyView" ref="551257366"/>
<bool key="IBUIOpaque">NO</bool>
@ -358,7 +374,7 @@
<object class="IBUIButton" id="551257366">
<reference key="NSNextResponder" ref="79829529"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{555, 706}, {108, 62}}</string>
<string key="NSFrame">{{565, 706}, {108, 62}}</string>
<reference key="NSSuperview" ref="79829529"/>
<reference key="NSNextKeyView" ref="799261982"/>
<bool key="IBUIOpaque">NO</bool>
@ -387,7 +403,7 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
</object>
</array>
<string key="NSFrameSize">{1004, 768}</string>
<string key="NSFrameSize">{1024, 768}</string>
<reference key="NSSuperview"/>
<reference key="NSNextKeyView" ref="97794255"/>
<string key="NSReuseIdentifierKey">_NS:212</string>

23
README
View file

@ -25,8 +25,10 @@ Link macport libtoolize to glibtoolize
Link host's strings to simulator SDK
$ ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
For Xcode prior to 4.3:
$ sudo ln -s /usr/bin/strings /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
For newer XCode:
$ sudo ln -s /usr/bin/strings /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/strings
BUILDING THE SDK
@ -34,19 +36,24 @@ BUILDING THE SDK
* GPL third parties versus non GPL third parties
This sdk can be generated in 2 flavors. Firt is with GPL third parties, it means liblinphone includes GPL third parties like FFMPEG or x264.
If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
This sdk can be generated in 2 flavors. Firt is with GPL third parties, it means liblinphone includes GPL third parties like FFMPEG or x264.
If you choose this flavor, your final application must comply with GPL in any case. This is the default mode.
To generate the liblinphone multi arch sdk in GPL mode, do:
To generate the liblinphone multi arch sdk in GPL mode, do:
$ cd submodules/build
$ make all
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip.
ALTERNATIVELY, you can force liblinphone to use only non GPL code except for liblinphone, mediastremer2, ortp, exosip, osip.
If you choose this flavor, your final application is still subject to GPL except if you have a commercial license for liblinphone, mediastremer2, ortp, exosip, osip.
To generate the liblinphone multi arch sdkin non GPL mode, do:
To generate the liblinphone multi arch sdkin non GPL mode, do:
$ cd submodules/build
$ make all enable_gpl_third_parties=no
* ZRTP support
You can enable ZRTP support in GPL mode only, by adding "enable_zrtp=yes" to the make command, for example:
$ make all enable_gpl_third_parties=yes enable_zrtp=yes
The resulting sdk is in liblinphone-sdk/ directory.

View file

@ -4,6 +4,20 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Key</key>
<string>stun_preference</string>
<key>Title</key>
<string>Stun server</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>

View file

@ -4,6 +4,20 @@
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Key</key>
<string>stun_preference</string>
<key>Title</key>
<string>Stun server</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
<string>None</string>
<key>AutocorrectionType</key>
<string>No</string>
<key>DefaultValue</key>
<string></string>
</dict>
<dict>
<key>DefaultValue</key>
<false/>

View file

@ -20,6 +20,7 @@
#
############################################################################
enable_gpl_third_parties=yes
enable_zrtp=no
.NOTPARALLEL all: build warning
ifeq ($(enable_gpl_third_parties),yes)
@ -39,12 +40,18 @@ warning:
@echo "*****linphone SDK without GPL code ******"
@echo "*****************************************************************"
@echo "*****************************************************************"
ifeq($(enable_zrtp),yes)
@echo "ZRTP is not available in non-gpl build."
enable_zrtp=no
endif
endif
LINPHONE_OPTIONS="enable_gpl_third_parties=$(enable_gpl_third_parties) enable_zrtp=$(enable_zrtp)"
build:
make -f builder-iphone-os.mk all enable_gpl_third_parties=$(enable_gpl_third_parties) \
&& make -f builder-iphone-simulator.mk all enable_gpl_third_parties=$(enable_gpl_third_parties)\
&& make -f builder-iphone-os.mk host=armv7-apple-darwin all enable_gpl_third_parties=$(enable_gpl_third_parties)\
make -f builder-iphone-os.mk all $(LINPHONE_OPTIONS) \
&& make -f builder-iphone-simulator.mk all $(LINPHONE_OPTIONS) \
&& make -f builder-iphone-os.mk host=armv7-apple-darwin all $(LINPHONE_OPTIONS) \
&& make -f builder-iphone-os.mk delivery-sdk
ipa: build

View file

@ -38,6 +38,12 @@ linphone_configure_controls= \
--disable-tests \
--with-srtp=$(prefix)
ifeq ($(enable_zrtp),yes)
linphone_configure_controls+= --enable-zrtp
else
linphone_configure_controls+= --disable-zrtp
endif
#path
BUILDER_SRC_DIR?=$(shell pwd)/../
BUILDER_BUILD_DIR?=$(shell pwd)/../build-$(host)
@ -60,11 +66,11 @@ $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties:
cd $(LINPHONE_BUILD_DIR) && rm -f Makefile && rm -f oRTP/Makefile && rm -f mediastreamer2/Makefile
ifeq ($(enable_gpl_third_parties),yes)
linphone_configure_controls+= --enable-ffmpeg --enable-zrtp
linphone_configure_controls+= --enable-ffmpeg
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/enable_gpl_third_parties
else
linphone_configure_controls+= --disable-ffmpeg --disable-zrtp
linphone_configure_controls+= --disable-ffmpeg
detect_gpl_mode_switch: $(LINPHONE_BUILD_DIR)/disable_gpl_third_parties
endif

View file

@ -13,11 +13,16 @@ else
endif
libvpx_dir?=externals/libvpx
$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk:
$(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp:
cd $(BUILDER_SRC_DIR)/$(libvpx_dir) \
&& git apply $(BUILDER_SRC_DIR)/build/builders.d/libvpx.patch \
&& touch $@
$(BUILDER_BUILD_DIR)/$(libvpx_dir)/config.mk: $(BUILDER_SRC_DIR)/$(libvpx_dir)/patched.stamp
mkdir -p $(BUILDER_BUILD_DIR)/$(libvpx_dir)
cd $(BUILDER_BUILD_DIR)/$(libvpx_dir)/ \
&& host_alias=${host} . $(BUILDER_SRC_DIR)/build/$(config_site) \
&& $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) $(libvpx_configure_options)
&& SYSROOT_PATH=$$SYSROOT_PATH SDK_BIN_PATH=$$SDK_BIN_PATH $(BUILDER_SRC_DIR)/$(libvpx_dir)/configure --prefix=$(prefix) $(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

View file

@ -0,0 +1,42 @@
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 0426f92..24fa04e 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,6 +746,14 @@ 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
CC=${TOOLCHAIN_PATH}/gcc
AR=${TOOLCHAIN_PATH}/ar
LD=${TOOLCHAIN_PATH}/arm-apple-darwin10-llvm-gcc-4.2
@@ -759,10 +770,10 @@ process_common_toolchain() {
add_cflags -arch ${tgt_isa}
add_ldflags -arch_only ${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

View file

@ -24,8 +24,15 @@ else
fi
echo "Loading config.site for iPhone platform=${PLATFORM} version=${SDK_VERSION}"
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
#new path with Xcode 4.3:
if test -d /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs ; then
SDK_PATH_LIST=`ls -drt /Applications/Xcode.app/Contents/Developer/Platforms/iPhone${PLATFORM}.platform/Developer/SDKs/iPhone${PLATFORM}*`
SDK_BIN_PATH=/Applications/Xcode.app/Contents/Developer/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"

@ -1 +1 @@
Subproject commit c474ef27bc1b6d2951bb3a4c8ad7343f7171bbea
Subproject commit 8ffeb3eb7c7e5738883f6c247330316753bf173e