@stream-io/video-filters-web 0.1.4 → 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 CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.1.6](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.1.5...@stream-io/video-filters-web-0.1.6) (2024-11-12)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * handle async errors in background filters pipeline ([#1571](https://github.com/GetStream/stream-video-js/issues/1571)) ([53a5ac3](https://github.com/GetStream/stream-video-js/commit/53a5ac3691a6fe71a0b7b6695aa6c0ffaa01d3ec)), closes [#1565](https://github.com/GetStream/stream-video-js/issues/1565)
11
+
12
+ ## [0.1.5](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.1.4...@stream-io/video-filters-web-0.1.5) (2024-11-08)
13
+
14
+
15
+ ### Bug Fixes
16
+
17
+ * guard against null fenceSync ([#1565](https://github.com/GetStream/stream-video-js/issues/1565)) ([9a3ae38](https://github.com/GetStream/stream-video-js/commit/9a3ae385ebed5b7fd44855ed2a7b7fc01ac53792))
18
+
5
19
  ## [0.1.4](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-filters-web-0.1.3...@stream-io/video-filters-web-0.1.4) (2024-09-19)
6
20
 
7
21
 
package/dist/index.cjs.js CHANGED
@@ -86,6 +86,8 @@ async function readPixelsAsync(gl, x, y, width, height, format, type, dest) {
86
86
  async function getBufferSubDataAsync(gl, target, buffer, srcByteOffset, dstBuffer, dstOffset, length) {
87
87
  const sync = gl.fenceSync(gl.SYNC_GPU_COMMANDS_COMPLETE, 0);
88
88
  gl.flush();
89
+ if (!sync)
90
+ return;
89
91
  const res = await clientWaitAsync(gl, sync);
90
92
  gl.deleteSync(sync);
91
93
  if (res !== gl.WAIT_FAILED) {
@@ -572,7 +574,7 @@ function buildJointBilateralFilterStage(gl, vertexShader, positionBuffer, texCoo
572
574
  return { render, updateSigmaSpace, updateSigmaColor, cleanUp };
573
575
  }
574
576
 
575
- function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tflite, segmentationConfig) {
577
+ function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tflite, segmentationConfig, onError) {
576
578
  const fragmentShaderSource = glsl `#version 300 es
577
579
 
578
580
  precision highp float;
@@ -606,7 +608,8 @@ function buildResizingStage(gl, vertexShader, positionBuffer, texCoordBuffer, tf
606
608
  // Downloads pixels asynchronously from GPU while rendering the current frame.
607
609
  // The pixels will be available in the next frame render which results
608
610
  // in offsets in the segmentation output but increases the frame rate.
609
- readPixelsAsync(gl, 0, 0, outputWidth, outputHeight, gl.RGBA, gl.UNSIGNED_BYTE, outputPixels);
611
+ readPixelsAsync(gl, 0, 0, outputWidth, outputHeight, gl.RGBA, gl.UNSIGNED_BYTE, outputPixels).catch((error) => {
612
+ });
610
613
  for (let i = 0; i < outputPixelCount; i++) {
611
614
  const tfliteIndex = tfliteInputMemoryOffset + i * 3;
612
615
  const outputIndex = i * 4;
@@ -671,7 +674,7 @@ function buildSoftmaxStage(gl, vertexShader, positionBuffer, texCoordBuffer, tfl
671
674
  return { render, cleanUp };
672
675
  }
673
676
 
674
- function buildWebGL2Pipeline(videoSource, backgroundImage, blurLevel, backgroundFilter, canvas, tflite, segmentationConfig) {
677
+ function buildWebGL2Pipeline(videoSource, backgroundImage, blurLevel, backgroundFilter, canvas, tflite, segmentationConfig, onError) {
675
678
  const gl = canvas.getContext('webgl2');
676
679
  if (!gl)
677
680
  throw new Error('WebGL2 is not supported');
@@ -1538,7 +1541,7 @@ const createTFLiteSIMDModule = (__Module) => {
1538
1541
  return __Module.ready;
1539
1542
  };
1540
1543
 
1541
- const version = "0.1.4";
1544
+ const version = "0.1.6";
1542
1545
  const packageName = "@stream-io/video-filters-web";
1543
1546
 
1544
1547
  // @ts-expect-error - module is not declared