Platforms to show: All Mac Windows Linux Cross-Platform
AVCaptureDeviceMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | AVFoundation | MBS AVFoundation Plugin | 13.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
You use a capture device to configure the properties of the underlying hardware. A capture device also provides input data (such as audio or video) to an AVCaptureSession object.
You use the methods of the AVCaptureDevice class to enumerate the available devices, query their capabilities, and be informed about when devices come and go. Before you attempt to set properties of a capture device (its focus mode, exposure mode, and so on), you must first acquire a lock on the device using the lockForConfiguration method. You can then set the properties and release the lock using the unlockForConfiguration method. You may hold the lock if you want all settable device properties to remain unchanged. However, holding the device lock unnecessarily may degrade capture quality in other applications sharing the device and is not recommended.
May work for all built-in cameras and microphones as well as external USB webcams, as far as Apple supports them.
This is an abstract class. You can't create an instance, but you can get one from various plugin functions.
- 47 properties
- property activeFormat as AVCaptureDeviceFormatMBS
- property activeInputSource as AVCaptureDeviceInputSourceMBS
- property activeVideoMaxFrameDuration as CMTimeMBS
- property activeVideoMinFrameDuration as CMTimeMBS
- property AutoVideoFrameRateEnabled as Boolean New in 25.1
- property BackgroundReplacementActive as Boolean New in 25.1
- property canPerformReactionEffects as Boolean
- property centerStageRectOfInterest as CGRectMBS New in 25.1
- property companionDeskViewCamera as AVCaptureDeviceMBS New in 25.1
- property continuityCamera as Boolean New in 25.1
- property deviceType as String New in 25.1
- property displayVideoZoomFactorMultiplier as Double New in 25.1
- property exposureMode as Integer
- property exposurePointOfInterest as CGPointMBS
- property flashMode as Integer
- property focusMode as Integer
- property focusPointOfInterest as CGPointMBS
- property Handle as Integer
- property hasFlash as boolean
- property hasTorch as boolean
- property isAdjustingExposure as boolean
- property isAdjustingFocus as boolean
- property isAdjustingWhiteBalance as boolean
- property isCenterStageActive as Boolean New in 25.1
- property isCenterStageRectOfInterestSupported as Boolean New in 25.1
- property isConnected as boolean
- property isExposurePointOfInterestSupported as boolean
- property isFocusPointOfInterestSupported as boolean
- property isInUseByAnotherApplication as boolean
- property isRampingVideoZoom as Boolean
- property isSuspended as boolean
- property isVirtualDevice as Boolean New in 25.1
- property localizedName as string
- property manufacturer as String
- property maxAvailableVideoZoomFactor as Double
- property minAvailableVideoZoomFactor as Double
- property modelID as string
- property position as Integer
- property StudioLightActive as Boolean New in 25.1
- property torchMode as Integer
- property transportControlsPlaybackMode as Integer
- property transportControlsSpeed as Double
- property transportControlsSupported as boolean
- property transportType as Integer
- property uniqueID as string
- property videoZoomFactor as Double
- property whiteBalanceMode as Integer
- 7 shared properties
- shared property BackgroundReplacementEnabled as Boolean New in 25.1
- shared property centerStageControlMode as Integer New in 25.1
- shared property centerStageEnabled as Boolean New in 25.1
- shared property reactionEffectGesturesEnabled as Boolean
- shared property reactionEffectsEnabled as Boolean
- shared property StudioLightEnabled as Boolean New in 25.1
- shared property userPreferredCamera as AVCaptureDeviceMBS New in 25.1
- 21 methods
- method availableReactionTypes as String()
- method cancelVideoZoomRamp New in 25.1
- method constituentDevices as AVCaptureDeviceMBS() New in 25.1
- method Constructor Private
- method formats as AVCaptureDeviceFormatMBS()
- method hasMediaType(mediaType as string) as boolean
- method inputSources as AVCaptureDeviceInputSourceMBS()
- method isExposureModeSupported(exposureMode as Integer) as boolean
- method isFlashModeSupported(FlashMode as Integer) as boolean
- method isFocusModeSupported(focusMode as Integer) as boolean
- method isTorchModeSupported(torchMode as Integer) as boolean
- method isWhiteBalanceModeSupported(mode as Integer) as boolean
- method linkedDevices as AVCaptureDeviceMBS()
- method lockForConfiguration(byref error as NSErrorMBS) as boolean
- method performEffectForReaction(reactionType as String)
- method rampToVideoZoomFactor(factor as double, rate as double) New in 25.1
- method reactionEffectsInProgress as AVCaptureReactionEffectStateMBS()
- method setTransportControlsPlaybackMode(mode as Integer, speed as Double)
- method supportsAVCaptureSessionPreset(preset as string) as boolean
- method unlockForConfiguration
- method virtualDeviceSwitchOverVideoZoomFactors as Double() New in 25.1
- 22 shared methods
- shared method authorizationStatusForMediaType(mediaType as string) as Integer
- shared method available as boolean
- shared method AVCaptureDeviceTypeBuiltInDualCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInDualWideCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInLiDARDepthCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInTelephotoCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInTripleCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInTrueDepthCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInUltraWideCamera as String New in 25.1
- shared method AVCaptureDeviceTypeBuiltInWideAngleCamera as String New in 25.1
- shared method AVCaptureDeviceTypeContinuityCamera as String New in 25.1
- shared method AVCaptureDeviceTypeDeskViewCamera as String New in 25.1
- shared method AVCaptureDeviceTypeExternal as String New in 25.1
- shared method AVCaptureDeviceTypeMicrophone as String New in 25.1
- shared method AVCaptureMaxAvailableTorchLevel as Double
- shared method defaultDeviceWithMediaType(mediaType as string) as AVCaptureDeviceMBS
- shared method devices as AVCaptureDeviceMBS()
- shared method devicesWithMediaType(mediaType as string) as AVCaptureDeviceMBS()
- shared method deviceWithUniqueID(deviceUniqueID as string) as AVCaptureDeviceMBS
- shared method discoverDevices(deviceTypes() as String, mediaType as String = "", position as Integer = 0) as AVCaptureDeviceMBS() New in 25.1
- shared method requestAccessForMediaType(mediaType as string, tag as variant = nil)
- shared method systemPreferredCamera as AVCaptureDeviceMBS New in 25.1
- 27 constants
Authorization
Constant | Value | Description |
---|---|---|
AVAuthorizationStatusAuthorized | 3 |
The client is authorized to access the hardware supporting a media type. This is default for MacOS 10.13 or older. |
AVAuthorizationStatusDenied | 2 |
The user explicitly denied access to the hardware supporting a media type for the client. |
AVAuthorizationStatusNotDetermined | 0 |
Indicates that the user has not yet made a choice regarding whether the client can access the hardware. |
AVAuthorizationStatusRestricted | 1 |
The client is not authorized to access the hardware for the media type. The user cannot change the client's status, possibly due to active restrictions such as parental controls being in place. |
Center Stage Control Modes
Constant | Value | Description |
---|---|---|
AVCaptureCenterStageControlModeApp | 1 |
The application controls center stage. |
AVCaptureCenterStageControlModeCooperative | 2 |
The user and the app control center stage together. |
AVCaptureCenterStageControlModeUser | 0 |
The user controls center stage. |
Device Position Modes
Constant | Value | Description |
---|---|---|
AVCaptureDevicePositionBack | 1 |
The capture device is on the back of the unit. |
AVCaptureDevicePositionFront | 2 |
The capture device is on the front of the unit. |
AVCaptureDevicePositionUnspecified | 0 |
The capture device's position relative to the system hardware is unspecified. |
Transport Control Modes
Constant | Value | Description |
---|---|---|
AVCaptureDeviceTransportControlsNotPlayingMode | 0 |
Indicates that the tape transport is not threaded through the play head. |
AVCaptureDeviceTransportControlsPlayingMode | 1 |
Indicates that the tape transport is threaded through the play head. |
Exposure Mode Constants
Constant | Value | Description |
---|---|---|
AVCaptureExposureModeAutoExpose | 1 |
The device continuously monitors exposure levels and auto exposes when necessary. |
AVCaptureExposureModeContinuousAutoExposure | 2 |
The device performs an auto-expose operation now. Example |
AVCaptureExposureModeLocked | 0 |
The exposure setting is locked. |
Flash Modes
Constant | Value | Description |
---|---|---|
AVCaptureFlashModeAuto | 2 |
The capture device continuously monitors light levels and uses the flash when necessary. |
AVCaptureFlashModeOff | 0 |
The capture device flash is always off. |
AVCaptureFlashModeOn | 1 |
The capture device flash is always on. |
Focus Modes
Constant | Value | Description |
---|---|---|
AVCaptureFocusModeAutoFocus | 1 |
The capture device performs an autofocus operation now. |
AVCaptureFocusModeContinuousAutoFocus | 2 |
The capture device continuously monitors focus and auto focuses when necessary. |
AVCaptureFocusModeLocked | 0 |
The focus is locked. |
Torch Modes
Constant | Value | Description |
---|---|---|
AVCaptureTorchModeAuto | 2 |
The capture device continuously monitors light levels and uses the torch when necessary. |
AVCaptureTorchModeOff | 0 |
The capture device torch is always off. |
AVCaptureTorchModeOn | 1 |
The capture device torch is always on. |
White Balance Modes
Constant | Value | Description |
---|---|---|
AVCaptureWhiteBalanceModeAutoWhiteBalance | 1 |
The device performs an auto white balance operation now. |
AVCaptureWhiteBalanceModeContinuousAutoWhiteBalance | 2 |
The device continuously monitors white balance and adjusts when necessary. |
AVCaptureWhiteBalanceModeLocked | 0 |
The white balance setting is locked. |
This class has no sub classes.
Blog Entries
- MBS Xojo Plugins, version 25.1pr1
- News from the MBS Xojo Plugins Version 23.5
- MonkeyBread Software Releases the MBS Xojo Plugins in version 23.5
- MBS Xojo Plugins, version 23.5pr6
- MBS Xojo Plugins, version 22.2pr7
- MBS Xojo Plugins, version 20.2pr4
- MonkeyBread Software Releases the MBS Xojo Plugins in version 18.4
- MBS Xojo Plugins, version 18.4pr7
Xojo Developer Magazine
Release notes
- Version 25.1
- Added more methods and properties for AVCaptureDeviceMBS class.
- Version 23.5
- Added methods to work with reaction effects on macOS 14 and iOS 17 with AVCaptureDeviceMBS class.
- Version 22.2
- Added videoZoomFactor property to AVCaptureDeviceMBS class.
- Version 20.2
- Added setter for AVCaptureDeviceMBS.activeInputSource property.
- Version 18.4
- Added authorizationStatusForMediaType and requestAccessForMediaType methods for AVCaptureDeviceMBS class for MacOS 10.14 Mojave. For older MacOS versions we always report authorized.
Some methods using this class:
- AVCaptureDeviceInputMBS.Constructor(Device as AVCaptureDeviceMBS, byref error as NSErrorMBS)
- AVCaptureDeviceInputMBS.device as AVCaptureDeviceMBS
- AVCaptureDeviceInputMBS.deviceInputWithDevice(device as AVCaptureDeviceMBS, byref error as NSErrorMBS) as AVCaptureDeviceInputMBS
Some properties using for this class:
- AVCaptureDeviceMBS.companionDeskViewCamera as AVCaptureDeviceMBS
- AVCaptureDeviceMBS.userPreferredCamera as AVCaptureDeviceMBS
Some events using this class:
- AVFoundationMBS.CaptureDeviceSubjectAreaDidChange(device as AVCaptureDeviceMBS, notification as Variant)
- AVFoundationMBS.CaptureDeviceWasConnected(device as AVCaptureDeviceMBS, notification as Variant)
- AVFoundationMBS.CaptureDeviceWasDisconnected(device as AVCaptureDeviceMBS, notification as Variant)
Some examples using this class:
- /AVFoundation/AVVideoWall
- /AVFoundation/Device List
- /AVFoundation/iOS Live QRCode Detect/iOS Live QRCode Detect
- /AVFoundation/Live Barcode Detection
- /AVFoundation/Live Barcode Detection iOS/Live Barcode Detection iOS
- /AVFoundation/Live Barcode Detection with Vision/Live Barcode Detection with Vision
- /AVFoundation/Live picture processing
- /AVFoundation/Recorder
- /AVFoundation/Screen Recorder
- /AVFoundation/Still Photos
Some related classes:
- class AVCaptureDeviceFormatMBS
- class AVCaptureDeviceInputMBS
- class AVCaptureDeviceInputSourceMBS
- class AVCaptureReactionEffectStateMBS
- class AVFoundationMBS
- class CGPointMBS
- class CGRectMBS
- class CMTimeMBS
- class NSErrorMBS
The items on this page are in the following plugins: MBS AVFoundation Plugin.
AVCaptureDeviceInputSourceMBS - AVCaptureFileOutputMBS
