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<any CameraDeviceVideoDelegate> -
Declaration
Swift
public var audioDelegates: MulticastDelegate<any 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
startshould be called to begin frames forwarding through CameraDeviceVideoDelegate and CameraDeviceAudioDelegate.Declaration
Swift
public init( cameraMode: Mode, captureSessionPreset: AVCaptureSession.Preset, fpsLimit: Double = 60 )Parameters
cameraModeuse front or back lens
captureSessionPresetresolution for video frames feed
fpsLimitmax 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)
CameraDevice Class Reference