支持的depthdataformats列在Apple文档中
https://developer.apple.com/documentation/avfoundation/avcapturedevice.format/2865753-supporteddepthdataformats
但从代码中看不出来:

let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: AVMediaType.video, position: .back)
print("depth data formats: \(device.supportedDepthDataFormats)")

错误消息说:
Value of type 'AVCaptureDevice' has no member 'supporteddepthdataformats'

我使用的是Xcode版本9.2beta(9C34b),因为当前的官方Xcode 9.1不适用于iOS11.2。

最佳答案

let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back )
print("depth data formats: \(device?.activeFormat.supportedDepthDataFormats)")

希望这有帮助

10-04 17:28