我正在开发相机应用程序。我将 AVCapturePhotoOutput 用于 ios 10.x 设备,将 AVCaptureStillImageOutput 用于 10.x 以下设备。
我在拍摄照片时使用以下拍摄设置
let settings = AVCapturePhotoSettings()
let previewPixelType = settings.availablePreviewPhotoPixelFormatTypes.first!
let previewFormat = [kCVPixelBufferPixelFormatTypeKey as String: previewPixelType,
kCVPixelBufferWidthKey as String: 1080,
kCVPixelBufferHeightKey as String: 1080,
]
settings.previewPhotoFormat = previewFormat
settings.isHighResolutionPhotoEnabled = true
settings.flashMode = .on
settings.isAutoStillImageStabilizationEnabled = true
self.captureOutputPhoto?.capturePhoto(with: settings, delegate: self)
当我尝试使用上述设置拍摄照片时
captureOutput:didFinishProcessingPhotoSampleBuffer:previewPhotoSampleBuffer:resolvedSettings:bracketSettings:error
上面的委托第一次抛出错误。我是 AVCapturePhotoSettings 的初学者。每次使用闪光灯模式成功拍摄照片后都会出现问题。