From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by mail.toke.dk (Postfix) with ESMTPS id C6C90A6800F for ; Sun, 5 May 2024 23:49:26 +0200 (CEST) Authentication-Results: mail.toke.dk; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=DpycXfFu Received: by mail-yb1-xb2b.google.com with SMTP id 3f1490d57ef6-de477949644so1426523276.1 for ; Sun, 05 May 2024 14:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714945764; x=1715550564; darn=lists.galene.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=u53Zi4BSuWC4uWjGvlHEjxthLiUJZXi6ELFZ+6FCMzg=; b=DpycXfFu45G06o2SruF28YQk6pivIo1M+wAegSEVdmD7sTCT3P9ZBt2AO3T7a9TGv5 wRHg3e59+vJMeN/Q/HtTOP3dLSvawTaafPLV4sLq5CI3WldC2Ccv+tJshyI1Q33ZDcHZ yP/lgr+7MKu5xvkR7RO5ioBj1mPYgsNZdSZibC9Kj98kBmy9rP0KUFyWNtc93fidNwrp uoScQf1YIQxFprj8YQmVXf+o2HX6Q5puI9/W9R7wSYW99vmhB5WFHLWWUjEZ39mKk9uX 7YMpsegHTVz5K/iem93kwsgWt3OEBRJen1kwS5hqmzYQDfbxjlHOpJXBb/AMAih0ilhK u7rA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714945764; x=1715550564; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u53Zi4BSuWC4uWjGvlHEjxthLiUJZXi6ELFZ+6FCMzg=; b=NcWMoUxcleiZQpve9fQ7xK8rJLD4rU3nDS/mvJLeXHjPXATHXmZikiRZBzdvXasvXb WQ27GTIohy+Njt9di52LCkgPJcvEp1+r+dHHpweIfGvhkU0hteWmN3sWj5HqH2rInwqT 09YvP6vTyxtugWrl1ADZ4kfr4y+lCwXSkXq+dj0DSkBgDUaATliJpKzFKP4ctSSc1ivc 1a8+fUCG1SNzbclOA6JP71nmpeKmTsMWO6eS8JwbNvdOHlHXQqGwBb5+YsQoctlElvyh jhg0RPOI3yz1+AWj8H3T0+Xl6EGdKCaBwHr/cvJ2jrfBgOVimodbdX30ym4bhJaYH1w6 TqRA== X-Gm-Message-State: AOJu0YwQGh2PPRAOqAUbUqBmQVOrENtjDwj9acdcVI6TQ7S1eArr/uO0 E12xPB6LeIU6Ee1JslGNaglFf5IeLNfgnPMABTVs1odNSE39rG8zJhkBKiQgCYbO7wGSvRcGOb1 tEKGNz3BbBngit+WjnEuG3l3/3oQ= X-Google-Smtp-Source: AGHT+IEl6hZfGj6Q0Zi9nhIs99qglmLaVOCJlC7JEQxQrHc5bWnXK1DkC+xsOR8NCSjoZc4Ra5zFFsjclst26egrArQ= X-Received: by 2002:a25:bcc5:0:b0:de5:6a2f:45d3 with SMTP id l5-20020a25bcc5000000b00de56a2f45d3mr10824146ybm.36.1714945764181; Sun, 05 May 2024 14:49:24 -0700 (PDT) MIME-Version: 1.0 References: <87msp4dqaj.wl-jch@irif.fr> <87ikzsdlzg.wl-jch@irif.fr> In-Reply-To: <87ikzsdlzg.wl-jch@irif.fr> From: Francis Bolduc Date: Sun, 5 May 2024 17:49:13 -0400 Message-ID: To: Juliusz Chroboczek Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: OMMFXPVAKNEUYB7VHC4P7SM3O4UEMWYL X-Message-ID-Hash: OMMFXPVAKNEUYB7VHC4P7SM3O4UEMWYL X-MailFrom: fbolduc@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: galene@lists.galene.org X-Mailman-Version: 3.3.9 Precedence: list Subject: [Galene] Re: Blur background List-Id: =?utf-8?q?Gal=C3=A8ne_videoconferencing_server_discussion_list?= Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Thank you, I did not notice the init method. I will use that one. Regards, Francis On Sun, May 5, 2024 at 4:47=E2=80=AFPM Juliusz Chroboczek wro= te: > > > 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 abandone= d. > > [1] https://chromestatus.com/feature/5077577782263808 > > >>> + offscreen =3D 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 =3D new OffscreenCanvas(...) > ... > > The other solution is to simply do the initialisation in the main functio= n > of the filter: > > if(!(offscreen in this)) { > this.offscreen =3D 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