BradLarson / GPUImage

An open source iOS framework for GPU-based image and video processing
http://www.sunsetlakesoftware.com/2012/02/12/introducing-gpuimage-framework
BSD 3-Clause "New" or "Revised" License
20.22k stars 4.62k forks source link

Fill GPUImageView with solid color #2523

Open SeniorFranko opened 6 years ago

SeniorFranko commented 6 years ago

Hi I have simple camera chain : GPUImageVideoCamera --> Filters ---> GPUImageView After finishing recording, I'm stopping camera (stopCameraCapture) and GPUImageView shows last captured frame. After user interaction I want to start camera again using same GPUImageView, but there is little delay when old frame is still shown. Is there any way to simply fill GPUImageView with solid color, so after retake first there will be black screen, and then later new camera stream?

I was able to do it with black UIImage but maybe there is better solution?

UIImage inputImage = [UIImage imageNamed:@"blacksquare.png"]; GPUImagePicture temporaryPicture = [[GPUImagePicture alloc] initWithImage:inputImage smoothlyScaleOutput:YES]; [temporaryPicture addTarget:cameraView]; [temporaryPicture processImage]; [temporaryPicture removeAllTargets];