Merge branch 'dynamicBitrate' into Integration
This commit is contained in:
commit
19e78d5eb6
5 files changed
+41
-1
No files matched your search
@@ -29,6 +29,7 @@
|
|||||||
- (NSURLRequest*) newLaunchOrResumeRequest:(NSString*)verb config:(StreamConfiguration*)config;
|
- (NSURLRequest*) newLaunchOrResumeRequest:(NSString*)verb config:(StreamConfiguration*)config;
|
||||||
- (NSURLRequest*) newQuitAppRequest;
|
- (NSURLRequest*) newQuitAppRequest;
|
||||||
- (NSURLRequest*) newAppAssetRequestWithAppId:(NSString*)appId;
|
- (NSURLRequest*) newAppAssetRequestWithAppId:(NSString*)appId;
|
||||||
|
- (NSURLRequest*) newBirateRequest:(NSInteger)bitrateKbps forClient:(NSString* )clientName;
|
||||||
- (void) executeRequestSynchronously:(HttpRequest*)request;
|
- (void) executeRequestSynchronously:(HttpRequest*)request;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -231,6 +231,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSString* urlString = [NSString stringWithFormat:@"%@/applist?uniqueid=%@", _baseHTTPSURL, _uniqueId];
|
NSString* urlString = [NSString stringWithFormat:@"%@/applist?uniqueid=%@", _baseHTTPSURL, _uniqueId];
|
||||||
|
NSLog(@"urlString: %@", urlString);
|
||||||
return [self createRequestFromString:urlString timeout:NORMAL_TIMEOUT_SEC];
|
return [self createRequestFromString:urlString timeout:NORMAL_TIMEOUT_SEC];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,9 +293,22 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSString* urlString = [NSString stringWithFormat:@"%@/cancel?uniqueid=%@", _baseHTTPSURL, _uniqueId];
|
NSString* urlString = [NSString stringWithFormat:@"%@/cancel?uniqueid=%@", _baseHTTPSURL, _uniqueId];
|
||||||
|
NSLog(@"urlString print: %@", urlString);
|
||||||
return [self createRequestFromString:urlString timeout:LONG_TIMEOUT_SEC];
|
return [self createRequestFromString:urlString timeout:LONG_TIMEOUT_SEC];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSURLRequest*)newBirateRequest:(NSInteger)bitrateKbps forClient:(NSString* )clientName {
|
||||||
|
if (![self ensureHttpsUrlPopulated:NO]) {
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
|
NSString* urlString = [NSString stringWithFormat:@"%@/bitrate?clientname=%@&bitrate=%@&uniqueid=%@", _baseHTTPSURL, clientName, [NSString stringWithFormat:@"%ld", (long)bitrateKbps], _uniqueId];
|
||||||
|
|
||||||
|
NSLog(@"bitrate urlString print: %@", urlString);
|
||||||
|
return [self createRequestFromString:urlString timeout:LONG_TIMEOUT_SEC];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
- (NSURLRequest*) newAppAssetRequestWithAppId:(NSString *)appId {
|
- (NSURLRequest*) newAppAssetRequestWithAppId:(NSString *)appId {
|
||||||
if (![self ensureHttpsUrlPopulated:NO]) {
|
if (![self ensureHttpsUrlPopulated:NO]) {
|
||||||
return nil;
|
return nil;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@
|
|||||||
- (void)reloadStreamConfig;
|
- (void)reloadStreamConfig;
|
||||||
- (bool)isIPhonePortrait;
|
- (bool)isIPhonePortrait;
|
||||||
- (void)quitRunningApp;
|
- (void)quitRunningApp;
|
||||||
|
- (NSInteger)requestForBitrate:(NSInteger)bitrateKbps;
|
||||||
#endif
|
#endif
|
||||||
- (void)fillResolutionTable:(CGSize*)resolutionTable externalDisplayMode:(NSInteger)externalDisplayMode;
|
- (void)fillResolutionTable:(CGSize*)resolutionTable externalDisplayMode:(NSInteger)externalDisplayMode;
|
||||||
|
|
||||||
|
|||||||
@@ -915,6 +915,15 @@ static NSMutableSet* hostList;
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSInteger)requestForBitrate:(NSInteger)bitrateKbps{
|
||||||
|
HttpManager* hMan = [[HttpManager alloc] initWithHost:launchedApp.host];
|
||||||
|
HttpResponse* bitrateResponse = [[HttpResponse alloc] init];
|
||||||
|
HttpRequest* bitrateRequest = [HttpRequest requestForResponse: bitrateResponse withUrlRequest:[hMan newBirateRequest:bitrateKbps forClient:@"unknown"]];
|
||||||
|
[hMan executeRequestSynchronously:bitrateRequest];
|
||||||
|
NSLog(@"bitrate request status code: %ld", (long)bitrateResponse.statusCode);
|
||||||
|
return bitrateResponse.statusCode;
|
||||||
|
}
|
||||||
|
|
||||||
- (HttpResponse* )requestToQuitApp:(TemporaryApp* )app{
|
- (HttpResponse* )requestToQuitApp:(TemporaryApp* )app{
|
||||||
HttpManager* hMan = [[HttpManager alloc] initWithHost:app.host];
|
HttpManager* hMan = [[HttpManager alloc] initWithHost:app.host];
|
||||||
HttpResponse* quitResponse = [[HttpResponse alloc] init];
|
HttpResponse* quitResponse = [[HttpResponse alloc] init];
|
||||||
@@ -1168,7 +1177,7 @@ static NSMutableSet* hostList;
|
|||||||
[streamFrameViewController setUserInteractionEnabledForStreamView:!_settingsExpandedInStreamView || position == FrontViewPositionLeft];
|
[streamFrameViewController setUserInteractionEnabledForStreamView:!_settingsExpandedInStreamView || position == FrontViewPositionLeft];
|
||||||
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.resolutionStack];
|
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.resolutionStack];
|
||||||
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.fpsStack];
|
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.fpsStack];
|
||||||
[settingsViewController widget:settingsViewController.bitrateSlider setEnabled:!self.settingsExpandedInStreamView];
|
// [settingsViewController widget:settingsViewController.bitrateSlider setEnabled:!self.settingsExpandedInStreamView];
|
||||||
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.optimizeGamesStack];
|
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.optimizeGamesStack];
|
||||||
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioOnPcStack];
|
[settingsViewController setHidden:_settingsExpandedInStreamView forStack:settingsViewController.audioOnPcStack];
|
||||||
[settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView];
|
[settingsViewController.codecSelector setEnabled:!_settingsExpandedInStreamView];
|
||||||
|
|||||||
@@ -320,6 +320,15 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
selector:@selector(deviceOrientationDidChange:) // handle orientation change since i made portrait mode available
|
selector:@selector(deviceOrientationDidChange:) // handle orientation change since i made portrait mode available
|
||||||
name:UIDeviceOrientationDidChangeNotification
|
name:UIDeviceOrientationDidChangeNotification
|
||||||
object:nil];
|
object:nil];
|
||||||
|
|
||||||
|
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
|
||||||
|
if(self.mainFrameViewController.settingsExpandedInStreamView){
|
||||||
|
NSInteger responseCode = [self.mainFrameViewController requestForBitrate:self->_bitrate];
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self widget:self.bitrateSlider setEnabled:responseCode == 200];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated{
|
- (void)viewDidAppear:(BOOL)animated{
|
||||||
@@ -1953,6 +1962,7 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
[touchAndControlSection updateViewForFoldState];
|
[touchAndControlSection updateViewForFoldState];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void) updateBitrate {
|
- (void) updateBitrate {
|
||||||
NSInteger fps = [self getChosenFrameRate];
|
NSInteger fps = [self getChosenFrameRate];
|
||||||
NSInteger width = [self getChosenStreamWidth];
|
NSInteger width = [self getChosenStreamWidth];
|
||||||
@@ -2294,6 +2304,11 @@ BOOL isCustomResolution(int resolutionSelected) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void) saveSettings {
|
- (void) saveSettings {
|
||||||
|
|
||||||
|
if(self.mainFrameViewController.settingsExpandedInStreamView){
|
||||||
|
[self.mainFrameViewController requestForBitrate:(uint32_t)_bitrate];
|
||||||
|
}
|
||||||
|
|
||||||
DataManager* dataMan = [[DataManager alloc] init];
|
DataManager* dataMan = [[DataManager alloc] init];
|
||||||
Settings* currentSettings = [dataMan retrieveSettings];
|
Settings* currentSettings = [dataMan retrieveSettings];
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user