曝光模式不会保持锁定状态
问题:我可以设置 AVCaptureDevice 的 ExposureMode 属性,但它不会保持锁定状态。
这是我的代码:
NSArray *devices = [AVCaptureDevice devices];
NSError *error;
for (AVCaptureDevice *device in devices) {
if (([device hasMediaType:AVMediaTypeVideo]) &&
([device position] == AVCaptureDevicePositionBack) ) {
if ([device isExposureModeSupported:AVCaptureExposureModeLocked]) {
device.exposureMode = AVCaptureExposureModeLocked;
NSLog(@"Exposure locked");
}
[device unlockForConfiguration];
}
}
我以编程方式一张一张地拍摄 4 张照片。前两张照片中的曝光保持锁定,但在后两张照片中曝光解锁。当在锁定曝光之前我点击相机视图的黑暗部分以使图片的部分曝光过度时,就会发生这种情况。看起来 iOS 决定在图片曝光过度时进行自动曝光并覆盖曝光锁定模式。
感谢您的帮助,
Problem: I can set the exposureMode property of AVCaptureDevice, but it does not stay locked.
Here is my code:
NSArray *devices = [AVCaptureDevice devices];
NSError *error;
for (AVCaptureDevice *device in devices) {
if (([device hasMediaType:AVMediaTypeVideo]) &&
([device position] == AVCaptureDevicePositionBack) ) {
if ([device isExposureModeSupported:AVCaptureExposureModeLocked]) {
device.exposureMode = AVCaptureExposureModeLocked;
NSLog(@"Exposure locked");
}
[device unlockForConfiguration];
}
}
I take 4 pictures one after another programmatically. The exposure stays locked in the first two pictures, but becomes unlocked in the last two. This happens when before locking the exposure I tap on a dark portion of the camera view so that part of the picture is over-exposed. It looks like iOS decides to do auto-exposure and override the exposure lock mode when the picture is overexposed.
thanks for the help,
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我没有对此进行测试,但走的是同样的道路。为什么不尝试保持锁定直到完成这一系列照片。一旦您释放锁定,系统就可以自由更改设置。
I did not test this, but going down this same path. Why not try holding the lock until you are done the series of photos. Once you release the lock the system is free to change the setting.
这个问题似乎在 iOS 5 中已经得到解决。
this problem seem to have been fixed in iOS 5.