@yume-chan/scrcpy-decoder-webcodecs
Version:
Raw H.264 stream decoder and renderer using WebCodecs API (requires modern browser).
22 lines • 582 B
JavaScript
import { createCanvas } from "@yume-chan/scrcpy-decoder-tinyh264";
export class CanvasVideoFrameRenderer {
#canvas;
get canvas() {
return this.#canvas;
}
constructor(canvas) {
if (canvas) {
this.#canvas = canvas;
}
else {
this.#canvas = createCanvas();
}
}
setSize(width, height) {
if (this.#canvas.width !== width || this.#canvas.height !== height) {
this.#canvas.width = width;
this.#canvas.height = height;
}
}
}
//# sourceMappingURL=canvas.js.map