ios - How to manage GPUImage movieFile Processing in background? -
i have implemented gpuimage
library apply filters in existing videos, issue application crash when lock device, have set bool
variable application current state, bun unfortunately resignactive call after application crash. crash happen in line of code.
[self.context presentrenderbuffer:gl_renderbuffer];
can please suggest me best way deal this.
-(void)viewwillappear:(bool)animated{ [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(enterbackground:) name:uiapplicationwillresignactivenotification object:nil]; [[nsnotificationcenter defaultcenter]addobserver:self selector:@selector(didbecomeactive:) name:uiapplicationdidbecomeactivenotification object:nil]; } - (void)enterbackground:(nsnotification*)notification{ nslog(@"enter in background"); [self.moviefile endprocessing]; [self.filter removealltargets]; [self.moviefile removealltargets]; } - (void)didbecomeactive:(nsnotification*)notification{ [_moviefile startprocessing]; }
don't forget remove observer in viewwilldisappear
Comments
Post a Comment