Commit 45c27115 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Add contextAttributes to filter definition.

parent 684c8c5d
......@@ -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} */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment