Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (void)viewDidLoad {
- [super viewDidLoad];
- movieFile = [[GPUImageMovie alloc] initWithURL:@"URL"];
- movieFile.runBenchmark = YES;
- movieFile.playAtActualSpeed = YES;
- filterImageView = [[GPUImageView alloc] initWithFrame:self.view.frame];
- [_videoContainerView addSubview:filterImageView];
- [self applyFilterForRow:0];
- }
- //Method To Switch Filter
- -(void)applyFilterForRow:(NSInteger )row
- {
- [movieFile endProcessing];
- [movieFile removeAllTargets];
- [filter removeAllTargets];
- if (row == 0) {
- filter = [[GPUImagePixellateFilter alloc] init];
- }
- else{
- filter = [[GPUImageFilter alloc] initWithFragmentShaderFromFile:@"custom"];
- }
- [movieFile addTarget:filter];
- [filter addTarget:filterImageView];
- [movieFile startProcessing];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement