I want to reuse the filter and pipeline. I am just changing the input each time.
I have found that the following works:
pInput!.removeAllTargets()
pInput = PictureInput(image: ...next image )
pInput! --> filter
pOutput.imageAvailableCallback = {image in
DispatchQueue.main.async { .. same as above .. }
pInput!.processImage(synchronously:true)
imageAvailableCallback definitely goes to nil each time. You have to reset it (to the same thing) each time. Am I doing something wrong?
It seems you do have toremoveAllTargets from the input. This seems strange, since you're completely remaking input with pInput = PictureInput(image: ...next image ). (How would it even 'remember' what the target is?) Am I doing something wrong?
I'm filtering an image like this ..
I want to reuse the filter and pipeline. I am just changing the input each time.
I have found that the following works:
imageAvailableCallback
definitely goes to nil each time. You have to reset it (to the same thing) each time. Am I doing something wrong?It seems you do have to
removeAllTargets
from the input. This seems strange, since you're completely remaking input withpInput = PictureInput(image: ...next image )
. (How would it even 'remember' what the target is?) Am I doing something wrong?thanks !