Class AVCaptureDevice

All Implemented Interfaces:
NSObjectProtocol, ObjCProtocol

public class AVCaptureDevice
extends NSObject
  • Constructor Details

    • AVCaptureDevice

      protected AVCaptureDevice()
    • AVCaptureDevice

      protected AVCaptureDevice​(NSObject.Handle h, long handle)
    • AVCaptureDevice

      protected AVCaptureDevice​(NSObject.SkipInit skipInit)
  • Method Details

    • getUniqueID

      public String getUniqueID()
    • getModelID

      public String getModelID()
    • getLocalizedName

      public String getLocalizedName()
    • getManufacturer

      public String getManufacturer()
      Since:
      Available in iOS 14.0 and later.
    • isConnected

      public boolean isConnected()
    • isSuspended

      public boolean isSuspended()
      Since:
      Available in iOS 14.0 and later.
    • getFormats

      public NSArray<AVCaptureDeviceFormat> getFormats()
    • getActiveFormat

      public AVCaptureDeviceFormat getActiveFormat()
    • setActiveFormat

      public void setActiveFormat​(AVCaptureDeviceFormat v)
    • getActiveVideoMinFrameDuration

      public CMTime getActiveVideoMinFrameDuration()
    • setActiveVideoMinFrameDuration

      public void setActiveVideoMinFrameDuration​(CMTime v)
    • getActiveVideoMaxFrameDuration

      public CMTime getActiveVideoMaxFrameDuration()
    • setActiveVideoMaxFrameDuration

      public void setActiveVideoMaxFrameDuration​(CMTime v)
    • getPosition

      public AVCaptureDevicePosition getPosition()
    • getDeviceType

      public String getDeviceType()
      Since:
      Available in iOS 10.0 and later.
    • getSystemPressureState

      public AVCaptureSystemPressureState getSystemPressureState()
      Since:
      Available in iOS 11.1 and later.
    • isVirtualDevice

      public boolean isVirtualDevice()
      Since:
      Available in iOS 13.0 and later.
    • getConstituentDevices

      public NSArray<AVCaptureDevice> getConstituentDevices()
      Since:
      Available in iOS 13.0 and later.
    • getVirtualDeviceSwitchOverVideoZoomFactors

      public NSArray<NSNumber> getVirtualDeviceSwitchOverVideoZoomFactors()
      Since:
      Available in iOS 13.0 and later.
    • getPrimaryConstituentDeviceSwitchingBehavior

      public AVCapturePrimaryConstituentDeviceSwitchingBehavior getPrimaryConstituentDeviceSwitchingBehavior()
      Since:
      Available in iOS 15.0 and later.
    • getPrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions

      public AVCapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions getPrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions()
      Since:
      Available in iOS 15.0 and later.
    • getActivePrimaryConstituentDeviceSwitchingBehavior

      public AVCapturePrimaryConstituentDeviceSwitchingBehavior getActivePrimaryConstituentDeviceSwitchingBehavior()
      Since:
      Available in iOS 15.0 and later.
    • getActivePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions

      public AVCapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions getActivePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions()
      Since:
      Available in iOS 15.0 and later.
    • getActivePrimaryConstituentDevice

      public AVCaptureDevice getActivePrimaryConstituentDevice()
      Since:
      Available in iOS 15.0 and later.
    • getSupportedFallbackPrimaryConstituentDevices

      public NSArray<AVCaptureDevice> getSupportedFallbackPrimaryConstituentDevices()
      Since:
      Available in iOS 15.0 and later.
    • getFallbackPrimaryConstituentDevices

      public NSArray<AVCaptureDevice> getFallbackPrimaryConstituentDevices()
      Since:
      Available in iOS 15.0 and later.
    • setFallbackPrimaryConstituentDevices

      public void setFallbackPrimaryConstituentDevices​(NSArray<AVCaptureDevice> v)
      Since:
      Available in iOS 15.0 and later.
    • hasFlash

      public boolean hasFlash()
    • isFlashAvailable

      public boolean isFlashAvailable()
    • isFlashActive

      @Deprecated public boolean isFlashActive()
      Deprecated.
      Deprecated in iOS 10.0. Use AVCapturePhotoOutput's -isFlashScene instead.
    • getFlashMode

      @Deprecated public AVCaptureFlashMode getFlashMode()
      Deprecated.
      Deprecated in iOS 10.0. Use AVCapturePhotoSettings.flashMode instead.
    • setFlashMode

      @Deprecated public void setFlashMode​(AVCaptureFlashMode v)
      Deprecated.
      Deprecated in iOS 10.0. Use AVCapturePhotoSettings.flashMode instead.
    • hasTorch

      public boolean hasTorch()
    • isTorchAvailable

      public boolean isTorchAvailable()
    • isTorchActive

      public boolean isTorchActive()
    • getTorchLevel

      public float getTorchLevel()
    • getTorchMode

      public AVCaptureTorchMode getTorchMode()
    • setTorchMode

      public void setTorchMode​(AVCaptureTorchMode v)
    • isLockingFocusWithCustomLensPositionSupported

      public boolean isLockingFocusWithCustomLensPositionSupported()
      Since:
      Available in iOS 10.0 and later.
    • getFocusMode

      public AVCaptureFocusMode getFocusMode()
    • setFocusMode

      public void setFocusMode​(AVCaptureFocusMode v)
    • isFocusPointOfInterestSupported

      public boolean isFocusPointOfInterestSupported()
    • getFocusPointOfInterest

      public CGPoint getFocusPointOfInterest()
    • setFocusPointOfInterest

      public void setFocusPointOfInterest​(CGPoint v)
    • isAdjustingFocus

      public boolean isAdjustingFocus()
    • isAutoFocusRangeRestrictionSupported

      public boolean isAutoFocusRangeRestrictionSupported()
    • getAutoFocusRangeRestriction

      public AVCaptureAutoFocusRangeRestriction getAutoFocusRangeRestriction()
    • setAutoFocusRangeRestriction

      public void setAutoFocusRangeRestriction​(AVCaptureAutoFocusRangeRestriction v)
    • isSmoothAutoFocusSupported

      public boolean isSmoothAutoFocusSupported()
    • isSmoothAutoFocusEnabled

      public boolean isSmoothAutoFocusEnabled()
    • setSmoothAutoFocusEnabled

      public void setSmoothAutoFocusEnabled​(boolean v)
    • automaticallyAdjustsFaceDrivenAutoFocusEnabled

      public boolean automaticallyAdjustsFaceDrivenAutoFocusEnabled()
      Since:
      Available in iOS 15.4 and later.
    • setAutomaticallyAdjustsFaceDrivenAutoFocusEnabled

      public void setAutomaticallyAdjustsFaceDrivenAutoFocusEnabled​(boolean v)
      Since:
      Available in iOS 15.4 and later.
    • isFaceDrivenAutoFocusEnabled

      public boolean isFaceDrivenAutoFocusEnabled()
      Since:
      Available in iOS 15.4 and later.
    • setFaceDrivenAutoFocusEnabled

      public void setFaceDrivenAutoFocusEnabled​(boolean v)
      Since:
      Available in iOS 15.4 and later.
    • getLensPosition

      public float getLensPosition()
    • getMinimumFocusDistance

      public long getMinimumFocusDistance()
      Since:
      Available in iOS 15.0 and later.
    • getExposureMode

      public AVCaptureExposureMode getExposureMode()
    • setExposureMode

      public void setExposureMode​(AVCaptureExposureMode v)
    • isExposurePointOfInterestSupported

      public boolean isExposurePointOfInterestSupported()
    • getExposurePointOfInterest

      public CGPoint getExposurePointOfInterest()
    • setExposurePointOfInterest

      public void setExposurePointOfInterest​(CGPoint v)
    • automaticallyAdjustsFaceDrivenAutoExposureEnabled

      public boolean automaticallyAdjustsFaceDrivenAutoExposureEnabled()
      Since:
      Available in iOS 15.4 and later.
    • setAutomaticallyAdjustsFaceDrivenAutoExposureEnabled

      public void setAutomaticallyAdjustsFaceDrivenAutoExposureEnabled​(boolean v)
      Since:
      Available in iOS 15.4 and later.
    • isFaceDrivenAutoExposureEnabled

      public boolean isFaceDrivenAutoExposureEnabled()
      Since:
      Available in iOS 15.4 and later.
    • setFaceDrivenAutoExposureEnabled

      public void setFaceDrivenAutoExposureEnabled​(boolean v)
      Since:
      Available in iOS 15.4 and later.
    • getActiveMaxExposureDuration

      public CMTime getActiveMaxExposureDuration()
      Since:
      Available in iOS 12.0 and later.
    • setActiveMaxExposureDuration

      public void setActiveMaxExposureDuration​(CMTime v)
      Since:
      Available in iOS 12.0 and later.
    • isAdjustingExposure

      public boolean isAdjustingExposure()
    • getLensAperture

      public float getLensAperture()
    • getExposureDuration

      public CMTime getExposureDuration()
    • getISO

      public float getISO()
    • getExposureTargetOffset

      public float getExposureTargetOffset()
    • getExposureTargetBias

      public float getExposureTargetBias()
    • getMinExposureTargetBias

      public float getMinExposureTargetBias()
    • getMaxExposureTargetBias

      public float getMaxExposureTargetBias()
    • isGlobalToneMappingEnabled

      public boolean isGlobalToneMappingEnabled()
      Since:
      Available in iOS 13.0 and later.
    • setGlobalToneMappingEnabled

      public void setGlobalToneMappingEnabled​(boolean v)
      Since:
      Available in iOS 13.0 and later.
    • isLockingWhiteBalanceWithCustomDeviceGainsSupported

      public boolean isLockingWhiteBalanceWithCustomDeviceGainsSupported()
      Since:
      Available in iOS 10.0 and later.
    • getWhiteBalanceMode

      public AVCaptureWhiteBalanceMode getWhiteBalanceMode()
    • setWhiteBalanceMode

      public void setWhiteBalanceMode​(AVCaptureWhiteBalanceMode v)
    • isAdjustingWhiteBalance

      public boolean isAdjustingWhiteBalance()
    • getDeviceWhiteBalanceGains

      public AVCaptureWhiteBalanceGains getDeviceWhiteBalanceGains()
    • getGrayWorldDeviceWhiteBalanceGains

      public AVCaptureWhiteBalanceGains getGrayWorldDeviceWhiteBalanceGains()
    • getMaxWhiteBalanceGain

      public float getMaxWhiteBalanceGain()
    • isSubjectAreaChangeMonitoringEnabled

      public boolean isSubjectAreaChangeMonitoringEnabled()
    • setSubjectAreaChangeMonitoringEnabled

      public void setSubjectAreaChangeMonitoringEnabled​(boolean v)
    • isLowLightBoostSupported

      public boolean isLowLightBoostSupported()
    • isLowLightBoostEnabled

      public boolean isLowLightBoostEnabled()
    • automaticallyEnablesLowLightBoostWhenAvailable

      public boolean automaticallyEnablesLowLightBoostWhenAvailable()
    • setAutomaticallyEnablesLowLightBoostWhenAvailable

      public void setAutomaticallyEnablesLowLightBoostWhenAvailable​(boolean v)
    • getVideoZoomFactor

      public double getVideoZoomFactor()
    • setVideoZoomFactor

      public void setVideoZoomFactor​(double v)
    • isRampingVideoZoom

      public boolean isRampingVideoZoom()
    • getDualCameraSwitchOverVideoZoomFactor

      @Deprecated public double getDualCameraSwitchOverVideoZoomFactor()
      Deprecated.
      Deprecated in iOS 13.0. Use virtualDeviceSwitchOverVideoZoomFactors
      Since:
      Available in iOS 11.0 and later.
    • automaticallyAdjustsVideoHDREnabled

      public boolean automaticallyAdjustsVideoHDREnabled()
    • setAutomaticallyAdjustsVideoHDREnabled

      public void setAutomaticallyAdjustsVideoHDREnabled​(boolean v)
    • isVideoHDREnabled

      public boolean isVideoHDREnabled()
    • setVideoHDREnabled

      public void setVideoHDREnabled​(boolean v)
    • getActiveColorSpace

      public AVCaptureColorSpace getActiveColorSpace()
      Since:
      Available in iOS 10.0 and later.
    • setActiveColorSpace

      public void setActiveColorSpace​(AVCaptureColorSpace v)
      Since:
      Available in iOS 10.0 and later.
    • getActiveDepthDataFormat

      public AVCaptureDeviceFormat getActiveDepthDataFormat()
      Since:
      Available in iOS 11.0 and later.
    • setActiveDepthDataFormat

      public void setActiveDepthDataFormat​(AVCaptureDeviceFormat v)
      Since:
      Available in iOS 11.0 and later.
    • getActiveDepthDataMinFrameDuration

      public CMTime getActiveDepthDataMinFrameDuration()
      Since:
      Available in iOS 12.0 and later.
    • setActiveDepthDataMinFrameDuration

      public void setActiveDepthDataMinFrameDuration​(CMTime v)
      Since:
      Available in iOS 12.0 and later.
    • getMinAvailableVideoZoomFactor

      public double getMinAvailableVideoZoomFactor()
      Since:
      Available in iOS 11.0 and later.
    • getMaxAvailableVideoZoomFactor

      public double getMaxAvailableVideoZoomFactor()
      Since:
      Available in iOS 11.0 and later.
    • isGeometricDistortionCorrectionSupported

      public boolean isGeometricDistortionCorrectionSupported()
      Since:
      Available in iOS 13.0 and later.
    • isGeometricDistortionCorrectionEnabled

      public boolean isGeometricDistortionCorrectionEnabled()
      Since:
      Available in iOS 13.0 and later.
    • setGeometricDistortionCorrectionEnabled

      public void setGeometricDistortionCorrectionEnabled​(boolean v)
      Since:
      Available in iOS 13.0 and later.
    • getCenterStageControlMode

      public static AVCaptureCenterStageControlMode getCenterStageControlMode()
      Since:
      Available in iOS 14.5 and later.
    • setCenterStageControlMode

      public static void setCenterStageControlMode​(AVCaptureCenterStageControlMode v)
      Since:
      Available in iOS 14.5 and later.
    • isCenterStageEnabled

      public static boolean isCenterStageEnabled()
      Since:
      Available in iOS 14.5 and later.
    • setCenterStageEnabled

      public static void setCenterStageEnabled​(boolean v)
      Since:
      Available in iOS 14.5 and later.
    • isCenterStageActive

      public boolean isCenterStageActive()
      Since:
      Available in iOS 14.5 and later.
    • isPortraitEffectEnabled

      public static boolean isPortraitEffectEnabled()
      Since:
      Available in iOS 15.0 and later.
    • isPortraitEffectActive

      public boolean isPortraitEffectActive()
      Since:
      Available in iOS 15.0 and later.
    • getPreferredMicrophoneMode

      public static AVCaptureMicrophoneMode getPreferredMicrophoneMode()
      Since:
      Available in iOS 15.0 and later.
    • getActiveMicrophoneMode

      public static AVCaptureMicrophoneMode getActiveMicrophoneMode()
      Since:
      Available in iOS 15.0 and later.
    • WasConnectedNotification

      public static NSString WasConnectedNotification()
    • WasDisconnectedNotification

      public static NSString WasDisconnectedNotification()
    • SubjectAreaDidChangeNotification

      public static NSString SubjectAreaDidChangeNotification()
    • getMaxAvailableTorchLevel

      public static float getMaxAvailableTorchLevel()
    • getLensPositionCurrent

      public static float getLensPositionCurrent()
    • getExposureDurationCurrent

      public static CMTime getExposureDurationCurrent()
    • getISOCurrent

      public static float getISOCurrent()
    • getExposureTargetBiasCurrent

      public static float getExposureTargetBiasCurrent()
    • getWhiteBalanceGainsCurrent

      public static AVCaptureWhiteBalanceGains getWhiteBalanceGainsCurrent()
    • hasMediaType

      public boolean hasMediaType​(AVMediaType mediaType)
    • lockForConfiguration

      public boolean lockForConfiguration() throws NSErrorException
      Throws:
      NSErrorException
    • unlockForConfiguration

      public void unlockForConfiguration()
    • supportsAVCaptureSessionPreset

      public boolean supportsAVCaptureSessionPreset​(AVCaptureSessionPreset preset)
    • getDevices

      @Deprecated public static NSArray<AVCaptureDevice> getDevices()
      Deprecated.
      Deprecated in iOS 10.0. Use AVCaptureDeviceDiscoverySession instead.
    • getDevicesForMediaType

      @Deprecated public static NSArray<AVCaptureDevice> getDevicesForMediaType​(AVMediaType mediaType)
      Deprecated.
      Deprecated in iOS 10.0. Use AVCaptureDeviceDiscoverySession instead.
    • getDefaultDeviceForMediaType

      public static AVCaptureDevice getDefaultDeviceForMediaType​(AVMediaType mediaType)
    • getDeviceWithUniqueID

      public static AVCaptureDevice getDeviceWithUniqueID​(String deviceUniqueID)
    • getDefaultDevice

      public static AVCaptureDevice getDefaultDevice​(String deviceType, AVMediaType mediaType, AVCaptureDevicePosition position)
      Since:
      Available in iOS 10.0 and later.
    • setPrimaryConstituentDeviceSwitchingBehavior

      public void setPrimaryConstituentDeviceSwitchingBehavior​(AVCapturePrimaryConstituentDeviceSwitchingBehavior switchingBehavior, AVCapturePrimaryConstituentDeviceRestrictedSwitchingBehaviorConditions restrictedSwitchingBehaviorConditions)
      Since:
      Available in iOS 15.0 and later.
    • isFlashModeSupported

      @Deprecated public boolean isFlashModeSupported​(AVCaptureFlashMode flashMode)
      Deprecated.
      Deprecated in iOS 10.0. Use AVCapturePhotoOutput's -supportedFlashModes instead.
    • isTorchModeSupported

      public boolean isTorchModeSupported​(AVCaptureTorchMode torchMode)
    • setTorchModeOn

      public boolean setTorchModeOn​(float torchLevel) throws NSErrorException
      Throws:
      NSErrorException
    • isFocusModeSupported

      public boolean isFocusModeSupported​(AVCaptureFocusMode focusMode)
    • setFocusModeLocked

      public void setFocusModeLocked​(float lensPosition, VoidBlock1<CMTime> handler)
    • isExposureModeSupported

      public boolean isExposureModeSupported​(AVCaptureExposureMode exposureMode)
    • setExposureModeCustom

      public void setExposureModeCustom​(CMTime duration, float ISO, VoidBlock1<CMTime> handler)
    • setExposureTargetBias

      public void setExposureTargetBias​(float bias, VoidBlock1<CMTime> handler)
    • isWhiteBalanceModeSupported

      public boolean isWhiteBalanceModeSupported​(AVCaptureWhiteBalanceMode whiteBalanceMode)
    • setWhiteBalanceModeLocked

      public void setWhiteBalanceModeLocked​(AVCaptureWhiteBalanceGains whiteBalanceGains, VoidBlock1<CMTime> handler)
    • convertDeviceWhiteBalanceGainsToChromaticityValues

      public AVCaptureWhiteBalanceChromaticityValues convertDeviceWhiteBalanceGainsToChromaticityValues​(AVCaptureWhiteBalanceGains whiteBalanceGains)
    • convertChromaticityValuesToDeviceWhiteBalanceGains

      public AVCaptureWhiteBalanceGains convertChromaticityValuesToDeviceWhiteBalanceGains​(AVCaptureWhiteBalanceChromaticityValues chromaticityValues)
    • convertDeviceWhiteBalanceGainsToTemperatureAndTintValues

      public AVCaptureWhiteBalanceTemperatureAndTintValues convertDeviceWhiteBalanceGainsToTemperatureAndTintValues​(AVCaptureWhiteBalanceGains whiteBalanceGains)
    • convertTemperatureAndTintValuesToDeviceWhiteBalanceGains

      public AVCaptureWhiteBalanceGains convertTemperatureAndTintValuesToDeviceWhiteBalanceGains​(AVCaptureWhiteBalanceTemperatureAndTintValues tempAndTintValues)
    • rampToVideoZoomFactor

      public void rampToVideoZoomFactor​(double factor, float rate)
    • cancelVideoZoomRamp

      public void cancelVideoZoomRamp()
    • getAuthorizationStatusForMediaType

      public static AVAuthorizationStatus getAuthorizationStatusForMediaType​(AVMediaType mediaType)
    • requestAccessForMediaType

      public static void requestAccessForMediaType​(AVMediaType mediaType, VoidBooleanBlock handler)
    • getExtrinsicMatrix

      public static NSData getExtrinsicMatrix​(AVCaptureDevice fromDevice, AVCaptureDevice toDevice)
      Since:
      Available in iOS 13.0 and later.
    • showSystemUserInterface

      public static void showSystemUserInterface​(AVCaptureSystemUserInterface systemUserInterface)
      Since:
      Available in iOS 15.0 and later.