BradLarson/GPUImage — pull request #408 by pavankataria (2012-08-24 16:03:48+00:00)
Title: added an encodingProgressBlock to allow one to get the progress state when a movie is being encoded

Hi brad..

i've added an encodingProgressBlock to allow one to get the progress state when a movie is being encoded

this is how it works:

[movieFile setEncodingProgressBlock:^(float progress){
//NSLog(@"progress %f", progress);
//values start from 0.0 and finish at 1.0
[ProgressBar setProgress:progress];
}];
[movieWriter setCompletionBlock:^{
NSLog(@"video encoding done");
[ProgressBar dismissWithStatus@"done"];
[anyFilter removeTarget:movieWriter];
[movieWriter finishRecording];
UISaveVideoAtPathToSavedPhotosAlbum(pathToMovie, nil, nil,
nil);
}];

I really should have used properties instead of creating my own getters
and setters… i didn't plan to have that many.. Brad maybe you can just
optimise the code.

It does work like a charm though. Before you would only be able to set
a completion block and while the movie was being encoded there was no
way of telling how long it would take or how much of the encoding
process was left. so i created this to cater for that.