【问题标题】:Value of type 'AVCaptureDevice' has no member 'supporteddepthdataformats''AVCaptureDevice' 类型的值没有成员 'supporteddepthdataformats'
【发布时间】:2017-12-06 12:33:48
【问题描述】:

支持的深度数据格式在 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.2 beta (9C34b),因为当前的官方 Xcode 9.1 不适用于 iOS 11.2。

【问题讨论】:

  • 那是AVCaptureDevice.Format的成员
  • 哈,对。谢谢。

标签: ios swift xcode avfoundation


【解决方案1】:
let device = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back )
print("depth data formats: \(device?.activeFormat.supportedDepthDataFormats)")

希望对你有帮助

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-07
    • 2016-03-11
    • 1970-01-01
    • 1970-01-01
    • 2021-06-17
    • 2018-01-15
    相关资源
    最近更新 更多