AVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior
Constants that control when to allow a virtual device to switch its active primary constituent device.
Declaration
enum PrimaryConstituentDeviceSwitchingBehaviorOverview
Virtual devices with multiple constituent video devices (such as the Dual Camera, Dual Wide Camera, or Triple Camera) consist of cameras that each have different properties like focal length, maximum light sensitivity, and minimum focus distance. The system selects one of the constituent video devices as the primary device.
When multiple constituent cameras can achieve a requested zoom factor, the virtual device chooses the best camera for the scene. The system makes this decision primarily using a camera’s focal length, because the camera with the longest focal length requires the least amount of digital upscaling to provide the highest image quality. Secondary conditions are focus and exposure. For example, when the scene requires focus or exposure to go beyond the limits of the active primary constituent device, a camera with a shorter focal length may be able to deliver a better quality image. The system considers such a device a fallback primary constituent device. For example, a telephoto camera with a minimum focus distance of 40 cm isn’t able to deliver a sharp image when the subject in the scene is closer than 40 cm. For such a scene, the virtual device switches to the wide-angle camera, which typically has a smaller minimum focus distance and is able to accurately focus the subject. In this case the wide-angle camera is the fallback primary constitute device.
Topics
Switching behaviors
AVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior.unsupportedAVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior.autoAVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior.restrictedAVCaptureDevice.PrimaryConstituentDeviceSwitchingBehavior.locked
Initializers
See Also
Restricting camera switching
setPrimaryConstituentDeviceSwitchingBehavior(_:restrictedSwitchingBehaviorConditions:)primaryConstituentDeviceSwitchingBehaviorprimaryConstituentDeviceRestrictedSwitchingBehaviorConditionsactivePrimaryConstituentDeviceSwitchingBehavioractivePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionsactivePrimaryConstituentAVCaptureDevice.PrimaryConstituentDeviceRestrictedSwitchingBehaviorConditionssupportedFallbackPrimaryConstituentDevicesfallbackPrimaryConstituentDevices