iPhone 不支持 ExposureMode AVCaptureExposureModeAutoExpose [英] ExposureMode AVCaptureExposureModeAutoExpose is not supported in iPhone
问题描述
我正在尝试操纵触摸事件并手动调整焦点和曝光以适应用户按下的 CGPoint.我正在使用设备对象并使用 setFocusPointOfInterest 和 setExposurePointOfInterest 来进行操作.看起来焦点工作得很好,但是当我尝试将曝光模式设置为 AVCaptureExposureModeAutoExpose 时,它会崩溃,原因是:此设备不支持设置曝光模式 (%d)."
I'm trying to manipulate the touch event and manually adjust the focus and exposure to fit the CGPoint a user has pressed. I'm taking the device object and uses setFocusPointOfInterest and setExposurePointOfInterest in order to do the manipulation. It seems like the focus is working pretty good but when I try to set the Exposure mode to AVCaptureExposureModeAutoExpose it crashes with the cause : "Setting exposureMode (%d) is not supported by this device."
一开始我以为是因为我用的是 iPhone 3GS,但后来也发生在 iPhone 4 上……
At the beginning I thought it's because I used iPhone 3GS but then it happend on iPhone 4 too ...
有谁知道怎么回事?
谢谢,家伙.
推荐答案
我在苹果开发者论坛上提问了类似的问题,得到了苹果WWDC Camera Capture with AV Foundation 演讲者Brad Ford (Core Media Engineering)的回答.
I was questioning the similar question in Apple Developer forum and got answered by Brad Ford (Core Media Engineering), the speaker of Camera Capture with AV Foundation in Apple's WWDC.
这是他的答案:
正确.AVCaptureExposureModeAutoExpose 虽然在标头中定义,但目前未在任何 iOS 设备上实现.
但是,您可以通过设置所需的代码在自己的代码中实现它兴趣点,然后调用setExposureMode:AVCaptureExposureModeContinuousAutoExposure,然后听(键值观察)的isAdjustingExposure"属性AVCaptureDevice 知道曝光何时完成调整.尽快正如它所做的那样,将ExposureMode 设置为 AVCaptureExposureModeLocked.
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 不支持 ExposureMode AVCaptureExposureModeAutoExpose的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!