mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-08 00:36:21 +00:00
added code to launch a stream and decode and render the stream
This commit is contained in:
@@ -7,7 +7,14 @@
|
||||
//
|
||||
|
||||
#import "StreamFrameViewController.h"
|
||||
#import "MainFrameViewController.h"
|
||||
#import "VideoDepacketizer.h"
|
||||
#import "Connection.h"
|
||||
#import "VideoRenderer.h"
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
|
||||
@interface StreamFrameViewController ()
|
||||
|
||||
@@ -18,6 +25,8 @@
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[UIApplication sharedApplication].idleTimerDisabled = YES;
|
||||
|
||||
StreamView* streamView = [[StreamView alloc] initWithFrame:self.view.frame];
|
||||
streamView.backgroundColor = [UIColor blackColor];
|
||||
@@ -25,8 +34,6 @@
|
||||
[self.view addSubview:streamView];
|
||||
[streamView setNeedsDisplay];
|
||||
|
||||
|
||||
|
||||
CGAffineTransform transform = CGAffineTransformMakeTranslation((streamView.frame.size.height/2) - (streamView.frame.size.width/2), (streamView.frame.size.width/2) - (streamView.frame.size.height/2));
|
||||
transform = CGAffineTransformRotate(transform, M_PI_2);
|
||||
transform = CGAffineTransformScale(transform, -1, -1);
|
||||
@@ -36,14 +43,17 @@
|
||||
CGRect contentRect = CGRectMake(0,0, self.view.frame.size.width, self.view.frame.size.height);
|
||||
streamView.bounds = contentRect;
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
/* // Do any additional setup after loading the view.
|
||||
NSString* path = [[NSBundle mainBundle] pathForResource:@"notpadded"
|
||||
ofType:@"h264"];
|
||||
NSLog(@"Path: %@", path);
|
||||
VideoDepacketizer* depacketizer = [[VideoDepacketizer alloc] initWithFile:path renderTarget:streamView];
|
||||
NSOperationQueue* opQueue = [[NSOperationQueue alloc] init];
|
||||
[opQueue addOperation:depacketizer];
|
||||
VideoDepacketizer* depacketizer = [[VideoDepacketizer alloc] initWithFile:path renderTarget:streamView];*/
|
||||
|
||||
Connection* conn = [[Connection alloc] initWithHost:inet_addr([MainFrameViewController getHostAddr]) width:1280 height:720];
|
||||
|
||||
NSOperationQueue* opQueue = [[NSOperationQueue alloc] init];
|
||||
[opQueue addOperation:conn];
|
||||
[opQueue addOperation:[[VideoRenderer alloc]initWithTarget:streamView]];
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user