BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.25k stars 4.61k forks source link

Over releasing frame buffer when updating the a UI element. #2274

Open samuelbeek opened 8 years ago

samuelbeek commented 8 years ago

Hi,

I'm trying to update a GPUImageUIElement-filter only when the content of the element has changed, because updating UIElements is an expensive operation and really bad for the frame rate. However, whenever I try to call uiElement.update() it throws this error:

Tried to overrelease a framebuffer, did you forget to call -useNextFrameForImageCapture before using -imageFromCurrentFramebuffer?

I've tried this on avery qeue/thread, that doesn't matter.

My setup is the following:

VideoCamera --> CropFilter ----> GaussianBlurFilter ----\
                                                        BlendFilter ----> PreviewLayer
                                          UIElement ----/ 

It currently only works when I update the UIElement like this:

blurFilter.frameProcessingCompletionBlock = { [weak self] output, time in
    self?.uiElements.update()
}

Even if I do it only once per second there by checking the time and only update once every second, it throws the same error.

I've spend a couple of days figuring out how to make this work, but didn't succeed. I've read almost every Stack Overflow and GitHub issue on this matter and haven't found a solution yet, so I'm a little desperate. Anyone knows what might be causing this issue? Thanks in advance.

kevin-zqw commented 8 years ago

Same issue for me, can someone help?

klemenzagar91 commented 8 years ago

I have the same issue.

mokeClub commented 8 years ago

I have the same issue too,is someone can help?

mokeClub commented 8 years ago

you guys can see https://github.com/BradLarson/GPUImage/issues/2211 hope can help you

smallqiang commented 5 years ago

I have the same issue too,is someone can help?