AVCaptureDevice
class AVCaptureDevice : NSObject
-
Returns the capture device for the desired device type and position.
protip, NextLevelDevicePosition.avfoundationType can provide the AVFoundation type.
- Parameters:
- deviceType: Specified capture device type, (i.e. builtInMicrophone, builtInWideAngleCamera, etc.)
- position: Desired position of device
Returns
Capture device for the specified type and position, otherwise nilDeclaration
Swift
public class func captureDevice(withType deviceType: AVCaptureDevice.DeviceType, forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?
- Parameters:
-
Returns the default wide angle video device for the desired position, otherwise nil.
Parameter
Parameter position: Desired position of the deviceReturns
Wide angle video capture device, otherwise nilDeclaration
Swift
public class func wideAngleVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?
-
Returns the default telephoto video device for the desired position, otherwise nil.
Parameter
Parameter position: Desired position of the deviceReturns
Telephoto video capture device, otherwise nilDeclaration
Swift
public class func telephotoVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?
-
Returns the primary duo camera video device, if available, else the default wide angel camera, otherwise nil.
Parameter
Parameter position: Desired position of the deviceReturns
Primary video capture device found, otherwise nilDeclaration
Swift
public class func primaryVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?
-
Returns the default video capture device, otherwise nil.
Returns
Default video capture device, otherwise nilDeclaration
Swift
public class func videoDevice() -> AVCaptureDevice?
-
Returns the default audio capture device, otherwise nil.
Returns
default audio capture device, otherwise nilDeclaration
Swift
public class func audioDevice() -> AVCaptureDevice?
-
Returns the maximum capable framerate for the desired capture format and minimum, otherwise zero.
- Parameters:
- format: Capture format to evaluate for a specific framerate.
- minFrameRate: Lower bound time scale or minimum desired framerate.
Returns
Maximum capable framerate within the desired format and minimum constraints.Declaration
Swift
public class func maxFrameRate(forFormat format: AVCaptureDevice.Format, minFrameRate: CMTimeScale) -> CMTimeScale
- Parameters:
-
Checks if the specified capture device format supports a desired framerate and dimensions.
- Parameters:
- frameRate: Desired frame rate
- dimensions: Desired video dimensions
Returns
true
if the capture device format supports the given criteria, otherwise falseDeclaration
Swift
public func isSupported(withFrameRate frameRate: CMTimeScale, dimensions: CMVideoDimensions = CMVideoDimensions(width: 0, height: 0)) -> Bool
- Parameters: