Galène videoconferencing server discussion list archives
 help / color / mirror / Atom feed
From: Francis Bolduc <fbolduc@gmail.com>
To: Juliusz Chroboczek <jch@irif.fr>
Cc: galene@lists.galene.org
Subject: [Galene] Re: Blur background
Date: Sun, 5 May 2024 17:49:13 -0400	[thread overview]
Message-ID: <CAHpL4=gDdDRrjJzSErQuewsu1SMgiEQN5OxcepyWTyk1_TOdDQ@mail.gmail.com> (raw)
In-Reply-To: <87ikzsdlzg.wl-jch@irif.fr>

Thank you, I did not notice the init method. I will use that one.

Regards,
Francis


On Sun, May 5, 2024 at 4:47 PM Juliusz Chroboczek <jch@irif.fr> wrote:
>
> > 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.
>
> [1] https://chromestatus.com/feature/5077577782263808
>
> >>> +    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:
>
>     'blur-background':
>         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 21:49 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
2024-05-05 21:49       ` Francis Bolduc [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.galene.org/postorius/lists/galene.lists.galene.org/

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

  git send-email \
    --in-reply-to='CAHpL4=gDdDRrjJzSErQuewsu1SMgiEQN5OxcepyWTyk1_TOdDQ@mail.gmail.com' \
    --to=fbolduc@gmail.com \
    --cc=galene@lists.galene.org \
    --cc=jch@irif.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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