#[repr(transparent)]pub struct AVCapturePrimaryConstituentDeviceSwitchingBehavior(pub NSInteger);AVCaptureDevice only.Expand description
These constants can be used to control when the virtual device is allowed to switch the active primary constituent device.
Indicates that the device does not support constituent device switching. This is reported for cameras that do not have more than one constituent device.
Automatically select the best camera for the current scene. In this mode there are no restrictions on when a camera switch can occur.
Restrict fallback camera selection to certain conditions (see AVCapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions). Camera switches necessary to satisfy the requested video zoom factor are still allowed without restriction.
Lock camera switching to the active primary constituent device. Note that this restricts the minAvailableVideoZoomFactor to the switch-over zoom factor of the activePrimaryConstituentDevice (as reported in AVCaptureDevice.virtualDeviceSwitchOverVideoZoomFactors).
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 such as focal length, maximum light sensitivity, and minimum focus distance. One of the constituent video devices is selected as the primary constituent device. For an AVCaptureSession, the primary constituent device produces for all outputs. For an AVCaptureMultiCamSession, the primary constituent device produces for all outputs connected to the virtual device’s native AVCaptureDeviceInputPort (where its sourceDeviceType is equal to the virtual device’s deviceType).
When the requested zoom factor can be achieved by multiple constituent cameras (see -virtualDeviceSwitchOverVideoZoomFactors), the virtual device chooses the best camera for the scene. The primary condition for this is the focal length; the camera with the longest focal length requires the least amount of digital upscaling and therefore normally provides the highest image quality. Secondary conditions are focus and exposure; 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. Such a device is called a fallback primary constituent device. For example, a telephoto camera with a minimum focus distance of 40cm is not able to deliver a sharp image when the subject in the scene is closer than 40cm. For such a scene, the virtual device will switch to the wide-angle camera which typically has a smaller minimum focus distance and is able to achieve accurate focus on the subject. In this case the wide-angle camera is the fallback primary constitute device.
See also Apple’s documentation
Tuple Fields§
§0: NSIntegerImplementations§
Source§impl AVCapturePrimaryConstituentDeviceSwitchingBehavior
impl AVCapturePrimaryConstituentDeviceSwitchingBehavior
pub const Unsupported: Self
pub const Auto: Self
pub const Restricted: Self
pub const Locked: Self
Trait Implementations§
Source§impl Clone for AVCapturePrimaryConstituentDeviceSwitchingBehavior
impl Clone for AVCapturePrimaryConstituentDeviceSwitchingBehavior
Source§fn clone(&self) -> AVCapturePrimaryConstituentDeviceSwitchingBehavior
fn clone(&self) -> AVCapturePrimaryConstituentDeviceSwitchingBehavior
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Ord for AVCapturePrimaryConstituentDeviceSwitchingBehavior
impl Ord for AVCapturePrimaryConstituentDeviceSwitchingBehavior
Source§fn cmp(
&self,
other: &AVCapturePrimaryConstituentDeviceSwitchingBehavior,
) -> Ordering
fn cmp( &self, other: &AVCapturePrimaryConstituentDeviceSwitchingBehavior, ) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AVCapturePrimaryConstituentDeviceSwitchingBehavior
impl PartialEq for AVCapturePrimaryConstituentDeviceSwitchingBehavior
Source§fn eq(&self, other: &AVCapturePrimaryConstituentDeviceSwitchingBehavior) -> bool
fn eq(&self, other: &AVCapturePrimaryConstituentDeviceSwitchingBehavior) -> bool
self and other values to be equal, and is used by ==.