GPUImageView Black When ViewController Reloaded

Using the code below (in viewDidLoad), when I first switch from another view to this view of a still camera (click the button), everything will be fine. Then I send the delegate and reject this opinion from the previous submission.

But, when I press this button again in the first view to show the camera view again, the screen is black. I changed the properties to instance variables, made sure that the preview preview exists at every step, etc.

But, when I take a picture (even when the screen is black and it registers focus and exposure and responds to touch) and displays a modal view that displays the image for review, I really see what I should see, And when I reject the modal mode, viewing the camera is again beautiful with black.

So what am I missing here? It should be something simple within, IB, storyboard, etc. Thanks!

stillCamera = [[GPUImageStillCamera alloc] initWithSessionPreset:AVCaptureSessionPresetPhoto cameraPosition:AVCaptureDevicePositionBack]; stillCamera.outputImageOrientation = UIInterfaceOrientationLandscapeLeft; UIImage *inputImage = [UIImage imageNamed:@"blank-1x1.png"]; sourcePicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; [sourcePicture processImage]; filter = [[GPUImageChromaKeyBlendFilter alloc] init]; [(GPUImageChromaKeyBlendFilter *)filter setColorToReplaceRed:0.0 green:1.0 blue:0.0]; [(GPUImageChromaKeyBlendFilter *)filter setThresholdSensitivity:0.37f]; [stillCamera addTarget:filter]; [sourcePicture addTarget:filter]; [filter addTarget:videoPreviewView]; [stillCamera startCameraCapture]; 
+4
source share
1 answer

I would advise you to carefully read this topic and this comment: https://github.com/BradLarson/GPUImage/issues/130#issuecomment-5936685 . I hope he helps you too.

0
source

All Articles