ios – AVFoundation:isExposureModeSupported为AVCaptureExpos
我正在使用AVFoundation构建自定义相机.除了setExposurePointOfInterest之外,一切都很好用.
我在iPhone 5上测试,AVCaptureDevice告诉我BackCamera不支持AVCaptureExposureModeAutoExpose. 然后我如何实施水龙头来调整曝光? 这是我的代码: - (void)didTapCameraPreview:(UITapGestureRecognizer *)recognizer { CGPoint point = [recognizer locationInView:self.view]; CGRect screenRect = [self.view bounds]; CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; double focus_x = point.x/screenWidth; double focus_y = point.y/screenHeight; CGPoint touchPoint = CGPointMake(focus_x,focus_y); AVCaptureDevice *device = (self.captureSession.inputs[0] == self.backCamera) ? self.backCamera.device : self.frontCamera.device; if (device.isFocusPointOfInterestSupported) { NSError *error; if ([device lockForConfiguration:&error]) { [device setFocusPointOfInterest:touchPoint]; [device setExposurePointOfInterest:touchPoint]; [device setFocusMode:AVCaptureFocusModeAutoFocus]; if ([device isExposureModeSupported:AVCaptureExposureModeAutoExpose]){ [device setExposureMode:AVCaptureExposureModeAutoExpose]; } [device unlockForConfiguration]; } } } 解决方法
我在Apple开发者论坛上质疑了类似的问题,并得到了Brad Ford(核心媒体工程)的回答,他是苹果公司WWDC中AV Foundation的Camera Capture发言人.
这是他的answer:
希望它澄清并帮助! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- 我想要一个AJAX文件上传器,如Gmail文件上传和PHP中的进度条
- checking for XML::Parser... configure: error: XML::Pars
- 年末压轴 - 第六届 Oracle 技术嘉年华全面阐释云时代
- JLINK烧写BIN文件到nand、norflash、SDRAM
- 【cocos2dx 3.x】锚点不是坐标原点
- Swift - 多行文本输入框(UITextView)的用法
- c# – 如何使用XmlAttributeOverrides以编程方式生成序列化
- 是否可以根据C#中键/值对的键具有值类型?
- vue+element的表格实现批量删除功能示例代码
- ID SWFUpload_0 is already in use. The Flash Object coul