During the SceneKit: What's New presentation at WWCD2017 (44:19) it was stated that we can now use AVCaptureDevice
as background content for SCNScene
.
Snippet from the presentation:
let captureDevice: AVCaptureDevice = ...
scene.background.contents = captureDevice
However the following code
let captureDevice = AVCaptureDevice.default(.builtInWideAngleCamera, for: .video, position: .back)!
scene.background.contents = captureDevice
produces an error:
[SceneKit] Error: Cannot get pixel buffer (CVPixelBufferRef)
I also tried to create and start AVCaptureSession
and then use the device, but it gives the same result.
What might be an issue here?