Hi AVFoundation team,
I'm seeing a uniform 90° offset in AVCaptureDevice.RotationCoordinator's
reported angles between iPhone 17 Pro and iPhone 14 Pro using the front-facing
.builtInWideAngleCamera (Center Stage on 17 Pro), and I'd like to confirm
whether this is by design and what the recommended consumption pattern is when
the rendering surface is an AVSampleBufferDisplayLayer rather than an
AVCaptureVideoPreviewLayer.
Here is the github repo of sample project.
Setup
- Devices: iPhone 14 Pro (iOS 26.5) and iPhone 17 Pro (iOS 26.4.2)
- Camera: front, AVCaptureDeviceTypeBuiltInWideAngleCamera
- Active format: 1920×1080
- Three RotationCoordinator instances are created on the same AVCaptureDevice,
varying only the previewLayer: argument: - previewLayer: nil - previewLayer: AVSampleBufferDisplayLayer (the surface receiving frames from AVCaptureVideoDataOutput) - previewLayer: AVCaptureVideoPreviewLayer (with .session = captureSession, not displayed)
Each instance is KVO-observed for videoRotationAngleForHorizonLevelPreview and videoRotationAngleForHorizonLevelCapture.
Observed angles
Device / Orientation: 14 Pro · Portrait (interface=1) RC[nil] prev / cap: 0° / 90° RC[AVSampleBufferLayer] prev / cap: 90° / 90° RC[AVCaptureVideoPreviewLayer] prev / cap: 0° / 90° ──────────────────────────────────────── Device / Orientation: 14 Pro · LandscapeRight (interface=3) RC[nil] prev / cap: 0° / 180° RC[AVSampleBufferLayer] prev / cap: 180° / 180° RC[AVCaptureVideoPreviewLayer] prev / cap: 0° / 180° ──────────────────────────────────────── Device / Orientation: 17 Pro · Portrait (interface=1) RC[nil] prev / cap: 0° / 0° RC[AVSampleBufferLayer] prev / cap: 0° / 0° RC[AVCaptureVideoPreviewLayer] prev / cap: 0° / 0° ──────────────────────────────────────── Device / Orientation: 17 Pro · LandscapeRight (interface=3) RC[nil] prev / cap: 0° / 90° RC[AVSampleBufferLayer] prev / cap: 90° / 90° RC[AVCaptureVideoPreviewLayer] prev / cap: 0° / 90°
The −90° offset on 17 Pro is uniform: it appears in every RC variant, in both the preview-angle and the capture-angle properties, at every orientation tested. It is not specific to the previewLayer: argument.