Skip to content

Instantly share code, notes, and snippets.

@onmyway133
Created June 15, 2018 16:01
Show Gist options
  • Save onmyway133/bec44687b47942854019f9cfe974527d to your computer and use it in GitHub Desktop.
Save onmyway133/bec44687b47942854019f9cfe974527d to your computer and use it in GitHub Desktop.
func handle(buffer: CMSampleBuffer) {
guard let pixelBuffer = CMSampleBufferGetImageBuffer(buffer) else {
return
}
let ciImage = CIImage(cvPixelBuffer: pixelBuffer)
guard let image = ciImage.toUIImage() else {
return
}
makeRequest(image: image)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment