import BackgroundFilterSpec from '../backgroundfilter/BackgroundFilterSpec' ; import BackgroundFilterVideoFrameProcessor from '../backgroundfilter/BackgroundFilterVideoFrameProcessor' ; import ConsoleLogger from '../logger/ConsoleLogger' ; import Logger from '../logger/Logger' ; import LogLevel from '../logger/LogLevel' ; import NoOpVideoFrameProcessor from '../videoframeprocessor/NoOpVideoFrameProcessor' ; import BackgroundBlurOptions from './BackgroundBlurOptions' ; import BackgroundBlurProcessor from './BackgroundBlurProcessor' ; import BackgroundBlurProcessorBuiltIn from './BackgroundBlurProcessorBuiltIn' ; import BackgroundBlurProcessorProvided from './BackgroundBlurProcessorProvided' ; import BlurStrength from './BackgroundBlurStrength' ; /**
 * No-op implementation of the blur processor. An instance of this class will be returned when a user attempts
 * to create a blur processor when it is not supported.
 */ internal class NoOpBackgroundBlurProcessor extends NoOpVideoFrameProcessor implements BackgroundBlurProcessor { /**
     * no-op
     */ setBlurStrength ( ) { } returns async loadAssets ( ) { return ; } /**
     * no-op
     */ addObserver ( ) { } /**
     * no-op
     */ removeObserver ( ) { } } /**
 * [[BackgroundBlurVideoFrameProcessor]]
 * Creates a background blur processor which identifies the foreground person and blurs the background.
 */ export default class BackgroundBlurVideoFrameProcessor extends BackgroundFilterVideoFrameProcessor { param spec param blurStrength returns static async create ( spec ? , options ? ) { spec = BackgroundBlurVideoFrameProcessor . resolveSpec ( spec ) ; options = BackgroundBlurVideoFrameProcessor . resolveOptions ( options ) ; const { logger } = options ; const supported = await BackgroundBlurVideoFrameProcessor . isSupported ( spec , options ) ; logger . info ( `processor is ${ supported ? '' : 'not' } supported` ) ; if ( ! supported ) { logger . warn ( 'Using no-op processor because background blur is not supported' ) ; return new NoOpBackgroundBlurProcessor ( ) ; } let processor ; if ( await BackgroundBlurProcessorProvided . isSupported ( ) ) { logger . info ( 'Using browser-provided background blur' ) ; processor = new BackgroundBlurProcessorProvided ( spec , options ) ; } else { logger . info ( 'Using built-in background blur' ) ; processor = new BackgroundBlurProcessorBuiltIn ( spec , options ) ; } await processor . loadAssets ( ) ; return processor ; } param options returns protected static resolveOptions ( options = { } ) { if ( ! options . blurStrength ) { options . blurStrength = BlurStrength . MEDIUM ; } if ( ! options . logger ) { options . logger = new ConsoleLogger ( 'BackgroundBlurProcessor' , LogLevel . INFO ) ; } options = super . resolveOptions ( options ) ; return options ; } param spec The  BackgroundBlurSpec spec that will be used to initialize assets
     *  param options returns static isSupported ( spec ? , options ? ) { spec = BackgroundBlurVideoFrameProcessor . resolveSpec ( spec ) ; options = BackgroundBlurVideoFrameProcessor . resolveOptions ( options ) ; return super . isSupported ( spec , options ) ; } }