GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

Add GPUImageView into a GPUImageUIElement

Open jamesdunay opened this issue 7 years ago • 1 comments

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
        }

jamesdunay avatar Sep 22 '16 00:09 jamesdunay

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.

hezhk3 avatar Apr 30 '19 01:04 hezhk3