added support for different resolutions and frame rates

This commit is contained in:
Diego Waxemberg
2014-10-20 20:54:03 -04:00
parent 85ee4f6518
commit 4c646e36c7
9 changed files with 75 additions and 39 deletions
+38 -4
View File
@@ -13,6 +13,7 @@
#import "Connection.h"
#import "VideoDecoderRenderer.h"
#import "StreamManager.h"
#import "Utils.h"
@implementation MainFrameViewController {
NSOperationQueue* _opQueue;
@@ -20,10 +21,10 @@
Computer* _selectedHost;
UIAlertView* _pairAlert;
}
static NSString* host;
static StreamConfiguration* streamConfig;
+ (NSString*) getHost {
return host;
+ (StreamConfiguration*) getStreamConfiguration {
return streamConfig;
}
- (void)PairButton:(UIButton *)sender
@@ -73,7 +74,40 @@ static NSString* host;
_selectedHost = [[Computer alloc] initWithIp:self.hostTextField.text];
NSLog(@"Using custom host: %@", self.hostTextField.text);
}
host = _selectedHost.hostName;
streamConfig = [[StreamConfiguration alloc] init];
streamConfig.host = _selectedHost.hostName;
streamConfig.hostAddr = [Utils resolveHost:_selectedHost.hostName];
int selectedConf = [self.StreamConfigs selectedRowInComponent:0];
NSLog(@"selectedConf: %d", selectedConf);
switch (selectedConf) {
case 0:
streamConfig.width = 1280;
streamConfig.height = 720;
streamConfig.frameRate = 30;
break;
case 1:
streamConfig.width = 1280;
streamConfig.height = 720;
streamConfig.frameRate = 60;
break;
case 2:
streamConfig.width = 1920;
streamConfig.height = 720;
streamConfig.frameRate = 30;
break;
case 3:
streamConfig.width = 1920;
streamConfig.height = 1080;
streamConfig.frameRate = 60;
break;
default:
streamConfig.width = 1280;
streamConfig.height = 720;
streamConfig.frameRate = 60;
break;
}
NSLog(@"StreamConfig: %@, %d, %dx%dx%d", streamConfig.host, streamConfig.hostAddr, streamConfig.width, streamConfig.height, streamConfig.frameRate);
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
}