forked from mirrors/linphone-iphone
Improve InCall video stuff
This commit is contained in:
parent
c34f09e2d1
commit
0284edb3af
8 changed files with 44 additions and 178 deletions
|
|
@ -28,10 +28,6 @@
|
|||
|
||||
@class VideoViewController;
|
||||
|
||||
@interface UIPreviewView : UIView
|
||||
|
||||
@end
|
||||
|
||||
@interface InCallViewController : UIViewController <CallActionSheetDelegate, UIGestureRecognizerDelegate, UICompositeViewDelegate> {
|
||||
|
||||
InCallTableViewController* callTableController;
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,6 @@
|
|||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{-1000, -1000}, {2000, 2000}}</string>
|
||||
<reference key="NSSuperview" ref="1009068048"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1017044170"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
|
|
@ -66,7 +65,6 @@
|
|||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview" ref="1009068048"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="69034748"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:196</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor" id="95762599">
|
||||
|
|
@ -77,10 +75,9 @@
|
|||
</object>
|
||||
<object class="IBUIView" id="673568144">
|
||||
<reference key="NSNextResponder" ref="1009068048"/>
|
||||
<int key="NSvFlags">265</int>
|
||||
<int key="NSvFlags">283</int>
|
||||
<string key="NSFrame">{{220, 360}, {100, 100}}</string>
|
||||
<reference key="NSSuperview" ref="1009068048"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="972197710"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<int key="IBUIContentMode">1</int>
|
||||
|
|
@ -91,7 +88,6 @@
|
|||
<int key="NSvFlags">301</int>
|
||||
<string key="NSFrame">{{141, 212}, {37, 37}}</string>
|
||||
<reference key="NSSuperview" ref="1009068048"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="673568144"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:1030</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
|
|
@ -103,7 +99,6 @@
|
|||
</object>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview" ref="858247959"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="327164432"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:196</string>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
|
|
@ -114,7 +109,6 @@
|
|||
<int key="NSvFlags">274</int>
|
||||
<string key="NSFrame">{{0, -10}, {320, 480}}</string>
|
||||
<reference key="NSSuperview" ref="858247959"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="1009068048"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:418</string>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
|
|
@ -143,9 +137,9 @@
|
|||
<object class="IBUIButton" id="972197710">
|
||||
<reference key="NSNextResponder" ref="858247959"/>
|
||||
<int key="NSvFlags">-2147483356</int>
|
||||
<string key="NSFrameSize">{85, 33}</string>
|
||||
<string key="NSFrame">{{0, 23}, {85, 33}}</string>
|
||||
<reference key="NSSuperview" ref="858247959"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
|
|
@ -178,7 +172,6 @@
|
|||
</object>
|
||||
<string key="NSFrameSize">{320, 460}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="662692377"/>
|
||||
<reference key="IBUIBackgroundColor" ref="95762599"/>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
|
|
@ -400,7 +393,6 @@
|
|||
<string>-2.IBPluginDependency</string>
|
||||
<string>106.IBPluginDependency</string>
|
||||
<string>126.IBPluginDependency</string>
|
||||
<string>127.CustomClassName</string>
|
||||
<string>127.IBPluginDependency</string>
|
||||
<string>132.IBPluginDependency</string>
|
||||
<string>144.IBPluginDependency</string>
|
||||
|
|
@ -420,7 +412,6 @@
|
|||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>UIPreviewView</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
|
|
@ -447,128 +438,7 @@
|
|||
<nil key="sourceID"/>
|
||||
<int key="maxID">173</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">InCallTableViewController</string>
|
||||
<string key="superclassName">UITableViewController</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/InCallTableViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">InCallViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>callTableController</string>
|
||||
<string>callTableView</string>
|
||||
<string>testVideoView</string>
|
||||
<string>videoCameraSwitch</string>
|
||||
<string>videoGroup</string>
|
||||
<string>videoPreview</string>
|
||||
<string>videoView</string>
|
||||
<string>videoWaitingForFirstImage</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>InCallTableViewController</string>
|
||||
<string>UITableView</string>
|
||||
<string>UIView</string>
|
||||
<string>UICamSwitch</string>
|
||||
<string>UIView</string>
|
||||
<string>UIView</string>
|
||||
<string>UIView</string>
|
||||
<string>UIActivityIndicatorView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="NSArray" key="dict.sortedKeys">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<string>callTableController</string>
|
||||
<string>callTableView</string>
|
||||
<string>testVideoView</string>
|
||||
<string>videoCameraSwitch</string>
|
||||
<string>videoGroup</string>
|
||||
<string>videoPreview</string>
|
||||
<string>videoView</string>
|
||||
<string>videoWaitingForFirstImage</string>
|
||||
</object>
|
||||
<object class="NSArray" key="dict.values">
|
||||
<bool key="EncodedWithXMLCoder">YES</bool>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">callTableController</string>
|
||||
<string key="candidateClassName">InCallTableViewController</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">callTableView</string>
|
||||
<string key="candidateClassName">UITableView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">testVideoView</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoCameraSwitch</string>
|
||||
<string key="candidateClassName">UICamSwitch</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoGroup</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoPreview</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoView</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo">
|
||||
<string key="name">videoWaitingForFirstImage</string>
|
||||
<string key="candidateClassName">UIActivityIndicatorView</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/InCallViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UICamSwitch</string>
|
||||
<string key="superclassName">UIButton</string>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">preview</string>
|
||||
<string key="NS.object.0">UIView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">preview</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">preview</string>
|
||||
<string key="candidateClassName">UIView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UICamSwitch.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">UIPreviewView</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/UIPreviewView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencies">
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ char *NewBase64Encode(
|
|||
//
|
||||
- (NSString *)base64EncodedString
|
||||
{
|
||||
size_t outputLength;
|
||||
size_t outputLength = 0;
|
||||
char *outputBuffer =
|
||||
NewBase64Encode([self bytes], [self length], true, &outputLength);
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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){
|
||||
|
|
|
|||
1
main.m
1
main.m
|
|
@ -25,4 +25,3 @@ int main(int argc, char *argv[]) {
|
|||
[pool release];
|
||||
return retVal;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 78fae7acaf65bf083a8d35ae0c0bdddc87b649cc
|
||||
Subproject commit e6ef8b45a4d109f06b452276061303c0e2173dda
|
||||
Loading…
Add table
Reference in a new issue