From 0284edb3afdf90aa1b5990adf1e9c5dcc596041f Mon Sep 17 00:00:00 2001 From: Yann Diorcet Date: Fri, 3 Aug 2012 09:43:20 +0200 Subject: [PATCH] Improve InCall video stuff --- Classes/InCallViewController.h | 4 - Classes/InCallViewController.m | 49 +++---- Classes/InCallViewController.xib | 138 +----------------- Classes/Utils/XMLRPC/NSData+Base64.m | 2 +- .../XMLRPC/XMLRPC.xcodeproj/project.pbxproj | 15 +- Classes/WizardViewController.m | 11 +- main.m | 1 - submodules/linphone | 2 +- 8 files changed, 44 insertions(+), 178 deletions(-) diff --git a/Classes/InCallViewController.h b/Classes/InCallViewController.h index 0808ebeac..b11f30ae3 100644 --- a/Classes/InCallViewController.h +++ b/Classes/InCallViewController.h @@ -28,10 +28,6 @@ @class VideoViewController; -@interface UIPreviewView : UIView - -@end - @interface InCallViewController : UIViewController { InCallTableViewController* callTableController; diff --git a/Classes/InCallViewController.m b/Classes/InCallViewController.m index 15926c9ff..4a8e3442f 100644 --- a/Classes/InCallViewController.m +++ b/Classes/InCallViewController.m @@ -35,18 +35,6 @@ const NSInteger SECURE_BUTTON_TAG=5; -@implementation UIPreviewView - -- (void)layoutSubviews { - [super layoutSubviews]; - [self.layer setFrame:self.frame]; - for(CALayer *layer in self.layer.sublayers) { - [layer setFrame:self.bounds]; - } -} - -@end - @implementation InCallViewController @synthesize callTableController; @@ -113,22 +101,6 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - ViewController Functions -// Resize preview view keep same ratio -- (void)viewWillLayoutSubviews { - [super viewWillLayoutSubviews]; - CGRect frame = [videoPreview frame]; - frame.origin.x += frame.size.width; - frame.origin.y += frame.size.height; - - CGRect selfFrame = [self.view frame]; - int size = 100.0f/460.0f * MAX(selfFrame.size.width, selfFrame.size.height); - frame.origin.x -= size; - frame.origin.y -= size; - frame.size.height = size; - frame.size.width = size; - [videoPreview setFrame:frame]; -} - - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; @@ -224,6 +196,27 @@ static UICompositeViewDescription *compositeDescription = nil; } +- (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration { + CGRect frame = [videoPreview frame]; + switch (toInterfaceOrientation) { + case UIInterfaceOrientationPortrait: + [videoPreview setTransform: CGAffineTransformMakeRotation(0)]; + break; + case UIInterfaceOrientationPortraitUpsideDown: + [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI)]; + break; + case UIInterfaceOrientationLandscapeLeft: + [videoPreview setTransform: CGAffineTransformMakeRotation(M_PI / 2)]; + break; + case UIInterfaceOrientationLandscapeRight: + [videoPreview setTransform: CGAffineTransformMakeRotation(-M_PI / 2)]; + break; + default: + break; + } + [videoPreview setFrame:frame]; +} + #pragma mark - - (void)orientationUpdate { diff --git a/Classes/InCallViewController.xib b/Classes/InCallViewController.xib index 8d6106c7d..d02849967 100644 --- a/Classes/InCallViewController.xib +++ b/Classes/InCallViewController.xib @@ -52,7 +52,6 @@ 301 {{-1000, -1000}, {2000, 2000}} - _NS:9 @@ -66,7 +65,6 @@ 274 {320, 460} - _NS:196 @@ -77,10 +75,9 @@ - 265 + 283 {{220, 360}, {100, 100}} - 1 @@ -91,7 +88,6 @@ 301 {{141, 212}, {37, 37}} - _NS:1030 NO @@ -103,7 +99,6 @@ {320, 460} - _NS:196 @@ -114,7 +109,6 @@ 274 {{0, -10}, {320, 480}} - _NS:418 @@ -143,9 +137,9 @@ -2147483356 - {85, 33} + {{0, 23}, {85, 33}} - + _NS:9 NO IBCocoaTouchFramework @@ -178,7 +172,6 @@ {320, 460} - NO @@ -400,7 +393,6 @@ -2.IBPluginDependency 106.IBPluginDependency 126.IBPluginDependency - 127.CustomClassName 127.IBPluginDependency 132.IBPluginDependency 144.IBPluginDependency @@ -420,7 +412,6 @@ com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin - UIPreviewView com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin com.apple.InterfaceBuilder.IBCocoaTouchPlugin @@ -447,128 +438,7 @@ 173 - - - YES - - InCallTableViewController - UITableViewController - - IBProjectSource - ./Classes/InCallTableViewController.h - - - - InCallViewController - UIViewController - - YES - - YES - callTableController - callTableView - testVideoView - videoCameraSwitch - videoGroup - videoPreview - videoView - videoWaitingForFirstImage - - - YES - InCallTableViewController - UITableView - UIView - UICamSwitch - UIView - UIView - UIView - UIActivityIndicatorView - - - - YES - - YES - callTableController - callTableView - testVideoView - videoCameraSwitch - videoGroup - videoPreview - videoView - videoWaitingForFirstImage - - - YES - - callTableController - InCallTableViewController - - - callTableView - UITableView - - - testVideoView - UIView - - - videoCameraSwitch - UICamSwitch - - - videoGroup - UIView - - - videoPreview - UIView - - - videoView - UIView - - - videoWaitingForFirstImage - UIActivityIndicatorView - - - - - IBProjectSource - ./Classes/InCallViewController.h - - - - UICamSwitch - UIButton - - preview - UIView - - - preview - - preview - UIView - - - - IBProjectSource - ./Classes/UICamSwitch.h - - - - UIPreviewView - UIView - - IBProjectSource - ./Classes/UIPreviewView.h - - - - + 0 IBCocoaTouchFramework diff --git a/Classes/Utils/XMLRPC/NSData+Base64.m b/Classes/Utils/XMLRPC/NSData+Base64.m index 2d719f2f1..4e6bb74c0 100755 --- a/Classes/Utils/XMLRPC/NSData+Base64.m +++ b/Classes/Utils/XMLRPC/NSData+Base64.m @@ -296,7 +296,7 @@ char *NewBase64Encode( // - (NSString *)base64EncodedString { - size_t outputLength; + size_t outputLength = 0; char *outputBuffer = NewBase64Encode([self bytes], [self length], true, &outputLength); diff --git a/Classes/Utils/XMLRPC/XMLRPC.xcodeproj/project.pbxproj b/Classes/Utils/XMLRPC/XMLRPC.xcodeproj/project.pbxproj index 7e2cae629..c45de281a 100755 --- a/Classes/Utils/XMLRPC/XMLRPC.xcodeproj/project.pbxproj +++ b/Classes/Utils/XMLRPC/XMLRPC.xcodeproj/project.pbxproj @@ -659,6 +659,7 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + VALID_ARCHS = "armv6 armv7"; }; name = Development; }; @@ -669,6 +670,7 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + VALID_ARCHS = "armv6 armv7"; }; name = Release; }; @@ -688,7 +690,7 @@ PRODUCT_NAME = XMLRPC; PUBLIC_HEADERS_FOLDER_PATH = /headers/; SDKROOT = iphoneos; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv6 armv7"; }; name = Development; }; @@ -707,7 +709,7 @@ PRODUCT_NAME = XMLRPC; PUBLIC_HEADERS_FOLDER_PATH = /headers/; SDKROOT = iphoneos; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv6 armv7"; ZERO_LINK = NO; }; name = Release; @@ -719,6 +721,7 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + VALID_ARCHS = "armv6 armv7"; }; name = Debug; }; @@ -748,7 +751,7 @@ PRODUCT_NAME = XMLRPC; PUBLIC_HEADERS_FOLDER_PATH = /headers/; SDKROOT = iphoneos; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv6 armv7"; }; name = Debug; }; @@ -773,6 +776,7 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + VALID_ARCHS = "armv6 armv7"; }; name = Distribution; }; @@ -801,7 +805,7 @@ PRODUCT_NAME = XMLRPC; PUBLIC_HEADERS_FOLDER_PATH = /headers/; SDKROOT = iphoneos; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv6 armv7"; ZERO_LINK = NO; }; name = Distribution; @@ -827,6 +831,7 @@ ARCHS = "$(ARCHS_STANDARD_32_BIT)"; OTHER_LDFLAGS = "-ObjC"; SDKROOT = iphoneos; + VALID_ARCHS = "armv6 armv7"; }; name = DistributionAdhoc; }; @@ -855,7 +860,7 @@ PRODUCT_NAME = XMLRPC; PUBLIC_HEADERS_FOLDER_PATH = /headers/; SDKROOT = iphoneos; - VALID_ARCHS = "armv7 armv6"; + VALID_ARCHS = "armv6 armv7"; ZERO_LINK = NO; }; name = DistributionAdhoc; diff --git a/Classes/WizardViewController.m b/Classes/WizardViewController.m index 6eb22f833..330032984 100644 --- a/Classes/WizardViewController.m +++ b/Classes/WizardViewController.m @@ -116,16 +116,13 @@ static UICompositeViewDescription *compositeDescription = nil; - (void)viewDidLoad { [super viewDidLoad]; + [self resetWizard]; } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; - [self clearProxyConfig]; - [self changeView:welcomeView back:FALSE animation:FALSE]; - [waitView setHidden:TRUE]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(registrationUpdateEvent:) name:@"LinphoneRegistrationUpdate" @@ -159,6 +156,12 @@ static UICompositeViewDescription *compositeDescription = nil; #pragma mark - +- (void)resetWizard { + [self clearProxyConfig]; + [self changeView:welcomeView back:FALSE animation:FALSE]; + [waitView setHidden:TRUE]; +} + + (UIView*)findTextField:(ViewElement)tag view:(UIView*)view { for(UIView *child in [view subviews]) { if([child tag] == tag){ diff --git a/main.m b/main.m index ecec28813..1535f7764 100644 --- a/main.m +++ b/main.m @@ -25,4 +25,3 @@ int main(int argc, char *argv[]) { [pool release]; return retVal; } - diff --git a/submodules/linphone b/submodules/linphone index 78fae7aca..e6ef8b45a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 78fae7acaf65bf083a8d35ae0c0bdddc87b649cc +Subproject commit e6ef8b45a4d109f06b452276061303c0e2173dda