xushiting 3 years ago
parent
commit
b452ec226e
2 changed files with 27 additions and 27 deletions
  1. 26 26
      src/Workers.js
  2. 1 1
      笔记.txt

+ 26 - 26
src/Workers.js

@@ -437,32 +437,32 @@ export default class Workers {
         },
         this.setPtr = (this.setPtr + 1) % this.cachedLength
     }
-    SendCacheFrameInfo(e) {
-        var h, f, d, _, g, m, v;
-        const t = e.data.cachedKey
-          , r = e.data.metadata
-          , n = t
-          , o = r
-          , a = (d = (f = (h = o.newUserStates) == null ? void 0 : h.find(y=>y.userId === this.rtcp.network.room.userId)) == null ? void 0 : f.playerState) == null ? void 0 : d.roomTypeId
-          , s = this.rtcp.network.room.skinId
-          , l = (v = (m = (g = (_ = o.newUserStates) == null ? void 0 : _.find(y=>y.userId === this._rtcp.network.room.userId)) == null ? void 0 : g.playerState) == null ? void 0 : m.player) == null ? void 0 : v.position
-          , u = {
-            MsgType: 1,
-            FrameCacheMsg: {
-                FrameIndex: n,
-                RoomTypeId: a,
-                SkinID: s,
-                Position: l
-            }
-        };
-        let c = "";
-        try {
-            c = JSON.stringify(u)
-        } catch (y) {
-            defaultLogger.error(y);
-            return
-        }
-    }
+    // SendCacheFrameInfo(e) {
+    //     var h, f, d, _, g, m, v;
+    //     const t = e.data.cachedKey
+    //       , r = e.data.metadata
+    //       , n = t
+    //       , o = r
+    //       , a = (d = (f = (h = o.newUserStates) == null ? void 0 : h.find(y=>y.userId === this.rtcp.network.room.userId)) == null ? void 0 : f.playerState) == null ? void 0 : d.roomTypeId
+    //       , s = this.rtcp.network.room.skinId
+    //       , l = (v = (m = (g = (_ = o.newUserStates) == null ? void 0 : _.find(y=>y.userId === this._rtcp.network.room.userId)) == null ? void 0 : g.playerState) == null ? void 0 : m.player) == null ? void 0 : v.position
+    //       , u = {
+    //         MsgType: 1,
+    //         FrameCacheMsg: {
+    //             FrameIndex: n,
+    //             RoomTypeId: a,
+    //             SkinID: s,
+    //             Position: l
+    //         }
+    //     };
+    //     let c = "";
+    //     try {
+    //         c = JSON.stringify(u)
+    //     } catch (y) {
+    //         defaultLogger.error(y);
+    //         return
+    //     }
+    // }
     ReceivePanoramaDecodeMessage(e) {
         defaultLogger.info("Receive Panorama Image in Workers.ts"),
         MaskSetToOne(e.data.tileId, this.PanoView);

+ 1 - 1
笔记.txt

@@ -6,7 +6,7 @@ this.workers.dataHandle(r.data)  
 worker里,通过self.onmessage接受到来自主线程的请求并开始执行,然后通过self.postMessage发送请求并传输数据(怀疑将视频流解析成每一帧的yuv数据)到主线程
 
 主线程通过decoderWorker.onmessage来接受来自worker的数据并执行,主要是执行函数:ReceiveDecodeMessage
-ReceiveDecodeMessage函数里给cachedStreams赋值(每帧的yuv数据)
+ReceiveDecodeMessage函数里给cachedStreams/cachedMetas/cachedPtss/cachedRender赋值(每帧的yuv数据)
 
 UpdateYUV通过定时器定时运行,并读取cachedStreams的数据,如下:
 this.cachedStreams[e] != null && this.executeFunction("stream", {