mirror of
https://github.com/vector-im/element-call.git
synced 2026-11-16 01:22:29 +00:00
Ask one question about whether background effects can run
The controls and the pipeline each asked the SDK on their own whether background processing is supported, so one could offer what the other refused. One function answers both, and it asks the browser, kept to desktops until the menu says what the effects cost elsewhere. Ported from spec/background-effects/2-pipeline (#4282):f78e9c05and87638325, the tests on the lobby and call footers as they are. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
committed by
Timo
co-authored by
Claude Fable 5.1
parent
146dd3aea1
commit
a0aaa8e09a
@@ -5,17 +5,14 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import {
|
||||
BackgroundProcessorWrapper,
|
||||
supportsBackgroundProcessors as supportsBackgroundProcessorsLivekitSdk,
|
||||
} from "@livekit/track-processors";
|
||||
import { BackgroundProcessorWrapper } from "@livekit/track-processors";
|
||||
import { createContext, type FC, type JSX, use } from "react";
|
||||
|
||||
import { backgroundBlur as backgroundBlurSettings } from "../settings/settings";
|
||||
import { BackgroundEffectTransformer } from "./BackgroundEffectTransformer";
|
||||
import { supportsBackgroundProcessors } from "./backgroundProcessing";
|
||||
import { type Behavior } from "../state/Behavior";
|
||||
import { type ObservableScope } from "../state/ObservableScope";
|
||||
import { platform } from "../Platform";
|
||||
import {
|
||||
type BackgroundEffects,
|
||||
type BackgroundEffectsState,
|
||||
@@ -40,10 +37,6 @@ export function useBackgroundEffectsState$(): Behavior<BackgroundEffectsState> {
|
||||
return effects.state$;
|
||||
}
|
||||
|
||||
function supportsBackgroundProcessors(): boolean {
|
||||
return supportsBackgroundProcessorsLivekitSdk() && platform === "desktop";
|
||||
}
|
||||
|
||||
/**
|
||||
* The app's one pipeline, shared by every camera track it opens. Its builds
|
||||
* and teardowns take their turns through the SDK, which runs one operation
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
/*
|
||||
Copyright 2026 Element Creations Ltd.
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
||||
Please see LICENSE in the repository root for full details.
|
||||
*/
|
||||
|
||||
import { supportsBackgroundProcessors as supportsBackgroundProcessorsLivekitSdk } from "@livekit/track-processors";
|
||||
|
||||
import { platform } from "../Platform";
|
||||
|
||||
/** One answer for the controls and the pipeline, so neither offers what the other refuses. */
|
||||
export function supportsBackgroundProcessors(): boolean {
|
||||
return supportsBackgroundProcessorsLivekitSdk() && platform === "desktop";
|
||||
}
|
||||
Reference in New Issue
Block a user