web worker fix

pull/280/head
Vladimir Mandic 2021-01-03 10:41:56 -05:00
parent 4fb51ad583
commit e4a85fcb85
3 changed files with 3 additions and 3 deletions

View File

@ -269,7 +269,7 @@ function webWorker(input, image, canvas, timestamp) {
});
}
// pass image data as arraybuffer to worker by reference to avoid copy
worker.postMessage({ image: image.data.buffer, width: canvas.width, height: canvas.height, userConfig }, 'Human', [image.data.buffer]);
worker.postMessage({ image: image.data.buffer, width: canvas.width, height: canvas.height, userConfig }, [image.data.buffer]);
}
// main processing function when input is webcam, can use direct invocation or web worker

View File

@ -24,6 +24,6 @@ onmessage = async (msg) => {
}
// must strip canvas from return value as it cannot be transfered from worker thread
if (result.canvas) result.canvas = null;
postMessage({ result }, 'Human');
postMessage({ result });
busy = false;
};

2
wiki

@ -1 +1 @@
Subproject commit 43425df86424e9b5f4bec3510f3565963255d4a9
Subproject commit d24d9fb46e8951284fafe55545c78a02df271c98