mirror of
https://github.com/vector-im/element-call.git
synced 2026-11-10 01:02:27 +00:00
Blur runs through one pipeline, shared by the pre-join preview and the call: attached the first time an effect is wanted and switched in place after, never detached. The logic is BackgroundEffects in src/state; BackgroundEffectsContext only builds it, from the app's view model, so the standalone app and the component hand the same instance to every camera. Disabled drops the blur radius, so no effect costs no segmentation. The SDK gains fromLivekitProcessor beside the adapter, now toLivekitProcessor. Ported from spec/background-effects/2-pipeline (#4282):a91dab8fwith its review tidy-ups445e010c,bbc73d07,51729bcf,f52d2b79,813f1e6fand 584bbaa0. Left out as already solved here: OneStepPipeline (the SDK runs a processor's steps in turn) and the LiveKit-track sync helpers (the lobby's camera is an SDK track, synced by followProcessor). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
30 lines
917 B
TypeScript
30 lines
917 B
TypeScript
/*
|
|
Copyright 2025 New Vector Ltd.
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
Please see LICENSE in the repository root for full details.
|
|
*/
|
|
|
|
import { type AudioOutputOptions, MediaDevices } from "./MediaDevices";
|
|
import { type ObservableScope } from "./ObservableScope";
|
|
import { createAppBackgroundEffects } from "../tracks/BackgroundEffectsContext";
|
|
|
|
/**
|
|
* The top-level state holder for the application.
|
|
*/
|
|
export class AppViewModel {
|
|
public readonly mediaDevices = new MediaDevices(
|
|
this.scope,
|
|
this.audioOutputOptions,
|
|
);
|
|
public readonly backgroundEffects = createAppBackgroundEffects(this.scope);
|
|
|
|
// TODO: Move more application logic here. The CallViewModel, at the very
|
|
// least, ought to be accessible from this object.
|
|
|
|
public constructor(
|
|
private readonly scope: ObservableScope,
|
|
private readonly audioOutputOptions: AudioOutputOptions,
|
|
) {}
|
|
}
|