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.73k stars 342 forks source link

"Warning: tried to add target beyond target\'s input capacity" #22

Open YuStephen opened 5 years ago

YuStephen commented 5 years ago

Hey BradLarson, i use UICollectionView, and make config in 'didSelectItemAt' func like code blow

let color = colors[indexPath.item]  
filter.red = Float(color.red!)
filter.green = Float(color.green!)
filter.blue = Float(color.blue!)
picture --> filter --> renderView
picture.processImage()

then it'll show "Warning: tried to add target beyond target\'s input capacity" how to solve it?

w-i-n-s commented 5 years ago

EDIT: For avoid freezing RenderView and this creepy message - please check all places where you set the filter to any ImageSource. In my case I tried to set filter twice.

Also, some filters like FalseColor does not work as required - and you can not remove all targets and sources and reuse it -> create new one FalseColor() every time

+1

I have the same issue when try to change filters on the app and before RenderView will freeze - I receive this warning

ps: "if you want to solve it then say to everybody you cannot and share it" (ç)

YuStephen commented 5 years ago

@w-i-n-s you mean reset the filter? create a new filter again?

w-i-n-s commented 5 years ago

@YuStephen

you mean reset the filter? create a new filter again? I meant the creation of the new one

bkunarola commented 5 years ago

Is there any update in this?

artsector commented 4 years ago

You need to clear SourceContainer in destination ImageConsumer (e.g. in renderView or filter), before attach some input a second time

camera --> filter --> renderView
renderView.sources.removeAtIndex(0)
camera --> renderView