How can I add dynamic text to this pipeline of filters? I know I need a blend filter and a UIElement but I'm not sure where/who to add to what targets.
Can anyone help?
videoCamera = [[GPUImageStillCamera alloc] initWithSessionPreset:AVCaptureSessionPresetMedium cameraPosition:AVCaptureDevicePositionBack];
videoCamera.outputImageOrientation = UIInterfaceOrientationLandscapeRight;
cropFilter = [[GPUImageCropFilter alloc] initWithCropRegion:CGRectMake(0, 0, 1, 1)];
sourcePicture = [[GPUImagePicture alloc] initWithImage:[NPFilterBuilder getTextureOverlay] smoothlyScaleOutput:NO];
[sourcePicture processImage];
customFilter = [NPFilterBuilder getFilter];
[videoCamera addTarget:cropFilter];
[cropFilter addTarget:customFilter atTextureLocation:0];
[sourcePicture addTarget:customFilter atTextureLocation:1];
[customFilter addTarget:mViewCameraPreview];
[videoCamera startCameraCapture];
I know I need to do something like this:
blendFilter = [[GPUImageAlphaBlendFilter alloc] init];
blendFilter.mix = 1.0;
uiElementInput = [[GPUImageUIElement alloc]initWithView:[self buildTimeLabel]];
[uiElementInput addTarget:blendFilter];
__unsafe_unretained GPUImageUIElement *weakUIElementInput = uiElementInput;
[filter setFrameProcessingCompletionBlock:^(GPUImageOutput * filter, CMTime frameTime){
[weakUIElementInput update];
}];
I need to add the blendFilter to somewhere in my filter chain however I can't figure out where to do it. I made a diagram of how I think my current chain looks.
May be it will help you: