浏览代码

Merge branch 'master' of http://192.168.0.115:3000/xushiting/Metaverse

xushiting 3 年之前
父节点
当前提交
c61d9823aa
共有 2 个文件被更改,包括 10 次插入8 次删除
  1. 1 1
      src/ActionsHandler.js
  2. 9 7
      src/h264Decoder/VDecoder.js

+ 1 - 1
src/ActionsHandler.js

@@ -26,7 +26,7 @@ export default class ActionsHandler {
         //xst
         window.workerReady = false
         this.vDecoder = new VDecoder({   
-            maxChip: 10,
+            maxChip: 3,
           });
         window.vDecoder = this.vDecoder
         this.init()

+ 9 - 7
src/h264Decoder/VDecoder.js

@@ -48,10 +48,10 @@ export class VDecoder extends EventEmitter {
       switch (message.type) {
         case "pictureReady":
           //   onPictureReady(message);
-          console.log(
-            "[VDecoder]::decodeData",
-            Object.assign(message, { clipId: this.decodingId })
-          );
+          // console.log(
+          //   "[VDecoder]::decodeData",
+          //   Object.assign(message, { clipId: this.decodingId })
+          // );
           this.emit(
             "decodeData",
             Object.assign(message, { clipId: this.decodingId })
@@ -101,13 +101,13 @@ export class VDecoder extends EventEmitter {
           this.emit("fetchDone", clip);
           this.cacheBuffer = data.slice();
           this.tempVideos.push(clip);
-          console.log("[VDecoder]:获取clip,", clip);
+          // console.log("[VDecoder]:获取clip,", clip);
           this.start = Date.now();
           this.cacheBufferTotal = clip.data.length;
           this.decodeNext(clip.id);
           return Promise.resolve(clip);
         } else {
-          console.warn("[VDecoder]:fetch取帧为空", rangeFetch);
+          // console.warn("[VDecoder]:fetch取帧为空", rangeFetch);
         }
       })
       .catch((error) => {
@@ -178,7 +178,7 @@ export class VDecoder extends EventEmitter {
           this.emit("fetchDone", clip);
           this.cacheBuffer = data.slice();
           this.tempVideos.push(clip);
-          console.log("[VDecoder]:获取clip,", clip);
+          // console.log("[VDecoder]:获取clip,", clip);
           if (decode) {
             this.start = Date.now();
             this.cacheBufferTotal = clip.data.length;
@@ -239,6 +239,8 @@ export class VDecoder extends EventEmitter {
   }
   flush() {
     this.tempVideos = [];
+    this.cacheBufferTotal = null;
+    console.warn('flush')
   }
 
   preloader(preload) {}