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

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -