GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageViewCamera crashing on app background/resign.

Open pkluz opened this issue 12 years ago • 4 comments

When the app is interrupted by a phone call and/or the home button is pressed, sometimes the result is the following:

screen shot 2014-04-02 at 11 47 56 pm

What I'm doing other than initing the elements:

[self.camera addTarget:self.cameraBlurFilter];
[self.cameraBlurFilter addTarget:self.cameraExposureFilter];
[self.cameraExposureFilter addTarget:self.cameraBlurView];
...
[self.camera startCameraCapture]; // This call can happen off-mainthread.

Is this a known problem or is it rather me misusing the API?

pkluz avatar Apr 02 '14 21:04 pkluz

See issue #1494. This was fixed in a previous commit, but CocoaPods users don't get any of these fixes unless I manually update tags (which I just did).

BradLarson avatar Apr 02 '14 21:04 BradLarson

Haha much appreciated and terribly sorry. Scanned the first couple pages but I wasn't through enough so it seems. +1

pkluz avatar Apr 02 '14 22:04 pkluz

After updating to the newest version using Cocoapods :head flag, this is the crash I experience in exactly the same situation as mentioned above:

screen shot 2014-04-06 at 5 50 55 pm

pkluz avatar Apr 06 '14 15:04 pkluz

That's a different crash. In that case, the application is being killed because it's attempting to render using OpenGL ES while the application is in the background. That will cause your application to be hard-killed by the system (thus the KillClient in the stack trace above, instead of a segmentation fault or other assertion).

You have to somehow make sure that the camera capture is paused the instant your application is told to go to the background. You can listen for the notifications you get due to this and pause the camera capture right then.

BradLarson avatar Apr 06 '14 19:04 BradLarson