BradLarson / GPUImage2

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

Exposed CameraError to allow calling function to more gracefully hand… #236

Closed davet2001 closed 6 years ago

davet2001 commented 6 years ago

I find that when running on a device without a front facing camera (e.g. the simulator), i get a program crash during the deinit when the Camera() init fails.

2 Simple changes:

1) expose the CameraError so that other classes can catch it. 2) mark the videoOutput as optional so that it won't crash if it doesn't exist while unwrapping during deinit.

Please note I'm quite new to git so not sure if I'm doing the right thing regarding pull requests etc.