@stream-io/video-filters-web 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/index.cjs.js +5 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +5 -4
- package/dist/index.es.js.map +1 -1
- package/dist/src/webgl2/resizingStage.d.ts +1 -1
- package/dist/src/webgl2/webgl2Pipeline.d.ts +1 -1
- package/package.json +1 -1
- package/src/webgl2/resizingStage.ts +4 -1
- package/src/webgl2/webgl2Pipeline.ts +2 -0
package/dist/index.es.js
CHANGED
|
@@ -572,7 +572,7 @@ function buildJointBilateralFilterStage(gl, vertexShader, positionBuffer, texCoo
|
|
|
572
572
|
return { render, updateSigmaSpace, updateSigmaColor, cleanUp };
|
|
573
573
|
}
|
|
574
574
|
|
|
575
|
-
function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tflite, segmentationConfig) {
|
|
575
|
+
function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tflite, segmentationConfig, onError) {
|
|
576
576
|
const fragmentShaderSource = glsl `#version 300 es
|
|
577
577
|
|
|
578
578
|
precision highp float;
|
|
@@ -606,7 +606,8 @@ function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tf
|
|
|
606
606
|
// Downloads pixels asynchronously from GPU while rendering the current frame.
|
|
607
607
|
// The pixels will be available in the next frame render which results
|
|
608
608
|
// in offsets in the segmentation output but increases the frame rate.
|
|
609
|
-
readPixelsAsync(gl, 0, 0, outputWidth, outputHeight, gl.RGBA, gl.UNSIGNED_BYTE, outputPixels)
|
|
609
|
+
readPixelsAsync(gl, 0, 0, outputWidth, outputHeight, gl.RGBA, gl.UNSIGNED_BYTE, outputPixels).catch((error) => {
|
|
610
|
+
});
|
|
610
611
|
for (let i = 0; i < outputPixelCount; i++) {
|
|
611
612
|
const tfliteIndex = tfliteInputMemoryOffset + i * 3;
|
|
612
613
|
const outputIndex = i * 4;
|
|
@@ -671,7 +672,7 @@ function buildSoftmaxStage(gl, vertexShader, positionBuffer, texCoordBuffer, tfl
|
|
|
671
672
|
return { render, cleanUp };
|
|
672
673
|
}
|
|
673
674
|
|
|
674
|
-
function buildWebGL2Pipeline(videoSource, backgroundImage, blurLevel, backgroundFilter, canvas, tflite, segmentationConfig) {
|
|
675
|
+
function buildWebGL2Pipeline(videoSource, backgroundImage, blurLevel, backgroundFilter, canvas, tflite, segmentationConfig, onError) {
|
|
675
676
|
const gl = canvas.getContext('webgl2');
|
|
676
677
|
if (!gl)
|
|
677
678
|
throw new Error('WebGL2 is not supported');
|
|
@@ -1538,7 +1539,7 @@ const createTFLiteSIMDModule = (__Module) => {
|
|
|
1538
1539
|
return __Module.ready;
|
|
1539
1540
|
};
|
|
1540
1541
|
|
|
1541
|
-
const version = "0.1.
|
|
1542
|
+
const version = "0.1.6";
|
|
1542
1543
|
const packageName = "@stream-io/video-filters-web";
|
|
1543
1544
|
|
|
1544
1545
|
// @ts-expect-error - module is not declared
|