Search code examples
iosobjective-cgpuimage

GPUImage detect when processing is done


I am using GPUImage to filter videos and I am making Filter picker and every time the user selects a filter it processes the video the problem is if they pick a filter while its still processing the app crashes. So I need a way to detect when the processing is done.


Solution

  • If you are using GPUImageMovie, check the progress value to determine if a process is currently running. A value in-between 0.0 and 1.0 would mean that the movie is being processed.

    Here is a possible implementation: If a process request is received during processing, record the request (using an NSArray for example) and create a NSTimer that repeatedly checks the progress of the movie currently processing. Once the progress = 1.0, invalidate the timer and start the next process.