Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

AVCaptureDeviceMBS.authorizationStatusForMediaType(mediaType as string) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 18.4 Yes No No Yes, macOS only No
Function: Returns the client's authorization status for accessing the underlying hardware that supports a given media type.
Notes:
Mediatype: The media type, either AVMediaTypeVideo or AVMediaTypeAudio.
Returns the authorization status of the client

This method returns the AVAuthorizationStatus of the client for accessing the underlying hardware supporting the media type. Media type constants are defined in AVFoundationMBS. If any media type other than AVMediaTypeVideo or AVMediaTypeAudio is supplied, an NSInvalidArgumentException will be thrown. If the status is AVAuthorizationStatusNotDetermined, you may use the requestAccessForMediaType method to request access by prompting the user.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.available as boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Whether this class is available.
Notes: Returns true on Mac OS X 10.7 and newer.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.AVCaptureMaxAvailableTorchLevel as Double
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 14.0 Yes No No Yes, macOS only No
Function: The maximum torch level.
Notes:
This constant always represents the maximum available torch level, independent of the actual maximum value currently supported by the device. Thus, pass this constant to the setTorchModeOnWithLevel:error: in situations where you want to specify the maximum torch level without having to worry about whether the device is overheating and might not accept a value of 1.0 as the maximum.
Available in OS X v10.9 and later.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.defaultDeviceWithMediaType(mediaType as string) as AVCaptureDeviceMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns the default device used to capture data of a given media type.
Example:
dim device as AVCaptureDeviceMBS = AVCaptureDeviceMBS.defaultDeviceWithMediaType(AVFoundationMBS.AVMediaTypeAudio)
MsgBox device.localizedName
Notes:
mediaType: A media type identifier.
For possible values, see AV Foundation Constants Reference.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.devices as AVCaptureDeviceMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of the available capture devices on the system.
Example:
dim devices() as AVCaptureDeviceMBS = AVCaptureDeviceMBS.devices
dim names() as string

for each d as AVCaptureDeviceMBS in devices
names.Append d.localizedName
next

// show all names in a message dialog
MsgBox Join(names, EndOfLine)

Feedback, Comments & Corrections

AVCaptureDeviceMBS.devicesWithMediaType(mediaType as string) as AVCaptureDeviceMBS()
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns an array of the devices able to capture data of a given media type.
Example:
dim devices() as AVCaptureDeviceMBS = AVCaptureDeviceMBS.devicesWithMediaType(AVFoundationMBS.AVMediaTypeAudio)
dim names() as string

for each d as AVCaptureDeviceMBS in devices
names.Append d.localizedName
next

// show all names of audio devices in a message dialog
MsgBox Join(names, EndOfLine)
Notes:
mediaType: A media type identifier.
For possible values, see AV Foundation Constants Reference.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.deviceWithUniqueID(deviceUniqueID as string) as AVCaptureDeviceMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 13.2 Yes No No Yes, macOS only No
Function: Returns the device with a given ID.
Notes: deviceUniqueID: The ID of a capture device.

Feedback, Comments & Corrections

AVCaptureDeviceMBS.requestAccessForMediaType(mediaType as string, tag as variant = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
shared method AVFoundation MBS AVFoundation Plugin 18.4 Yes No No Yes, macOS only No
Function: Requests access to the underlying hardware for the media type, showing a dialog to the user if necessary.
Notes:
mediaType: The media type, either AVMediaTypeVideo or AVMediaTypeAudio

Use this function to request access to the hardware for a given media type. Media type constants are defined in AVFoundationMBS
If any media type other than AVMediaTypeVideo or AVMediaTypeAudio is supplied, an NSInvalidArgumentException will be thrown.

This call will not block while the user is being asked for access, allowing the client to continue running. Until access has been granted, any AVCaptureDevices for the media type will vend silent audio samples or black video frames. The user is only asked for permission the first time the client requests access. Later calls use the permission granted by the user.

Note that the authorization dialog will automatically be shown if the status is AVAuthorizationStatusNotDetermined when creating an AVCaptureDeviceInput.

Invoking this method with AVMediaTypeAudio is equivalent to calling AVAudioSessionMBS.requestRecordPermission.

Call returns directly as request is performed on thread.
The requestAccessForMediaTypeCompleted event is called later in your AVFoundationMBS subclass with results on main thread.
The granted value will always true for MacOS 10.13 or older.

Feedback, Comments & Corrections

The items on this page are in the following plugins: MBS AVFoundation Plugin.




Links
MBS Xojo PDF Plugins