GPUImage
GPUImage copied to clipboard
Add GPUImageView into a GPUImageUIElement
Hey guys/girls
I'm trying to add a GPUImageView (which is playing a movie) into a GPUImageUIElement.
I've added all the elements that I would like to render to the overlay
view. I'm able to see a background color for the view I've added, but the video does not show. I can also add text this way but I was interested to find out if there might be something up with adding a GPUImageView. For what it's worth I've also tried adding a UIImageView with a series of animation images, but still no luck. Thanks for taking a look.
func overlayFilter(target: GPUImageOutput) -> GPUImageFilter {
let logoElement = GPUImageUIElement(view: overlay)
let blendFilter = GPUImageAlphaBlendFilter()
blendFilter.mix = 1.0
target.addTarget(blendFilter)
logoElement.addTarget(blendFilter)
target.frameProcessingCompletionBlock = { (currentFilter, frameTime) in
print("Updating")
logoElement?.update() }
return blendFilter
}
GPUImageUIElement renders the CALayer into a bitmap context.
[layer renderInContext:imageContext];
But GPUImageView's layer is a CAEAGLLayer, which won't render it's content to the context.