【发布时间】:2015-01-05 02:39:27
【问题描述】:
从 iphone 6 介绍开始就有两种类型的焦点检测, 1.对比度检测 2.相位检测
从 iphone 6.6+ 开始,它使用相位检测。
我正在尝试获取当前的焦点系统
self.format = [[AVCaptureDeviceFormat alloc] init];
[self.currentDevice setActiveFormat:self.format];
AVCaptureAutoFocusSystem currentSystem = [self.format autoFocusSystem];
if (currentSystem == AVCaptureAutoFocusSystemPhaseDetection)
{
[self.currentDevice addObserver:self forKeyPath:@"lensPosition" options:NSKeyValueObservingOptionNew context:nil];
}
else if(currentSystem == AVCaptureAutoFocusSystemContrastDetection)
{
[self.currentDevice addObserver:self forKeyPath:@"adjustingFocus" options:NSKeyValueObservingOptionNew context:nil];
}
else{
NSLog(@"No observers added");
}
但现在它在以下行中崩溃了
AVCaptureAutoFocusSystem currentSystem = [self.format autoFocusSystem];
我无法找到崩溃的正确描述。
【问题讨论】:
标签: ios ios8 avfoundation iphone-6