Could you show the code where you preview image ?
I understand that in fact you get raw and processed and cannot preview raw
https://developer.apple.com/documentation/avfoundation/cameras_and_media_capture/capturing_still_and_live_photos/capturing_photos_in_raw_format
You cannot change mode while session is running: it risks freezing preview. Is it what you experience ?
Capturing depth data requires that a capture session set up its internal rendering pipeline differently. If you intend to capture depth data at all, set this property to
true
before calling the
AVCaptureSession
startRunning()
method. Changing this property while the session is running requires a lengthy reconfiguration of the capture render pipeline: Live Photo captures in progress will end immediately, unfulfilled photo requests will abort, and video preview will temporarily freeze.
https://developer.apple.com/documentation/avfoundation/avcapturephotooutput/2866565-isdepthdatadeliveryenabled