at first time, there is no problem. I can get filtered image but if I back to CameraViewController
and capture again, there is no filtered image.
I checked stillImage and filter are not NIL.
I traced the code and checked that imageAvailableCallback was not callback at second time.
` public func filterWithPipeline(_ pipeline:(PictureInput, PictureOutput) -> ()) -> UIImage? {
let picture = PictureInput(image:self)
var outputImage:UIImage?
let pictureOutput = PictureOutput()
pictureOutput.onlyCaptureNextFrame = false
Hi. I'm using gpuimage2 but there is difficult problem. i was tried to solve the problem over 3month but i can't possibly understand it.
following is my code in CameraViewController i captured photo and pass the image to ImageFilterViewController.
` let pictureOutput = PictureOutput() (self.filterOperation?.filter)! --> pictureOutput
`
following is ImageFilterViewController code
` override func viewDidLoad() { super.viewDidLoad() ... let filterImage = stillImage.filterWithOperation(filter)
`
at first time, there is no problem. I can get filtered image but if I back to CameraViewController and capture again, there is no filtered image. I checked stillImage and filter are not NIL.
I traced the code and checked that imageAvailableCallback was not callback at second time.
` public func filterWithPipeline(_ pipeline:(PictureInput, PictureOutput) -> ()) -> UIImage? { let picture = PictureInput(image:self) var outputImage:UIImage? let pictureOutput = PictureOutput() pictureOutput.onlyCaptureNextFrame = false
I added following codes that execute after capturing but it was no use.
why there is no callback after first time? please help me. I did everything I can but it's impossible. thank you.