xushiting 3 éve
szülő
commit
81ba818e00
4 módosított fájl, 16 hozzáadás és 11 törlés
  1. 2 0
      src/Signal.js
  2. 2 3
      src/Workers.js
  3. 1 1
      src/main.js
  4. 11 7
      src/v2Decoder/index.js

+ 2 - 0
src/Signal.js

@@ -41,6 +41,8 @@ export default class Signal {
     handleSignal(data, reject) {
         if (!this.signalHandleActived) return;
 
+        //console.log('metadata:'+JSON.stringify(data));
+
         const time1 = Date.now()
         const { signal, alreadyUpdateYUV } = data;
         this.handleActionResponses(signal), this._room.handleSignalHook(signal);

+ 2 - 3
src/Workers.js

@@ -1315,9 +1315,8 @@ export default class Workers {
           };
           //有效Iframe
           //console.error("IT", It);
-          //console.log("It.data", It.data);
-
-          //console.error("IT", fCnt, It);
+          console.log("Work-It1.data", It.data);
+          console.log("Work-IT2", fCnt, It.metadata.mediaSrc+','+JSON.stringify(It.metadata.newUserStates[0].playerState.player.position));
           testFrame += 1;
           // console.error("IT", fCnt, JSON.stringify(Rt));
           //console.error("traceIds", fCnt, Rt.traceIds.length);

+ 1 - 1
src/main.js

@@ -38,7 +38,7 @@ const l = async()=>{
             // wsServerUrl: "ws://localhost:6688/ws",
             //wsServerUrl: "wss://meta-socket.4dage.com/ws",
             wsServerUrl: "wss://meta-socket1.4dage.com/ws",
-            // appId: "10016",
+            //appId: "10016",
             appId: "0000000003",
             token: " ",
             nickname: nickname,

+ 11 - 7
src/v2Decoder/index.js

@@ -418,7 +418,7 @@ if ("function" === typeof importScripts) {
     console.log("metaverse----core, pts: %s, isIDR: %s, length: %s",
       mediaArray[index].pts,
       mediaArray[index].isIDR,
-      mediaArray[index].media.length
+      mediaArray[index].media.length,
     );
     // var loginfo = 'pts: %s, isIDR: %s, length: %s', mediaArray[index].pts, mediaArray[index].isIDR, mediaArray[index].media.length
 
@@ -477,6 +477,7 @@ if ("function" === typeof importScripts) {
         console.log("[xmedia] %s ------------ 006", mediaArray[index].pts);
         // no media
         if (mediaArray[index].meta != null) {
+          console.log("Work-IT2 掉帧3")
           this.checkPktOrderInConsumer(index);
           console.log("[xmedia] %s ------------ 007", mediaArray[index].pts);
           // Still frame
@@ -487,7 +488,9 @@ if ("function" === typeof importScripts) {
             meta: mediaArray[index].meta,
             metadata: mediaArray[index].metadata,
           });
-        } else {
+        } 
+        else {
+          console.log("Work-IT2 掉帧4")
           console.log("[xmedia] %s ------------ 008", mediaArray[index].pts);
           // Lost_rcv++
           // console.log("lost_rcv++: this.skipFrameUntilI = true")
@@ -512,7 +515,7 @@ if ("function" === typeof importScripts) {
     while (this.getNumOfPktToBeDec() > 0) {
       index = this.readPtr;
       if (this.slotHasMedia(index)) {
-        // dropMedia until IDR // \u6765\u4E0D\u53CA\u89E3\u7801\u4E22\u5E27
+        // dropMedia until IDR // 来不及解码丢帧
         this.packetsDrop += 1;
         if (untilIDR) {
           if (mediaArray[index].isIDR == true) {
@@ -586,7 +589,8 @@ if ("function" === typeof importScripts) {
     try {
       this.procBufItem(this.readPtr);
     } catch (error) {
-      console.log("[xmedia] 掉帧", error);
+      //console.log("[xmedia] 掉帧", error);
+      console.log("Work-IT2 掉帧2")
     }
 
     // if (this.getNumOfPktToBeDec() > this.prevBufNum) {
@@ -681,14 +685,14 @@ if ("function" === typeof importScripts) {
         t: MessageEvent.UpdateStats,
         mediaBytesReceived: self.decoder.mediaBytesReceived,
         metaBytesReceived: self.decoder.metaBytesReceived,
-        packetsLost: self.decoder.packetsLost, // \u7F51\u7EDC\u4E22\u5E27
-        packetsDrop: self.decoder.packetsDrop, // \u6765\u4E0D\u53CA\u89E3\u7801\u4E22\u5E27
+        packetsLost: self.decoder.packetsLost, // 网络丢帧
+        packetsDrop: self.decoder.packetsDrop, // 来不及解码丢帧
         framesReceived: self.decoder.receivedMedia,
         framesDecoded: self.decoder.receivedYUV,
         framesRendered: self.decoder.receivedEmit,
         framesReturned: framesReturned,
         // framesAwait: leastReceivePts - lastProcessPts,
-        framesAwait: self.decoder.getNumOfPktToBeDec(), // \u7B49\u5F85\u89E3\u7801\u7684\u5E27
+        framesAwait: self.decoder.getNumOfPktToBeDec(), // 等待解码的帧
         decodeTimePerFrame: dtpf,
         decodeTimeMaxFrame: dtmf,
         sendOutBuffer: send_out_buffer,