在 macOS 上,是否可以将虚拟相机(例如OBS)视为 CaptureDevice?例如,我看到 Google Chrome 或 Zoom 可以使用此相机,但使用 AVCaptureDevice.DiscoverySession 我看不到它。
我做错了吗?
var deviceTypes: [AVCaptureDevice.DeviceType] = [.builtInMicrophone, .builtInWideAngleCamera]
#if os(OSX)
deviceTypes.append(.externalUnknown)
#else
deviceTypes.append(contentsOf: [.builtInDualCamera,
.builtInDualWideCamera,
.builtInTelephotoCamera,
.builtInTripleCamera,
.builtInTrueDepthCamera,
.builtInUltraWideCamera])
#endif
let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: deviceTypes,
mediaType: nil, position: .unspecified)
result = discoverySession.devices.map { device in
device.localizedName
}