|
@@ -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 {
|