Synchronizing sensor buffer rotation with articulated Duo display planes

Physical camera sensors deliver pixel buffers in native landscape orientation, requiring coordinate transformations when rendering into portrait or split viewports.

What is the recommended pipeline design using AVCaptureDeviceDirectionCoordinator and AVCaptureDevice.RotationCoordinator to guarantee that live preview layers and photo captures remain upright across varying fold angles without manual Core Graphics or Core Image buffer rotation passes? Are there specific considerations when the view hierarchy bridges across the physical hinge division?

Use the AVCaptureDeviceDirectionCoordinator and initialize it with all your interested deviceTypes. Use it to make informed decisions on how to select the streaming camera.

Create one AVCaptureDevice.RotationCoordinator for each AVCaptureDevice being used in your app. Observe the Rotation Coordinator's properties to keep your preview and photos always upright.

Update your AVCaptureConnection's videoRotationAngle with the Rotation Coordinator's latest value. With this hooked up, you shouldn't have to do any manual rotation passes in your application to keep preview and photos upright.

Synchronizing sensor buffer rotation with articulated Duo display planes
 
 
Q