fixes and gpu based blurring

This commit is contained in:
Timo
2024-11-27 21:00:09 +01:00
committed by Hugh Nimmo-Smith
parent c2b6518027
commit 7d8e9a7969
2 changed files with 10 additions and 8 deletions

View File

@@ -87,7 +87,7 @@ export function useLiveKit(
let b = undefined;
try {
// eslint-disable-next-line new-cap
b = BackgroundBlur(15);
b = BackgroundBlur(15, { delegate: "GPU" });
} catch (e) {
logger.error("disable background blur", e);
}
@@ -178,15 +178,17 @@ export function useLiveKit(
if (publishCallback)
room.off(RoomEvent.LocalTrackPublished, publishCallback);
if (
videoTrack !== undefined &&
videoTrack.track?.getProcessor() === undefined
) {
if (showBackgroundBlur) {
if (videoTrack !== undefined) {
if (
showBackgroundBlur &&
videoTrack.track?.getProcessor()?.name !== "background-blur"
) {
logger.info("Blur: set blur");
void videoTrack.track?.setProcessor(blur);
} else {
} else if (
videoTrack.track?.getProcessor()?.name === "background-blur"
) {
void videoTrack.track?.stopProcessor();
}
}

View File

@@ -116,7 +116,7 @@ export const LobbyView: FC<Props> = ({
let b = undefined;
try {
// eslint-disable-next-line new-cap
b = BackgroundBlur(15);
b = BackgroundBlur(15, { delegate: "GPU" });
} catch (e) {
logger.error("disable background blur", e);
}