June 2018
Intermediate to advanced
378 pages
8h 43m
English
At this stage, we have the app rendering the frames from the camera, but we are not yet receiving any frames. To do this, we will assign ourselves to receive these frames, as implemented in the previous section. The existing ViewController class already has an extension implementing the VideoCaptureDelegate protocol. What's left to do is to assign ourselves as the delegate of the VideoCapture instance and implement the details of the callback method; the following is the code for extension:
extension ViewController : VideoCaptureDelegate{ func onFrameCaptured(videoCapture: VideoCapture, pixelBuffer:CVPixelBuffer?, timestamp:CMTime){ } }