AVCaptureDevice
class AVCaptureDevice : NSObject
-
Returns the capture device for the desired device type and position.
protip, NextLevelDevicePosition.avfoundationType can provide the AVFoundation type.
Declaration
Swift
public class func captureDevice(withType deviceType: AVCaptureDevice.DeviceType, forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?Parameters
deviceTypeSpecified capture device type, (i.e. builtInMicrophone, builtInWideAngleCamera, etc.)
positionDesired position of device
Return Value
Capture device for the specified type and position, otherwise nil
-
Returns the default wide angle video device for the desired position, otherwise nil.
Declaration
Swift
public class func wideAngleVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?Parameters
positionDesired position of the device
Return Value
Wide angle video capture device, otherwise nil
-
Returns the default telephoto video device for the desired position, otherwise nil.
Declaration
Swift
public class func telephotoVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?Parameters
positionDesired position of the device
Return Value
Telephoto video capture device, otherwise nil
-
Returns the primary duo camera video device, if available, else the default wide angel camera, otherwise nil.
Declaration
Swift
public class func primaryVideoDevice(forPosition position: AVCaptureDevice.Position) -> AVCaptureDevice?Parameters
positionDesired position of the device
Return Value
Primary video capture device found, otherwise nil
-
Returns the default video capture device, otherwise nil.
Declaration
Swift
public class func videoDevice() -> AVCaptureDevice?Return Value
Default video capture device, otherwise nil
-
Returns the default audio capture device, otherwise nil.
Declaration
Swift
public class func audioDevice() -> AVCaptureDevice?Return Value
default audio capture device, otherwise nil
-
Calculates focal length and principle point camera intrinsic parameters for OpenCV. (see Hartley’s Mutiple View Geometry, Chapter 6)
Declaration
Swift
public func focalLengthAndPrinciplePoint(focalLengthX: inout Float, focalLengthY: inout Float, principlePointX: inout Float, principlePointY: inout Float)Parameters
focalLengthXfocal length along the x-axis
focalLengthYfocal length along the y-axis
principlePointXprinciple point x-coordinate
principlePointYprinciple point y-coordinate
Return Value
truewhen the focal length and principle point parameters are successfully calculated.
View on GitHub
AVCaptureDevice Extension Reference