xushiting пре 3 година
родитељ
комит
7407d414c1
5 измењених фајлова са 26 додато и 16 уклоњено
  1. 2 2
      dist/index.html
  2. 2 1
      src/Workers.js
  3. 2 2
      src/config/rtcConfig.js
  4. 2 2
      src/main.js
  5. 18 9
      src/v2Decoder/index.js

+ 2 - 2
dist/index.html

@@ -163,8 +163,8 @@
     const WASM_Version = "h264"
     , DECODER_VERSION = "v0.9.3"
     , WASM_URLS = {
-        h264: "https://static.xverse.cn/wasm/v15/lib_ff264dec_no_idb_with_wasm_tbundle.js?tbundle=tmeland_base",
-        xv265: "https://static.xverse.cn/wasm/codec-release/h265-dec-sw-wasm/v-0-9-1/libxv265dec.js",
+        h264: "https://metaverse.4dage.com/wasm/lib_ff264dec_no_idb_with_wasm_tbundle.js",
+        xv265: "https://metaverse.4dage.com/wasm/libxv265dec.js",
         h265: ""
     }
     , STUCK_STAGE_GOOD = 45

+ 2 - 1
src/Workers.js

@@ -765,7 +765,7 @@ export default class Workers {
             }
             const _ = "wasm:" + d;
             this._rtcp.sendStringData(_);
-            console.log('meta——丢帧'+data.metadata);//.newUserStates[0].playerState.user.camera.yaw);
+            console.log('meta——丢帧'+s.data.metadata);//.newUserStates[0].playerState.user.camera.yaw);
             break;
           }
           case 9: {
@@ -1068,6 +1068,7 @@ export default class Workers {
         at: at,
       });
     }
+    let copyIDR = b;
     console.log("metaverse----IDR:"+copyIDR);
 
     // debugger;

+ 2 - 2
src/config/rtcConfig.js

