mirror of
https://github.com/moonlight-stream/moonlight-ios.git
synced 2025-07-23 12:44:19 +00:00
Delay frame drawing for a 30 FPS target. Change rendering configuration for faster drawing. Perform the segue after the URL request returns.
This commit is contained in:
parent
4b9e68950a
commit
01f11fc095
@ -33,8 +33,6 @@ static NSString* hostAddr;
|
||||
hostAddr = self.HostField.text;
|
||||
NSString* host = [NSString stringWithFormat:@"http://%@:47989/launch?uniqueid=0&appid=67339056", self.HostField.text];
|
||||
NSLog(@"host: %@", host);
|
||||
|
||||
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
|
||||
|
||||
NSURL* url = [[NSURL alloc] initWithString:host];
|
||||
NSMutableURLRequest* request = [[NSMutableURLRequest alloc] initWithURL:url];
|
||||
@ -42,6 +40,8 @@ static NSString* hostAddr;
|
||||
NSURLResponse* response = nil;
|
||||
NSData *response1 = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:NULL];
|
||||
NSLog(@"url response: %@", response1);
|
||||
|
||||
[self performSegueWithIdentifier:@"createStreamFrame" sender:self];
|
||||
}
|
||||
|
||||
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
|
||||
|
@ -56,7 +56,9 @@
|
||||
image = CGBitmapContextCreateImage(bitmapContext);
|
||||
|
||||
struct CGContext* context = UIGraphicsGetCurrentContext();
|
||||
|
||||
|
||||
CGContextSetBlendMode(context, kCGBlendModeCopy);
|
||||
CGContextSetInterpolationQuality(context, kCGInterpolationNone);
|
||||
CGContextRotateCTM(context, -M_PI_2);
|
||||
CGContextScaleCTM(context, -(float)self.frame.size.width/self.frame.size.height, (float)self.frame.size.height/self.frame.size.width);
|
||||
CGContextDrawImage(context, rect, image);
|
||||
|
@ -27,7 +27,7 @@ static bool render = false;
|
||||
if (render)
|
||||
{
|
||||
[self.renderTarget performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:NULL waitUntilDone:TRUE];
|
||||
usleep(5000);
|
||||
usleep(25000);
|
||||
} else {
|
||||
sleep(1);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user