From 96ea920e9892a0de713a51e7775c949e5ccb0a8c Mon Sep 17 00:00:00 2001 From: Hugh Nimmo-Smith Date: Mon, 6 Jan 2025 15:53:31 +0000 Subject: [PATCH] Try reenabling local implementation of BlurBackgroundTransformer --- src/livekit/TrackProcessorContext.tsx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/livekit/TrackProcessorContext.tsx b/src/livekit/TrackProcessorContext.tsx index 1fc0005a..8edec4f5 100644 --- a/src/livekit/TrackProcessorContext.tsx +++ b/src/livekit/TrackProcessorContext.tsx @@ -6,8 +6,7 @@ Please see LICENSE in the repository root for full details. */ import { - BackgroundBlur as backgroundBlur, - type ProcessorWrapper, + ProcessorWrapper, type BackgroundOptions, } from "@livekit/track-processors"; import { @@ -26,6 +25,7 @@ import { backgroundBlur as backgroundBlurSettings, useSetting, } from "../settings/settings"; +import { BlurBackgroundTransformer } from "./BlurBackgroundTransformer"; type ProcessorState = { supported: boolean | undefined; @@ -89,15 +89,10 @@ export const ProcessorProvider: FC = ({ children }) => { if (!shouldCheckSupport) return; try { if (!blur.current) { - // TODO: move to our own local version of the transformer. - // Currently this is broken: error when trying to pipe IndexSizeError: Failed to construct 'ImageData': The source width is zero or not a number. - // blur.current = new ProcessorWrapper( - // new BlurBackgroundTransformer({}), - // "background-blur", - // ); - - // eslint-disable-next-line new-cap - blur.current = backgroundBlur(); + blur.current = new ProcessorWrapper( + new BlurBackgroundTransformer({}), + "background-blur", + ); } setProcessorState({ checkSupported,