@@ -2,9 +2,9 @@ export default {
   WASM_Version: "h264",
   DECODER_VERSION: "v0.9.3",
   WASM_URLS: {
-    h264: "https://static.xverse.cn/wasm/v15/lib_ff264dec_no_idb_with_wasm_tbundle.js?tbundle:tmeland_base",
+    h264: "https://metaverse.4dage.com/wasm/lib_ff264dec_no_idb_with_wasm_tbundle.js",
     xv265:
-      "https://static.xverse.cn/wasm/codec-release/h265-dec-sw-wasm/v-0-9-1/libxv265dec.js",
+      "https://metaverse.4dage.com/wasm/libxv265dec.js",
     h265: "",
   },
   STUCK_STAGE_GOOD: 45,

+ 2 - 2
src/main.js

@@ -34,9 +34,9 @@ const l = async()=>{
             avatarId: 'KGe_Boy',
             roomId: 'e629ef3e-022d-4e64-8654-703bb96410eb',
             userId: nickname,
-            wsServerUrl: 'wss://uat-eks.xverse.cn/ws',
+            //wsServerUrl: 'wss://uat-eks.xverse.cn/ws',
             // wsServerUrl: "ws://localhost:6688/ws",
-            //wsServerUrl: "wss://meta-socket.4dage.com/ws",
+            wsServerUrl: "wss://meta-socket.4dage.com/ws",
             appId: "10016",
             token: " ",
             nickname: nickname,

+ 18 - 9
src/v2Decoder/index.js

@@ -173,6 +173,7 @@ if ("function" === typeof importScripts) {
   //end refactor
 
   Decoder.prototype.resetDecoder = function () {
+    console.log("[xmedia] isFirstFrame 璁剧疆 TRUE");
     this.isFirstFrame = 1;
     this.expected_frameCnt = 1;
 
@@ -494,6 +495,7 @@ if ("function" === typeof importScripts) {
         }
       }
     }
+    console.log('procBufItem');
     this.dumpJitterBufInfo("Leaving Decoder.prototype.procBufItem, " + loginfo);
     this.lastObj = mediaArray[index];
     this.resetBufItem(index);
@@ -525,6 +527,7 @@ if ("function" === typeof importScripts) {
       this.resetBufItem(index);
     }
     if (!breakWhenIDR) {
+      console.log("[xmedia] isFirstFrame 璁剧疆 TRUE");
       this.isFirstFrame = true;
     }
     this.dumpJitterBufInfo("Leaving Decoder.prototype.flushBuffer");
@@ -532,6 +535,7 @@ if ("function" === typeof importScripts) {
   };
   // var cnt = 0
   Decoder.prototype.getFrameToDecode = function () {
+    
     this.dumpJitterBufInfo("Entering Decoder.prototype.getFrameToDecode");
 
     if (this.getNumOfPktToBeDec() == 0) {
@@ -745,7 +749,7 @@ if ("function" === typeof importScripts) {
     printConsole.log("Going to open decoder " + String(Date.now()));
     var ret0 = Module._openDecoder(0, decoder_type, LOG_LEVEL_WASM);
     if (ret0 == 0) {
-      self.decoder.startDecoding();                                                                     //开始解码
+      self.decoder.startDecoding();                                                                     //锟斤拷始锟斤拷锟斤拷
       self.postMessage({
         t: MessageEvent.WASMReady,
         wasm_ready: true,
@@ -794,10 +798,10 @@ if ("function" === typeof importScripts) {
     // return data.isIDR && media.byteLength !=0
     let flag =  isIDR && mediaLen != 0;
     if(flag){
-      console.log('metaverse---------IFrame');
+      console.log('metaverse---------锟斤拷IFrame');
     }
     else{
-      console.log('metaverse---------不是IFrame');
+      console.log('metaverse---------锟斤拷锟斤拷IFrame');
     }
     return flag;
   };
@@ -806,10 +810,10 @@ if ("function" === typeof importScripts) {
     // return !data.isIDR && media.byteLength !=0
     let flag = !isIDR && mediaLen != 0;
     if(flag){
-      console.log('metaverse---------PFrame');
+      console.log('metaverse---------锟斤拷PFrame');
     }
     else{
-      console.log('metaverse---------不是PFrame');
+      console.log('metaverse---------锟斤拷锟斤拷PFrame');
     }
     return flag;
   };
@@ -818,10 +822,10 @@ if ("function" === typeof importScripts) {
     // return media.byteLength == 0 && meta.byteLength !=0
     let flag = mediaLen == 0 && metaLen != 0;
     if(flag){
-      console.log('metaverse---------PureMeta');
+      console.log('metaverse---------锟斤拷PureMeta');
     }
     else{
-      console.log('metaverse---------不是PureMeta');
+      console.log('metaverse---------锟斤拷锟斤拷PureMeta');
     }
     return flag;
   };
@@ -870,6 +874,7 @@ if ("function" === typeof importScripts) {
   };
 
   Decoder.prototype.receiveFrame = function (data) {
+    console.log("[xmedia] receiveFrame");
     var key = data.cachedKey;
     var pts = data.frameCnt;
     var meta = data.data.subarray(0, data.metaLen);
@@ -898,6 +903,7 @@ if ("function" === typeof importScripts) {
       this.prevSeq = this.seqDiff(pts, 1, 65536);
       this.readPtr = this.writePtr = pts % CACHE_BUF_LENGTH;
       if (data.isIDR) {
+        console.log("[xmedia] isFirstFrame 璁剧疆 FALSE");
         this.isFirstFrame = false;
       }
     }
@@ -924,6 +930,7 @@ if ("function" === typeof importScripts) {
     //refactor:
     // Step 1, big jump detected. we cannot handle it, flush all.
     var untilIDR, pktDrop;
+    
     if (this.isSeqJump(this.prevSeq, pts)) {
       // console.log('[resetdecoder] Fatal: decoder seq jump from ' + this.prevSeq + ' to ' + pts)
       untilIDR = false;
@@ -931,6 +938,7 @@ if ("function" === typeof importScripts) {
       pktDrop = this.handleNewPktOnFlush(data.isIDR, media.byteLength);
       if (pktDrop) return;
     }
+    
     this.dumpJitterBufInfo("Entering Decoder.prototype.receiveFrame", pts);
     // console.log("--->> this.notEnoughSlots(pts): %s", this.notEnoughSlots(pts))
 
@@ -1195,7 +1203,7 @@ if ("function" === typeof importScripts) {
       printConsole.error("null content in decoder", "5999");
       return;
     }
-
+    
     var content_size = content.byteLength;
     // var cacheBuffer = Module._malloc(content_size)
     // var resultBuffer = Module._malloc(64)
@@ -1206,6 +1214,7 @@ if ("function" === typeof importScripts) {
     
     // debugger
     if (content_size != 0) {
+      
       // var date = Date.now()
       // var curDate = Date.now()
       // while (curDate - date < 100) {
@@ -1221,7 +1230,7 @@ if ("function" === typeof importScripts) {
         this.errorCacheBuffer.set(content, this.mediaCacheSize);
         this.errorCacheSize += content.byteLength;
       }
-
+      
       let start_ts = Date.now();
       let ret = 0;
       try {