Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created March 21, 2020 03:00
Show Gist options
  • Save christianselig/014f5383d882dd529b6f6395989e8874 to your computer and use it in GitHub Desktop.
Save christianselig/014f5383d882dd529b6f6395989e8874 to your computer and use it in GitHub Desktop.
let operationQueue = OperationQueue()
operationQueue.maxConcurrentOperationCount = 1
while (sample != nil) {
if let newSample = sample {
let cgImage = self.cgImageFromSampleBuffer(newSample)!
operationQueue.addOperation { // Problematic son of a
CGImageDestinationAddImage(destination, cgImage, frameProperties as CFDictionary)
}
}
sample = readerOutput.copyNextSampleBuffer()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment