Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
From: Juliusz Chroboczek <>
To: Francis Bolduc <>
Subject: [Galene] Re: Blur background
Date: Sun, 05 May 2024 22:47:47 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

> Yes, loading 3rdparty libraries is conceptually insecure. I initially
> tried to download the Javascript libraries and wasm modules to serve
> them via Galene, but failed because they refer to each other via full
> URL instead of relative paths when you load them.  I also tried to
> download their source code and build them myself, but my head exploded
> when I saw the kind of build system those libraries have.

Yeah, these are the two reasons I've been waiting for Chrome to implement
native background blur [1], but that effort appears to have been abandoned.


>>> +    offscreen = new OffscreenCanvas(1920, 1080);

>> This should be done lazily, in the filter, not at startup.

> Not sure what you mean. How would you do this?

Two ways.  One is to add a function 'init' to your filter definition:

        description: "Blur Background",
        init: initBlurBackground,
        f: blurBackground,

and then, in initBlurBackground, instantiate a new field in your filter:

    function initBlurBackground(ctx) {
        this.offscreen = new OffscreenCanvas(...)

The other solution is to simply do the initialisation in the main function
of the filter:

    if(!(offscreen in this)) {
        this.offscreen = new OffscreenCanvas(...)

In either case, the data structures are only created when the filter is
first invoked, which means that only users who use your filter pay the
cost of initialisation.

-- Juliusz

  reply	other threads:[~2024-05-05 20:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-05 18:56 [Galene] " Francis Bolduc
2024-05-05 19:14 ` [Galene] " Juliusz Chroboczek
2024-05-05 19:35   ` Francis Bolduc
2024-05-05 20:47     ` Juliusz Chroboczek [this message]
2024-05-05 21:49       ` Francis Bolduc

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox