BackgroundBlurVideoFrameProcessor
@objcMembers
public class BackgroundBlurVideoFrameProcessor : NSObject, VideoSource, VideoSink
BackgroundBlurVideoFrameProcessor
is a processor which receives video frames via VideoSource
and
then applies Gaussian blur to each video frame and renders the foreground on top of the blurred image.
Gaussian blur is applied using built in CIGaussianBlur
CIFilter.
-
Declaration
Swift
public var videoContentHint: VideoContentHint
-
Public constructor to initialize the processor.
Declaration
Swift
public init(backgroundBlurConfiguration: BackgroundBlurConfiguration)
Parameters
backgroundBlurConfiguration
BackgroundBlurConfiguration
class. -
Receive a video frame from some upstream source. The foreground is segmented and then masked on top of the blurred background.
Declaration
Swift
public func onVideoFrameReceived(frame: VideoFrame)
Parameters
frame
New video frame to consume.
-
Allow builders to change the blur intensity value after initialization.
Declaration
Swift
public func setBlurStrength(newBlurStrength: BackgroundBlurStrength)
Parameters
newBlurStrength
New blur intensity value.
-
Adds a video sink to the sinks set.
Declaration
Swift
public func addVideoSink(sink: VideoSink)
-
Remove a video sink from the sinks set.
Declaration
Swift
public func removeVideoSink(sink: VideoSink)
-
Update the
VideoSink(s)
with a new frame.Declaration
Swift
public func updateSinks(frame: VideoFrame)
Parameters
frame
Next frame to render.