How to immediately stop decoding in GPUImage?-Collection of common programming errors
You should listen for UIApplicationWillResignActiveNotification and UIApplicationWillEnterForegroundNotification in the view controller where you are processing the movie:
// handles the user pressing the home or power button while the camera is onscreen
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didResignActive:)
name: UIApplicationWillResignActiveNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(willEnterForeground:)
name:UIApplicationWillEnterForegroundNotification
object:nil];
Then you should add the appropriate methods to respond to the notifications:
-(void) didResignActive: (NSString *) notification {
//stop processing the movie
}
-(void) willEnterForeground: (NSString *) notification {
// start processing the movie
}
I’m pretty sure you can start processing by calling [movie startProcessing];
and stop processing with [movie endProcessing];
but I’m not positive.