- (void)observeGlobalNotifications
{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onApplicationWillResignActive) name:UIApplicationWillResignActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onApplicationDidBecomeActive) name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void)unobserveGlobalNotifications
{
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillResignActiveNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidBecomeActiveNotification object:nil];
}
- (void)onApplicationWillResignActive
{
[self.camera pauseCameraCapture];
[self.camera stopCameraCapture];
runSynchronouslyOnVideoProcessingQueue(^{
glFinish();
});
}
- (void)onApplicationDidBecomeActive
{
[self.camera resumeCameraCapture];
[self.camera startCameraCapture];
}
iOS GPUimageCamera锁屏崩溃解决方法
最新推荐文章于 2021-05-29 14:06:18 发布