New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Crash when app goes in background. #197
Comments
Any use of OpenGL ES when the application is in the background will cause the application to be killed. What are you trying to do in GPUImage when your application is going to the background and getting killed? |
I noticed this happens when the camera preview is active when the home or lock buttons are pressed. |
Can you solve it ? I meet it too, can you help me? |
I have this problem too. I tried to register for a notification to run "stopCameraCapture" when applicationWillResignActive gets called in the appDelegate, but the crash still occurs. Stopping the camera via a button action before moving the app into the background works though, however it requires the user to stop the camera himself. update* |
I'm having the same crash issue. Pausing the capture when we applicationWillResignActive works if the user pressed the home button, but not the power button. It also doesn't crash if I place a breakpoint on applicationWillResignActive. |
Calling [pauseCameraCapture] seems to resolve the issue for me. |
Well the problem is that if I call stopCaptureStream I get an exception. My fix: - (void) onVideoStop
{
DLog(@"video stoped");
waitingForStreamToEnd = NO;
} .... -(void) goToSleep
{
waitingForStreamToEnd = YES;
[stillCamera pauseCameraCapture];
stillCamera = nil; // I use ARC this calls release, and the deallc calls stopCameraCapture
while(waitingForStreamToEnd)
{
}
glFinish();
} I hope this helps |
@j455 Interesting. That seems like a sound idea. I take it that this seems to fix the problem reliably, or are you still evaluating? |
Tomorrow I will evaluate it depply...but atm I must say it fixes it for me... If it works... one can simply add a method into the Framework to wait for that thing to happend From: Cameron Perry @j455 Interesting. That seems like a sound idea. I take it that this seems to fix the problem reliably, or are you still evaluating? — |
Nvm... doenst work neither The only thing that really makes this "stable" is to add these two lines at the end of the will resign I think the problem is that [videoOutput setSampleBufferDelegate:nil queue:dispatch_get_main_queue()]; Use the main queue but it gets no time to complete during the resign method or smth... |
Hi folks, just to summarize the findings here:
|
Hi Ye that sounds reasonable. one more thing is, when u pull down the status thing. The OS overall thing that shows the weather and latest feeds, Does your fix do the trick for that too ? -Cheers, |
Why "resign active" and not "did enter background"? |
|
I know it's been a couple years since this is was first filed, but I'm still experiencing this exact problem.
Anyone have any thoughts? |
I am having the same issue as emmasteimann. This is happening for me on GPUImage 0.1.4 even with the proposed fix. |
I recommend adding an observer for
|
I was able to solve this:
|
Thanks @henryl that for sure fixed it. Much appreciated! :-) |
I do like this,but it also crash sometimes when app enterbackground in older iOS devices. self.movie is a instance of GPUImageMovie. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(willResignActive) name:UIApplicationWillResignActiveNotification object:nil];
|
Hi,
I am using this project in my app to record videos and save them to the camera roll. However, I am facing an issue. When the app moves to the background, it crashes and gives "gpus_ReturnNotPermittedKillClient" error which I think comes due to OpenGL calls. I searched on the internet for a solution and found a solution here: http://www.cocos2d-iphone.org/forum/topic/30419
I am unable to understand how to implement that solution since GPU Image project doesn't have an app delegate class. Can you please help me out in this?
Thanks
The text was updated successfully, but these errors were encountered: