GPUImage icon indicating copy to clipboard operation
GPUImage copied to clipboard

ARC issue with pipelines

Open peterhwong opened this issue 14 years ago • 0 comments

Hi Brad, First, thanks so much for the GPUImage framework!!! I'm using a GPUImageStillCamera along with many configuration files based on your SampleConfiguration.plist file. In my UI, I have several buttons allowing a user to switch between the configuration files so they can see a new effect applied to their camera view. The code to switch is below:

    [stillCamera pauseCameraCapture];
    pipeline = [[GPUImageFilterPipeline alloc] initWithConfigurationFile:[[NSBundle mainBundle] URLForResource:presetFile withExtension:@"plist"] input:stillCamera output:(GPUImageView *)cameraView];

    [pipeline addFilter:(GPUImageFilter *)passThroughFilter atIndex:0];
    [stillCamera resumeCameraCapture];

Everything works great at this point. However I converted to ARC recently and now when I switch configuration files, the screen goes black. If I turn ARC off for this one file, it works again. The reason I went to ARC was because of some memory issues I started seeing. Before turning on ARC I noticed that if I tried to release any GPUImage framework object, bad things would happen, including black screens. But not releasing GPUImage objects would result in memory issues so I thought maybe if my project was ARC all my issues would go away. With ARC all the memory issues have gone away. It's just the black screen issue.

I noticed some people fixed the black screen issue by calling prepareForImageCapture but the pipeline code doesn't do this. Is this the problem?

Thanks a lot!

peterhwong avatar Jul 10 '12 15:07 peterhwong