#import #import #import "GPUImageOpenGLESContext.h" #import "GPUImageOutput.h" /** Protocol for getting Movie played callback. */ @protocol GPUImageMovieDelegate - (void)didCompletePlayingMovie; @end /** Source object for filtering movies */ @interface GPUImageMovie : GPUImageOutput @property (readwrite, retain) AVAsset *asset; @property(readwrite, retain) NSURL *url; /** This enables the benchmarking mode, which logs out instantaneous and average frame times to the console */ @property(readwrite, nonatomic) BOOL runBenchmark; /** This determines whether to play back a movie as fast as the frames can be processed, or if the original speed of the movie should be respected. Defaults to NO. */ @property(readwrite, nonatomic) BOOL playAtActualSpeed; /** This determines whether to play the sound channel of a movie. Defaults to NO. */ @property (readwrite, nonatomic) BOOL playSound; /** This is used to send the delete Movie did complete playing alert */ @property (readwrite, nonatomic, assign) id delegate; /// @name Initialization and teardown - (id)initWithAsset:(AVAsset *)asset; - (id)initWithURL:(NSURL *)url; - (void)textureCacheSetup; /// @name Movie processing - (void)enableSynchronizedEncodingUsingMovieWriter:(GPUImageMovieWriter *)movieWriter; - (void)readNextVideoFrameFromOutput:(AVAssetReaderTrackOutput *)readerVideoTrackOutput; - (void)readNextAudioSampleFromOutput:(AVAssetReaderTrackOutput *)readerAudioTrackOutput; - (void)startProcessing; - (void)resumeProcessing; - (void)endProcessing; - (void)processMovieFrame:(CMSampleBufferRef)movieSampleBuffer; @end