init()

in AmazonChimeSDKDemo/AmazonChimeSDKDemo/VideoModel.swift [41:68]


    init(audioVideoFacade: AudioVideoFacade, eventAnalyticsController: EventAnalyticsController) {
        self.audioVideoFacade = audioVideoFacade
        self.customSource = DefaultCameraCaptureSource(logger: ConsoleLogger(name: "CustomCameraSource"))
        self.customSource.setEventAnalyticsController(eventAnalyticsController: eventAnalyticsController)

        // Create the background replacement image.
        let rect = CGRect(x: 0,
                          y: 0,
                          width: self.customSource.format.width,
                          height: self.customSource.format.height)
        UIGraphicsBeginImageContextWithOptions(CGSize(width: self.customSource.format.width,
                                                      height: self.customSource.format.height),
                                               false, 0)
        UIColor.blue.setFill()
        UIRectFill(rect)
        let backgroundReplacementImage: UIImage = UIGraphicsGetImageFromCurrentImageContext()!
        UIGraphicsEndImageContext()

        let backgroundReplacementConfigurations = BackgroundReplacementConfiguration(logger: ConsoleLogger(name: "BackgroundReplacementProcessor"),
                                                                                     backgroundReplacementImage: backgroundReplacementImage)
        self.backgroundReplacementProcessor = BackgroundReplacementVideoFrameProcessor(backgroundReplacementConfiguration: backgroundReplacementConfigurations)

        let backgroundBlurConfigurations = BackgroundBlurConfiguration(logger: ConsoleLogger(name: "BackgroundBlurProcessor"),
                                                                       blurStrength: BackgroundBlurStrength.low)
        self.backgroundBlurProcessor = BackgroundBlurVideoFrameProcessor(backgroundBlurConfiguration: backgroundBlurConfigurations)

        super.init()
    }