Merge branch 'new_ui' of git://git.linphone.org/linphone-iphone into buschjaeger_new_ui

Conflicts:
	Classes/ChatRoomTableViewController.m
	Classes/ChatRoomViewController.m
	Classes/ContactDetailsTableViewController.m
	Classes/LinphoneCoreSettingsStore.m
	Classes/LinphoneManager.m
	Classes/LinphoneUI/UICallBar.m
	Classes/LinphoneUI/UICompositeViewController.m
	Classes/LinphoneUI/UIStateBar.m
	Classes/LinphoneUI/en.lproj/UICallBar.xib
	Classes/LinphoneUI/fr.lproj/UICallBar.xib
	Classes/en.lproj/ChatViewController.xib
	Classes/fr.lproj/ChatViewController.xib
	linphone.ldb/Contents.plist
	linphone.ldb/Resources/Classes/ChatViewController/19/ChatViewController.xib
	linphone.ldb/Resources/InAppSettings.bundle/Network/1/Network.strings
	linphone.ldb/Resources/LinphoneUI/UICallBar/12/UICallBar.xib
	linphone.xcodeproj/project.pbxproj
This commit is contained in:
Yann Diorcet 2012-11-20 14:32:54 +01:00
commit d2ed3855e1
11 changed files with 77 additions and 72 deletions

View file

