iphone - iPhone 不支持 ExposureMode AVCaptureExposureModeAutoExpose

标签 iphone camera avfoundation

我正在尝试操纵触摸事件并手动调整焦点和曝光以适合用户按下的 CGPoint。 我正在获取设备对象并使用 setFocusPointOfInterestsetExposurePointOfInterest 来进行操作。看起来焦点工作得很好,但是当我尝试将曝光模式设置为 AVCaptureExposureModeAutoExpose 时,它​​崩溃了,原因是: “此设备不支持设置曝光模式 (%d)。”

一开始我以为是因为我用的是 iPhone 3GS,后来 iPhone 4 上也出现了这种情况......

有人知道出了什么问题吗?

谢谢, 盖伊。

最佳答案

我在 Apple 开发者论坛中提出了类似的问题,并得到了 Brad Ford(核心媒体工程)的回答,他是 Apple WWDC 中 Camera Capture with AV Foundation 的发言人。

这是他的 answer :

Correct. AVCaptureExposureModeAutoExpose, while defined in the header, is not currently implemented on any iOS device.

You can however implement it in your own code by setting your desired point of interest, then calling setExposureMode:AVCaptureExposureModeContinuousAutoExposure, and then listen (key-value observe) the "isAdjustingExposure" property of AVCaptureDevice to know when the exposure finishes adjusting. As soon as it does, setExposureMode to AVCaptureExposureModeLocked.

希望它能澄清并有所帮助!

关于iphone - iPhone 不支持 ExposureMode AVCaptureExposureModeAutoExpose,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4519814/

相关文章:

ios - iPhone 应用程序 - 添加另一个 View

html - 输入类型文件标签中的 capture ="user"和 capture ="camera"有什么区别?

Android ACTION_IMAGE_CAPTURE Intent

ios - iPad - 使用相机 - 图像在旋转

ios - 在 UICollectionViewCell 中滚动时 MPMoviePlayerController 变为空白

objective-c - AVAssetReader 采样率

iphone - 如何为子类化的 NSManagedObject 正确实现自定义初始化程序

iphone - 如何在 iOS 中列出声音文件?

ios - 转换为当前语法时出错

iphone - UIButton 图像不会在 "for"循环中更改