0
votes

I am using Xcode 6.1 with iOS SDK 8.1.

I added the static library as described on Github readme and added this code.

GPUImageStillCamera *rearCamera = [[GPUImageStillCamera alloc] init];
    rearCamera.outputImageOrientation = UIInterfaceOrientationPortrait;
    GPUImageBrightnessFilter *filter = [[GPUImageBrightnessFilter alloc] init];
    [rearCamera addTarget:filter];
    [filter addTarget:_viewRoot];

_viewRearCamera.hidden=YES;
_viewFrontCamera.hidden=YES;
_viewAdMobBG.hidden=YES;

[rearCamera startCameraCapture];

_viewRoot is a GPUImageView instance in Storyboard which is connected to VC as @property (strong, nonatomic) IBOutlet GPUImageView *viewRoot;

All I get is white screen and the camera won't load. I am using latest GPUImage code from Github.

1

1 Answers

2
votes

So after wasting 2.5 days I concluded that the camera instance variable and filter instance variable needs to be global.

Thus I can't use GPUImageStillCamera *rearCamera = [[GPUImageStillCamera alloc] init]; but define rearCamera as global variable in header file similarly with GPUImageBrightnessFilter *filter = [[GPUImageBrightnessFilter alloc] init];