BanubaSdkManager

@objc
public class BanubaSdkManager : NSObject
@objc extension BanubaSdkManager: InputServiceDelegate
extension BanubaSdkManager: BNBCameraPoiListener
extension BanubaSdkManager: BNBFaceNumberListener
extension BanubaSdkManager: BNBFrameDurationListener
  • Declaration

    Swift

    @objc
    public weak var delegate: BanubaSdkManagerDelegate?
  • Access to current instance of BNBEffectPlayer

    Declaration

    Swift

    @objc
    public private(set) var effectPlayer: BNBEffectPlayer? { get }
  • Face orintation in frame (degrees).

    Declaration

    Swift

    @objc
    public var faceOrientation: Int
  • Declaration

    Swift

    @objc
    public func effectManager() -> BNBEffectManager?
  • Enable autorotation mode. Camera orientation and render size should change along with UI orientation

    Declaration

    Swift

    @objc
    public var autoRotationEnabled: Bool { get set }
  • Declaration

    Swift

    @discardableResult
    @objc
    public func loadEffect(_ effectUrl: String, synchronous: Bool = false) -> BNBEffect?

    Parameters

    effectUrl

    path to effect relative to resource paths passed to initialize.

    synchronous

    block the call until effect is loaded.

  • Declaration

    Swift

    @objc
    public func unloadEffect(effect: BNBEffect?)

    Parameters

    effect

    effect which should be unloaded.

  • Declaration

    Swift

    @objc
    public func currentEffect() -> BNBEffect?
  • Maximum number of faces to trace simultaneously

    Declaration

    Swift

    @objc
    public func setMaxFaces(_ maxFaces: Int)
  • Declaration

    Swift

    @objc
    public var input: InputServicing { get set }
  • Declaration

    Swift

    @objc
    public var output: OutputServicing? { get }

GPU

Render RunLoop

  • Declaration

    Swift

    public private(set) var editingImageFrameData: BNBFrameData? { get }
  • Declaration

    Swift

    @objc
    public var renderThread: Thread? { get }

App State Handling

Effect Player life circle

  • Declaration

    Swift

    @objc
    public private(set) var isLoaded: Bool { get }
  • Declaration

    Swift

    public override init()
  • Intialize common banuba SDK resources. This must be called before BanubaSdkManger instance creation. Counterpart deinitialize exists.

    Declaration

    Swift

    @objc
    public class func initialize(
        resourcePath: [String] = [],
        clientTokenString: String,
        logLevel: BNBSeverityLevel = .info
    )

    Parameters

    resourcePath

    paths to cutom resources folders

    clientTokenString

    client token

    logLevel

    log level

  • Release common Banuba SDK resources

    Declaration

    Swift

    @objc
    public class func deinitialize()
  • Enables performance diagnostics. Don’t call before initialize.

    Declaration

    Swift

    @objc
    public class func enableDiagnostics(outputFolder: String)
  • Declaration

    Swift

    @objc
    public func setDrawOnDemandMode(_ mode: Bool)
  • Declaration

    Swift

    @objc
    public func requestFrameDraw()
  • Declaration

    Swift

    @objc
    public func setup(configuration: EffectPlayerConfiguration)
  • Declaration

    Swift

    @objc
    public func destroy()
  • BNBEffectPlayer may crash on certain devices. So, we downscale the input image before processing.

    Declaration

    Swift

    @objc
    public static func scaleBeforeProcessing(_ buffer: CVPixelBuffer?) -> CVPixelBuffer?

Orientation Helper

  • Declaration

    Swift

    public func push(cmBuffer: CMSampleBuffer)
  • Declaration

    Swift

    public func push(cvBuffer: CVPixelBuffer)

Effect Player Management

Effect Player callbacks