@ -98,7 +98,7 @@ typedef struct _LinphoneManagerSounds {
BOOL stopWaitingRegisters;
UIBackgroundTaskIdentifier pausedCallBgTask;
UIBackgroundTaskIdentifier incallBgTask;
CTCallCenter* callCenter;
CTCallCenter* mCallCenter;
/* MODIFICATION: Add NSUSerdefault settings */
NSDictionary *currentSettings;

View file

@ -412,19 +412,19 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
}
if (state == LinphoneCallIncomingReceived
&&[[UIDevice currentDevice] respondsToSelector:@selector(isMultitaskingSupported)]
&& [UIApplication sharedApplication].applicationState != UIApplicationStateActive) {
if (state == LinphoneCallIncomingReceived) {
/*first step is to re-enable ctcall center*/
[self setupGSMInteraction];
CTCallCenter* lCTCallCenter = [[CTCallCenter alloc] init];
/*should we reject this call ?*/
if ([callCenter currentCalls]!=nil) {
if ([lCTCallCenter currentCalls]!=nil) {
[LinphoneLogger logc:LinphoneLoggerLog format:"Mobile call ongoing... rejecting call from [%s]",linphone_address_get_username(linphone_call_get_call_log(call)->from)];
linphone_core_decline_call([LinphoneManager getLc], call,LinphoneReasonBusy);
[lCTCallCenter release];
return;
}
[lCTCallCenter release];
LinphoneCallLog* callLog=linphone_call_get_call_log(call);
@ -479,8 +479,7 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
[LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot ring any more, too late"];
}];
}
}
}
}
}
@ -495,8 +494,10 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
// Disable speaker when no more call
if ((state == LinphoneCallEnd || state == LinphoneCallError)) {
if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0)
if(linphone_core_get_calls_nb([LinphoneManager getLc]) == 0) {
[self setSpeakerEnabled:FALSE];
[self removeCTCallCenterCb];
}
if (incallBgTask) {
[[UIApplication sharedApplication] endBackgroundTask:incallBgTask];
incallBgTask=0;
@ -512,7 +513,10 @@ static void linphone_iphone_display_status(struct _LinphoneCore * lc, const char
[self setSpeakerEnabled:TRUE];
}
}
if (state == LinphoneCallConnected && !mCallCenter) {
/*only register CT call center CB for connected call*/
[self setupGSMInteraction];
}
// Post event
NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
[NSValue valueWithPointer:call], @"call",
@ -787,7 +791,6 @@ static LinphoneCoreVTable linphonec_vtable = {
#if HAVE_G729
libmsbcg729_init(); // load g729 plugin
#endif
[self setupGSMInteraction];
/* Initialize linphone core*/
/*to make sure we don't loose debug trace*/
@ -795,6 +798,8 @@ static LinphoneCoreVTable linphonec_vtable = {
linphone_core_enable_logs_with_cb((OrtpLogFunc)linphone_iphone_log_handler);
}
[LinphoneLogger logc:LinphoneLoggerLog format:"Create linphonecore"];
linphone_core_set_user_agent([@"LinphoneIPhone" UTF8String],
[[[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString*)kCFBundleVersionKey] UTF8String]);
theLinphoneCore = linphone_core_new (&linphonec_vtable
, [confiFileName cStringUsingEncoding:[NSString defaultCStringEncoding]]
, [factoryConfig cStringUsingEncoding:[NSString defaultCStringEncoding]]
@ -896,13 +901,8 @@ static LinphoneCoreVTable linphonec_vtable = {
- (void)destroyLibLinphone {
[mIterateTimer invalidate];
// 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;
//just in case
[self removeCTCallCenterCb];
AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setDelegate:nil];
@ -993,6 +993,13 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param)
return linphone_call_get_state(call) != LinphoneCallPaused;
}
- (void) startCallPausedLongRunningTask {
pausedCallBgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{
[LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot be paused any more, too late"];
}];
[LinphoneLogger log:LinphoneLoggerLog format:@"Long running task started, remaining [%g s] because at least one call is paused"
,[[UIApplication sharedApplication] backgroundTimeRemaining]];
}
- (BOOL)enterBackgroundMode {
LinphoneProxyConfig* proxyCfg;
linphone_core_get_default_proxy(theLinphoneCore, &proxyCfg);
@ -1020,13 +1027,6 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param)
return;
}
//kick up network cnx, just in case
[LinphoneManager kickOffNetworkConnection];
[self setupGSMInteraction];
//to make sure presence status is correct
if ([callCenter currentCalls]==nil)
linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService);
[self refreshRegisters];
linphone_core_iterate(theLinphoneCore);
}
@ -1042,13 +1042,8 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param)
if (!currentCall //no active call
&& callList // at least one call in a non active state
&& ms_list_find_custom((MSList*)callList, (MSCompareFunc) comp_call_state_paused, NULL)) {
pausedCallBgTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler: ^{
[LinphoneLogger log:LinphoneLoggerWarning format:@"Call cannot be paused any more, too late"];
}];
[LinphoneLogger log:LinphoneLoggerLog format:@"Long running task started, remaining [%fs] because at least one call is paused"
,[[UIApplication sharedApplication] backgroundTimeRemaining]];
[self startCallPausedLongRunningTask];
}
return YES;
}
else {
@ -1076,14 +1071,6 @@ static int comp_call_state_paused (const LinphoneCall* call, const void* param)
/*IOS specific*/
linphone_core_start_dtmf_stream(theLinphoneCore);
//call center is unrelialable on the long run, so we change it each time the application is resumed. To avoid zombie GSM call
[self setupGSMInteraction];
//to make sure presence status is correct
if ([callCenter currentCalls]==nil)
linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService);
}
@ -1171,7 +1158,7 @@ static void audioRouteChangeListenerCallback (
return;
}
CTCallCenter* callCenter = [[CTCallCenter alloc] init];
if ([callCenter currentCalls]!=nil) {
[LinphoneLogger logc:LinphoneLoggerError format:"GSM call in progress, cancelling outgoing SIP call request"];
UIAlertView* error = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Cannot make call",nil)
@ -1181,9 +1168,11 @@ static void audioRouteChangeListenerCallback (
otherButtonTitles:nil];
[error show];
[error release];
[callCenter release];
return;
}
[callCenter release];
LinphoneProxyConfig* proxyCfg;
//get default proxy
linphone_core_get_default_proxy([LinphoneManager getLc],&proxyCfg);
@ -1664,18 +1653,24 @@ static void audioRouteChangeListenerCallback (
#pragma GSM management
-(void) removeCTCallCenterCb {
if (mCallCenter != nil) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Removing CT call center listener [%p]",mCallCenter];
mCallCenter.callEventHandler=NULL;
[mCallCenter release];
}
mCallCenter=nil;
}
- (void)setupGSMInteraction {
if (callCenter != nil) {
callCenter.callEventHandler=NULL;
[callCenter release];
}
callCenter = [[CTCallCenter alloc] init];
callCenter.callEventHandler = ^(CTCall* call) {
[self removeCTCallCenterCb];
mCallCenter = [[CTCallCenter alloc] init];
[LinphoneLogger log:LinphoneLoggerLog format:@"Adding CT call center listener [%p]",mCallCenter];
mCallCenter.callEventHandler = ^(CTCall* call) {
// post on main thread
[self performSelectorOnMainThread:@selector(handleGSMCallInteration:)
withObject:callCenter
withObject:mCallCenter
waitUntilDone:YES];
};
@ -1686,12 +1681,15 @@ static void audioRouteChangeListenerCallback (
/* pause current call, if any */
LinphoneCall* call = linphone_core_get_current_call(theLinphoneCore);
if ([ct currentCalls]!=nil) {
if (call) {[LinphoneLogger logc:LinphoneLoggerLog format:"Pausing SIP call"];
if (call) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Pausing SIP call because GSM call"];
linphone_core_pause_call(theLinphoneCore, call);
[self startCallPausedLongRunningTask];
} else if (linphone_core_is_in_conference(theLinphoneCore)) {
[LinphoneLogger log:LinphoneLoggerLog format:@"Leaving conference call because GSM call"];
linphone_core_leave_conference(theLinphoneCore);
[self startCallPausedLongRunningTask];
}
//set current status to busy
linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusBusy);
} else
linphone_core_set_presence_info(theLinphoneCore, 0, nil, LinphoneStatusAltService);
} //else nop, keep call in paused state
}
@end

