fixes and gpu based blurring
This commit is contained in:
@@ -87,7 +87,7 @@ export function useLiveKit(
|
|||||||
let b = undefined;
|
let b = undefined;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line new-cap
|
// eslint-disable-next-line new-cap
|
||||||
b = BackgroundBlur(15);
|
b = BackgroundBlur(15, { delegate: "GPU" });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("disable background blur", e);
|
logger.error("disable background blur", e);
|
||||||
}
|
}
|
||||||
@@ -178,15 +178,17 @@ export function useLiveKit(
|
|||||||
if (publishCallback)
|
if (publishCallback)
|
||||||
room.off(RoomEvent.LocalTrackPublished, publishCallback);
|
room.off(RoomEvent.LocalTrackPublished, publishCallback);
|
||||||
|
|
||||||
if (
|
if (videoTrack !== undefined) {
|
||||||
videoTrack !== undefined &&
|
if (
|
||||||
videoTrack.track?.getProcessor() === undefined
|
showBackgroundBlur &&
|
||||||
) {
|
videoTrack.track?.getProcessor()?.name !== "background-blur"
|
||||||
if (showBackgroundBlur) {
|
) {
|
||||||
logger.info("Blur: set blur");
|
logger.info("Blur: set blur");
|
||||||
|
|
||||||
void videoTrack.track?.setProcessor(blur);
|
void videoTrack.track?.setProcessor(blur);
|
||||||
} else {
|
} else if (
|
||||||
|
videoTrack.track?.getProcessor()?.name === "background-blur"
|
||||||
|
) {
|
||||||
void videoTrack.track?.stopProcessor();
|
void videoTrack.track?.stopProcessor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ export const LobbyView: FC<Props> = ({
|
|||||||
let b = undefined;
|
let b = undefined;
|
||||||
try {
|
try {
|
||||||
// eslint-disable-next-line new-cap
|
// eslint-disable-next-line new-cap
|
||||||
b = BackgroundBlur(15);
|
b = BackgroundBlur(15, { delegate: "GPU" });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logger.error("disable background blur", e);
|
logger.error("disable background blur", e);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user