From 45c2711522d2a2e3ba716272e764ef14ce2c0ec9 Mon Sep 17 00:00:00 2001 From: Juliusz Chroboczek Date: Wed, 13 Jan 2021 14:20:23 +0100 Subject: [PATCH] Add contextAttributes to filter definition. --- static/galene.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/static/galene.js b/static/galene.js index 431b7b8..5cb1e34 100644 --- a/static/galene.js +++ b/static/galene.js @@ -799,6 +799,7 @@ async function setMaxVideoThroughput(c, bps) { * @typedef {Object} filterDefinition * @property {string} [description] * @property {string} [contextType] + * @property {Object} [contextAttributes] * @property {(this: Filter, src: CanvasImageSource, width: number, height: number, ctx: RenderingContext) => boolean} f */ @@ -824,7 +825,9 @@ function Filter(stream, definition) { /** @type {HTMLCanvasElement} */ this.canvas = document.createElement('canvas'); /** @type {any} */ - this.context = this.canvas.getContext(definition.contextType || '2d'); + this.context = this.canvas.getContext( + definition.contextType || '2d', + definition.contextAttributes || null); /** @type {MediaStream} */ this.captureStream = null; /** @type {MediaStream} */