CameraDevice
public class CameraDevice
extension CameraDevice : InputServiceDelegate
CameraDevice provides access to the phone camera module.
-
Declaration
Swift
public typealias Mode = CameraSessionType
-
Declaration
Swift
public var videoDelegates: MulticastDelegate<CameraDeviceVideoDelegate>
-
Declaration
Swift
public var audioDelegates: MulticastDelegate<CameraDeviceAudioDelegate>
-
Current lens mode
Declaration
Swift
public var mode: Mode { get }
-
Track UI orientation and change pushed frames camera orientation
Declaration
Swift
public var trackUIOrientation: Bool
-
Create CameraDevice. After create
start
should be called to begin frames forwarding through CameraDeviceVideoDelegate and CameraDeviceAudioDelegate.Declaration
Swift
public init( cameraMode: Mode, captureSessionPreset: AVCaptureSession.Preset, fpsLimit: Double = 60 )
Parameters
cameraMode
use front or back lens
captureSessionPreset
resolution for video frames feed
fpsLimit
max frame rate
-
Start frames forwarding
Declaration
Swift
public func start()
-
Stop frames forwarding
Declaration
Swift
public func stop()
-
Switch current lens mode, front to back or back to front
Declaration
Swift
public func switchMode()
-
Take photo with camera settings
Declaration
Swift
public func takePhoto(settings: CameraPhotoSettings, completion: @escaping (CVPixelBuffer?, BNBFullImageData?) -> Void)
-
Declaration
Swift
public func push(cmBuffer: CMSampleBuffer)
-
Declaration
Swift
public func push(cvBuffer: CVPixelBuffer)