aboutsummaryrefslogtreecommitdiff
path: root/lvc/codec-web/web/main.ts
blob: 150e1c31f6233b065b97a0e753c510f2cfe5f96c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/// <reference lib="dom" />

import init, { decode_frame, decode_init } from "./codec_web.js"
console.log("init wasm");
await init()
console.log("done");

decode_init(1920, 1080)

const res = await fetch("/data/encoded")
if (!res.ok) throw new Error("not ok");

const buf = new Uint8Array(await res.arrayBuffer())

console.log("decode");
const frame = decode_frame(buf.slice(0, 500000), true);
console.log("done");
console.log(frame);