What is the role of AVCaptureDeviceType.builtInDualCamera

怎甘沉沦 提交于 2019-11-30 15:56:08

Duel-Camera options is to choose the behaviour like Camera app and let the system decide automatically choose which camera to use during capture and can combine data from both cameras to improve output. Also it does not support any RAW photo capture, OIS, HFR and Slo mo.

For more info check iOSDeviceCompatibility

From Documentation:

Dual Camera

Some iOS devices contain a dual camera—two separate back-facing cameras that can work together as a single capture device. When setting up a capture session on a device with an dual camera, you can choose to use only the wide-angle camera, only the telephoto camera, or the dual camera. Choosing the dual camera capture device provides behavior similar to the built-in Camera app—the system automatically chooses which camera to use during capture, and can combine data from both cameras to improve capture output.

The AVCaptureDevice devices and devicesWithMediaType: methods are deprecated in iOS 10 and do not provide access to the dual camera device (instead, they provide only the wide-angle camera device). To determine whether a device contains a dual camera and select it for capture, you may either:

  • Call the AVCaptureDevice defaultDeviceWithDeviceType:mediaType:position: method, passing the builtInDuoCamera device type. If this method returns non-nil, the iOS device contains a dual camera. (If this method returns nil, you can call it again, passing the builtInWideAngleCamera device type, to obtain the default back camera.)
  • Create an AVCaptureDeviceDiscoverySession object, passing the device attributes you want to use for capture, and enumerate its devices list to choose a device for your capture session.

When you use the dual camera capture device, Optical Image Stabilization (OIS), RAW Photo Capture, High Frame Rate (HFR) / Slow Motion Video, and most manual controls are not available. To use these features, specifically select either the wide or telephoto capture device. (For OIS, specifically select the wide-angle camera; the telephoto camera does not support optical image stabilization.)

builtInDualCamera is like a "simple mode", automatically switching between wide angle and telephoto seamlessly when zooming.

When capturing video, the ramp (gradually zooming) can be seamless from 1x to 16x. Whereas handling manually will be much more work and could have lag when switch devices.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!