AVFoundation自动曝光
获取当前设备的视频输入,并设置自动曝光模式:
let captureDevice = AVCaptureDevice.default(for: .video)
do {
try captureDevice?.lockForConfiguration()
if (captureDevice?.isExposureModeSupported(.continuousAutoExposure))! {
captureDevice?.exposureMode = .continuousAutoExposure
}
captureDevice?.unlockForConfiguration()
} catch {
print("Error: \(error)")
}
上一篇:AVFoundation/AudioKit播放低频声音会产生噼啪声
下一篇:AVFoundation错误域=AVFoundationErrorDomainCode=-11819,“无法完成操作”NSLocalizedRecoverySuggestion=稍后再试。