Commit 0e206d09 authored by Linshizhi's avatar Linshizhi

update

parent 457bca7d
import { sleep } from '../src/utils.js';
import { H264EncWWGroup, H264GRP_OPTIONS } from '../src/encGroup.js';
describe("H264EncWWGroup Spec", () => {
it("Instantiation", async () => {
let wg = new H264EncWWGroup("h264enc", { numOfWW: 2 });
await wg.start();
await sleep(1000);
expect(wg.numOfWorker()).toBe(2);
});
fit("Encode by H264EncWWGroup Spec", async () => {
const RGBAFrameSize = 1920*1080*4;
let grp = new H264EncWWGroup("h264enc", {
numOfWW: 8,
encchnlsize: RGBAFrameSize * 10,
bridgechnlsize: Math.pow(2, 25)
});
await grp.start();
const data = new Uint8Array([...Array(RGBAFrameSize).keys()]);
for (let i = 0; i < 300; ++i) {
await grp.dispatch(data);
}
// Terminated
await grp.dispatch(null);
await sleep(100000);
}, 300000)
})
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