GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

GPUImageLowPassFilter makes crash.

Open donobono opened this issue 13 years ago • 8 comments

Today, I downloaded all your source and I added GPUImageLowPassFilter in SimplePhotoSimplePhotoFilter sample like below.

viewDidLoad method GPUImageLowPassFilter *filterLowPass = [[GPUImageLowPassFilter alloc] init]; [filterLowPass setFilterStrength:0.8]; filter = filterLowPass;

then I took a picture, but it crashed.

I debugged and I found the point app is crashed, it is conserveMemoryForNextFrame method of GPUImageFilter.m.

Could you please fix this problem, I love low pass filter and I should use it. :-)

Thank you for your great source!!

PS : I tested with iPhone iOS 6.1

donobono avatar Jan 29 '13 10:01 donobono

I'll look at this, but I'll warn you that the low pass filter may not work properly with still photos. It requires the results of multiple previous images, and the preview images will be of a different resolution than your final photo. This may not work, or it may produce unpredictable artifacts.

BradLarson avatar Jan 29 '13 17:01 BradLarson

I used low pass filter very well with old source(maybe 2~3 month before), but recent version has this problem. I tried to debug with my app source(not sample source), conserveMemoryForNextFrame method of GPUImageFilter makes endless loop.

donobono avatar Jan 30 '13 01:01 donobono

Hi BradLarson, I think it might be the problem with the os version comparison. I saw it uses defined(__IPHONE_6_0) to check for arc compatibility, but for ios6.1 this might not work.

tonyzonghui avatar Feb 25 '13 06:02 tonyzonghui

Hi, I am using GPUImageLowPassFilter on a video but it ends in an Infinite loop which is caused on endProcessing. Any idea what needs to be done.

Thanks.

girishvr avatar Mar 01 '13 13:03 girishvr

I have crash problems with both GPUImageLowPassFilter, GPUImageHighPass, and GPUImageMotionDetector filters. I use swappable filters for a live video feed. All other filters swap just fine, which leeds me to believe that my overall handling is as intended. In particular the code crashes when I try to remove any of these three filters from the live camera feed:

    [videoCamera removeTarget:inputFilter]; // <- Crashes when inputFilter is GPUImageLowPassFilter
    [inputFilter removeTarget:textureOutput];

The filtershowcase example does not seem to suffer from this problem as the videocamera source is reallocated every time a new filter becomes active, so filters are never removed as targets from the videocamera feed.

gessl avatar Mar 13 '13 23:03 gessl

I have things setup very similarly to @gessl and experience the same problem when removing the GPUImageLowPassFilter- an infinite loop on endProcessing.

scttnlsn avatar Mar 14 '13 15:03 scttnlsn

Actually, the GPUImageLowPassFilter has got two filters added as a target to each other.

[bufferFilter addTarget:dissolveBlendFilter atTextureLocation:1];
[dissolveBlendFilter addTarget:bufferFilter];

So, when removeTarget is called, it results into an infinite loop. We could find a hack for this solution. Let me update it and send a pull request.

girishvr avatar Mar 20 '13 18:03 girishvr

Hi, I just stumbled upon this issue as well. It only triggered when I am processing a movie file. Anyway, the fix does seem to be commenting out or removing:

[dissolveBlendFilter addTarget:bufferFilter];

Does someone want to commit that change?

jbartot avatar Nov 03 '13 20:11 jbartot