我正在使用 .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
}