BradLarson / GPUImage3

GPUImage 3 is a BSD-licensed Swift framework for GPU-accelerated video and image processing using Metal.
BSD 3-Clause "New" or "Revised" License
2.68k stars 331 forks source link

processImage(synchronously: false) doesn't callback with image #82

Open shizam opened 4 years ago

shizam commented 4 years ago

Using the sample code from GPUImage2 for processImage() works if you provide synchronously: true but if its synchronously: false it will never call the callback:

let toonFilter = SmoothToonFilter()
let testImage = UIImage(named:"WID-small.jpg")!
let pictureInput = PictureInput(image:testImage)
let pictureOutput = PictureOutput()
pictureOutput.imageAvailableCallback = {image in
    // Do something with image
}
pictureInput --> toonFilter --> pictureOutput
pictureInput.processImage(synchronously: false) // <--- If set to `true` imageAvailableCallback is never called