The PLCameraController class is for controlling iPhone's built-in camera and one of Apple's private frameworks. If you want to get the preview of incoming video stream from the camera, it is quite easy to do it. Here are steps to do it.
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// Hide the status bar
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
// Get the view for preview and start preview
PLCameraController *cam = [PLCameraController sharedInstance];
UIView *view = [cam previewView];
[cam startPreview];
// Add the preview view to window
[window addSubview:view];
// Override point for customization after app launch
[window makeKeyAndVisible];
}
Now, run the application then you will see something like the screen show below.
Basically, the resolution of the video coming from the camera is 304x400, which is a little weird. The preview video stream is resized in the preview view. If we do not set a new frame size, it is resized with a fixed aspect ratio and thus, there are white area at the bottom of the screen.
For full screen preview, set the frame size of the preview view like this :
view.frame = CGRectMake(0,0, 320, 480) ;
Update : I tried several tests and it turns out that the preview is actually 304x400.