我正在使用.frameProcessor处理PHLivePhoto来修改每一帧。这些帧似乎是按顺序处理的,这样速度很慢。我能否让PHLivePhotoEditingContext.frameProcessor利用多个核心?
func processLivePhoto(input: PHContentEditingInput) {
guard let context = PHLivePhotoEditingContext(livePhotoEditingInput: input)
else { fatalError("not a Live Photo editing input") }
context.frameProcessor = { frame, _ in
let renderedFrame = expensiveOperation(using: frame.image)
return renderedFrame
}
// ...logic for saving
}