我使用基于Apple AppCam应用程序示例的AVCaptureSession来克隆Apple相机应用程序。 问题是我无法在视频预览屏幕中看到焦点矩形。 我用下面的代码来设置焦点,但仍然没有显示焦点矩形。iphone相机显示焦点矩形
AVCaptureDevice *device = [[self videoInput] device];
if ([device isFocusModeSupported:focusMode] && [device focusMode] != focusMode) {
NSError *error;
printf(" setFocusMode \n");
if ([device lockForConfiguration:&error]) {
[device setFocusMode:focusMode];
[device unlockForConfiguration];
} else {
id delegate = [self delegate];
if ([delegate respondsToSelector:@selector(acquiringDeviceLockFailedWithError:)]) {
[delegate acquiringDeviceLockFailedWithError:error];
}
}
}
当我使用的UIImagePickerController,支持自动对焦,点对焦默认支持,并且可以看到焦点矩形。 有没有办法使用AVCaptureSession在视频预览图层中显示焦点矩形?
嗯,似乎没有人知道THI秒。 – ttotto 2013-04-05 18:12:15