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.
- 36 properties
- property activeFormat as AVCaptureDeviceFormatMBS
- property activeInputSource as AVCaptureDeviceInputSourceMBS
- property activeVideoMaxFrameDuration as CMTimeMBS
- property activeVideoMinFrameDuration as CMTimeMBS
- property canPerformReactionEffects as Boolean
- 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 isConnected as boolean
- property isExposurePointOfInterestSupported as boolean
- property isFocusPointOfInterestSupported as boolean
- property isInUseByAnotherApplication as boolean
- property isRampingVideoZoom as Boolean
- property isSuspended as boolean
- 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 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
- 2 shared properties
- shared property reactionEffectGesturesEnabled as Boolean
- shared property reactionEffectsEnabled as Boolean
- 17 methods
- method availableReactionTypes as String()
- 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 reactionEffectsInProgress as AVCaptureReactionEffectStateMBS()
- method setTransportControlsPlaybackMode(mode as Integer, speed as Double)
- method supportsAVCaptureSessionPreset(preset as string) as boolean
- method unlockForConfiguration
- 8 shared methods
- shared method authorizationStatusForMediaType(mediaType as string) as Integer
- shared method available as boolean
- 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 requestAccessForMediaType(mediaType as string, tag as variant = nil)
- 24 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. |
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.
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 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
Blog Entries
- 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 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.
The items on this page are in the following plugins: MBS AVFoundation Plugin.
AVCaptureDeviceInputSourceMBS - AVCaptureFileOutputMBS