我试图使用AVFoundation实现相机应用程序。我想用AVCaptureExposureModeAutoFocus设置exposurePointOfInterest在一个点,然后由苹果的文档解释锁定曝光:iPhone 5:iOS 7中不支持AVCaptureExposureModeAutoFocus
AVCaptureExposureModeAutoExpose:设备自动调整 曝光一次,然后改变曝光模式 AVCaptureExposureModeLocked。
这是我使用的功能:
-(void)autoExposeAtPoint:(CGPoint)point
{
AVCaptureDevice *device = [videoInput device];
if([device isExposurePointOfInterestSupported] && [device isExposureModeSupported:AVCaptureExposureModeAutoExpose]){
if([device lockForConfiguration:NULL]){
[device setExposurePointOfInterest:point];
[device setExposureMode:AVCaptureExposureModeAutoExpose];
[device unlockForConfiguration];
NSLog(@"Exposure point of intereset has been set to (%f,%f)",point.x, point.y);
}
}
}
然而,自动曝光在所需点只是从来没有发生过。在我使用下面的NSLog进行调试时,原来不支持AVCaputreExposureModeAutoExpose
。而如果我使用AVCaptureExposureModeContinuousAutoExpose
,它将完美运行。
我不明白这一点;这是真的,这个AVCaputreExposureModeAutoExpose
不支持iPhone 5的背部摄像头运行iOS7?任何人有任何线索?谢谢!
调试代码:
相关键实际上是“调整曝光”。 – nrj