View file

@ -65,8 +65,8 @@
}
- (void)dealloc {
[super dealloc];
[addressField release];
[super dealloc];
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

@ -70,7 +70,7 @@
<key>Key</key>
<string>audio_port_preference</string>
<key>Title</key>
<string>Audio Port</string>
<string>Audio Port(s)</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
@ -78,7 +78,7 @@
<key>AutocorrectionType</key>
<string>No</string>
<key>KeyboardType</key>
<string>NumberPad</string>
<string>NumbersAndPunctuation</string>
<key>DefaultValue</key>
<integer>7076</integer>
</dict>
@ -86,7 +86,7 @@
<key>Key</key>
<string>video_port_preference</string>
<key>Title</key>
<string>Video Port</string>
<string>Video Port(s)</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
<key>AutocapitalizationType</key>
@ -94,7 +94,7 @@
<key>AutocorrectionType</key>
<string>No</string>
<key>KeyboardType</key>
<string>NumberPad</string>
<string>NumbersAndPunctuation</string>
<key>DefaultValue</key>
<integer>9078</integer>
</dict>

View file

@ -13,11 +13,11 @@
/* Port */
"Port" = "Port";
/* Audio Port */
"Audio Port" = "Audio Port";
/* Audio Port(s) */
"Audio Port(s)" = "Audio Port(s)";
/* Video Port */
"Video Port" = "Video Port";
/* Video Port(s) */
"Video Port(s)" = "Video Port(s)";
/* Transport */
"Transport" = "Transport";

View file

@ -13,11 +13,11 @@
/* Port */
"Port" = "Port";
/* Audio Port */
"Audio Port" = "Port Audio";
/* Audio Port(s) */
"Audio Port(s)" = "Port(s) Audio";
/* Video Port */
"Video Port" = "Port Vidéo";
/* Video Port(s) */
"Video Port(s)" = "Port(s) Vidéo";
/* Transport */
"Transport" = "Transport";

View file

@ -1618,6 +1618,8 @@
D32EDDA91600C8FC009A84C7 /* ringtone_04_1600_loop.wav in Resources */,
D32EDDAB1600C8FC009A84C7 /* ringtone_05_1600_loop.wav in Resources */,
D30B942316358C7F00D53C46 /* BuschJaegerManualSettingsView.xib in Resources */,
D33E1F08164CF35100CFA363 /* callbar_left_padding.png in Resources */,
D33E1F0A164CF35100CFA363 /* callbar_right_padding.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1678,6 +1680,8 @@
D32EDDAA1600C8FC009A84C7 /* ringtone_04_1600_loop.wav in Resources */,
D32EDDAC1600C8FC009A84C7 /* ringtone_05_1600_loop.wav in Resources */,
D30B942416358C7F00D53C46 /* BuschJaegerManualSettingsView.xib in Resources */,
D33E1F09164CF35100CFA363 /* callbar_left_padding.png in Resources */,
D33E1F0B164CF35100CFA363 /* callbar_right_padding.png in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

View file

@ -43,12 +43,12 @@ ifneq (,$(findstring armv7,$(host)))
endif
x264_dir?=externals/x264
$(BUILDER_SRC_DIR)/$(x264_dir)/patched :
cd $(BUILDER_SRC_DIR)/$(x264_dir) \
&& git apply $(BUILDER_SRC_DIR)/build/builders.d/x264.patch \
&& touch $(BUILDER_SRC_DIR)/$(x264_dir)/patched
#$(BUILDER_SRC_DIR)/$(x264_dir)/patched :
# cd $(BUILDER_SRC_DIR)/$(x264_dir) \
# && git apply $(BUILDER_SRC_DIR)/build/builders.d/x264.patch \
# && touch $(BUILDER_SRC_DIR)/$(x264_dir)/patched
$(BUILDER_BUILD_DIR)/$(x264_dir)/configure: $(BUILDER_SRC_DIR)/$(x264_dir)/patched
$(BUILDER_BUILD_DIR)/$(x264_dir)/configure:
mkdir -p $(BUILDER_BUILD_DIR)/$(x264_dir)
cd $(BUILDER_BUILD_DIR)/$(x264_dir)/ \
&& rsync -av --exclude ".git" $(BUILDER_SRC_DIR)/$(x264_dir)/* .
@ -66,6 +66,9 @@ clean-x264:
veryclean-x264:
-cd $(BUILDER_BUILD_DIR)/$(x264_dir) && make distclean
cd $(BUILDER_SRC_DIR)/$(x264_dir)/ \
&& git checkout common/arm/asm.S \
&& rm -f patched
rm -rf $(BUILDER_BUILD_DIR)/$(x264_dir)
clean-makefile-x264:

@ -1 +1 @@
Subproject commit 926a03a9c1f48d0fbd54b0e802d740774c100a78
Subproject commit f6a8615ab0c922ac2cb5c82c9824f6f4742b1725