mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
ipad: start background preview in a separate thread
This commit is contained in:
parent
a37197a32a
commit
966c3ad85e
1 changed files with 8 additions and 10 deletions
|
|
@ -72,12 +72,6 @@
|
|||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
|
||||
|
||||
if (enableVideo) {
|
||||
[self initVideoPreview ];
|
||||
}
|
||||
}
|
||||
|
||||
-(void) switchCameraPressed {
|
||||
|
|
@ -111,13 +105,19 @@
|
|||
[session startRunning];
|
||||
}
|
||||
|
||||
-(void) startPreview:(id) a {
|
||||
[window addSubview:self.view];
|
||||
[window sendSubviewToBack:self.view];
|
||||
[session startRunning];
|
||||
}
|
||||
|
||||
|
||||
-(void) showPreview:(BOOL) show {
|
||||
bool enableVideo = [[NSUserDefaults standardUserDefaults] boolForKey:@"enable_video_preference"];
|
||||
|
||||
if (enableVideo) {
|
||||
LinphoneCall* call = linphone_core_get_current_call([LinphoneManager getLc]);
|
||||
if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
v if (show && call && linphone_call_params_video_enabled(linphone_call_get_current_params(call))) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -126,9 +126,7 @@
|
|||
}
|
||||
|
||||
if (show && !session.running) {
|
||||
[window addSubview:self.view];
|
||||
[window sendSubviewToBack:self.view];
|
||||
[session startRunning];
|
||||
[self performSelectorInBackground:@selector(startPreview:) withObject:nil];
|
||||
} else if (!show && session.running) {
|
||||
[self.view removeFromSuperview];
|
||||
[session stopRunning];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue