Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No visible @interface for 'GPUImageOutput<GPUImageInput>' declares the selector 'imageFromCurrentlyProcessedOutputWithOrientation:'

I'm in charge of an old project someone else created in my company some time ago, and now I have to make some changes using XCode 5.1

The thing is, even it compiled ok one year ago (spring of 2013) it doesn't compile right now. The project contains the GPUImage library subproject. This is the error XCode yields:

No visible @interface for 'GPUImageOutput<GPUImageInput>' declares the selector 'imageFromCurrentlyProcessedOutputWithOrientation:'

when I try to compile these 2 lines:

if( self.grayScaleOutput )
{
    photo = [grayscaleFilter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp];
}
else
{
    photo = [blendFilter imageFromCurrentlyProcessedOutputWithOrientation:UIImageOrientationUp];
}

I even let Xcode 5.1 change some settings of my project (it recommended me to do it), but no luck. Any hint? Any setting I need to activate? Some ARC misery it might still remain in my old lines of code?

NOTE: I've replaced the 1 year old GPUImage library I was using, with the one I've just freshly downloaded from GitHUB. And no luck either.

like image 893
Isaac Avatar asked Dec 02 '22 16:12

Isaac


1 Answers

Right, I changed that interface this last week, for reasons I explain here.

In short, GPUImageFilters now use cached framebuffers. This means that image capture from them has changed slightly. To make people aware of this, I renamed the methods involved, although perhaps I could have found another way to warn you about this. The new equivalent is -imageFromCurrentFramebufferWithOrientation:, but before you use that you need to call -useNextFrameForImageCapture on the filter to indicate that you will be extracting an image the next time this filter runs. This needs to either be called before you use -processImage on a GPUImagePicture source or right before you use -imageFromCurrentFramebufferWithOrientation: on a filter pulling from a video source.

This is required, because the framework needs to know to hold onto the cached framebuffer for a little longer than normal, instead of immediately returning it to the cache to conserve memory. This is done for you automatically during photo capture or when using a convenience method like -imageByFilteringImage:, but needs to be manually triggered when extracting the image like in your code.

like image 63
Brad Larson Avatar answered Dec 07 '22 02:12

Brad Larson