mirror of
https://github.com/suitenumerique/meet.git
synced 2026-09-03 14:17:59 +00:00
🐛(frontend) cache supportsBackgroundProcessors WebGL2 probe result
`supportsBackgroundProcessors()` creates a live WebGL2 context on every call and never releases it. The method is called from render paths (e.g. the Effects button on the join screen), so without caching, each re-render leaks a context until the browser hits its live-context limit. This is one of the ways MediaPipe later fails with: "emscripten_webgl_create_context() returned error 0" Support cannot change within a session, so probe once and cache the result.
This commit is contained in:
@@ -32,14 +32,18 @@ export interface BackgroundProcessorInterface extends TrackProcessor<Track.Kind>
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BackgroundProcessorFactory {
|
export class BackgroundProcessorFactory {
|
||||||
|
private static _isSupported?: boolean
|
||||||
|
|
||||||
static hasModernApiSupport() {
|
static hasModernApiSupport() {
|
||||||
return ProcessorWrapper.hasModernApiSupport
|
return ProcessorWrapper.hasModernApiSupport
|
||||||
}
|
}
|
||||||
|
|
||||||
static isSupported() {
|
static isSupported() {
|
||||||
return (
|
if (this._isSupported === undefined) {
|
||||||
supportsBackgroundProcessors() || BackgroundCustomProcessor.isSupported
|
this._isSupported =
|
||||||
)
|
supportsBackgroundProcessors() || BackgroundCustomProcessor.isSupported
|
||||||
|
}
|
||||||
|
return this._isSupported
|
||||||
}
|
}
|
||||||
|
|
||||||
static getProcessor(
|
static getProcessor(
|
||||||
|
|||||||
Reference in New Issue
Block a user