view is now centered and rendering is flipped correctly

This commit is contained in:
Diego Waxemberg
2014-01-18 21:39:29 -05:00
parent f97fe7fce2
commit 72ed023645
3 changed files with 28 additions and 43 deletions

View File

@@ -18,14 +18,25 @@
- (void)viewDidLoad
{
[super viewDidLoad];
StreamView* streamView = [[StreamView alloc] initWithFrame:self.view.frame];
streamView.backgroundColor = [UIColor blackColor];
[self.view addSubview:streamView];
[streamView setNeedsDisplay];
// Do any additional setup after loading the view.
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);
streamView.transform = transform;
// Repositions and resizes the view.
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.
NSString* path = [[NSBundle mainBundle] pathForResource:@"notpadded"
ofType:@"h264"];
NSLog(@"Path: %@", path);